Move detection for defaultDepth to xcbutils

remotes/origin/Plasma/5.0
Martin Gräßlin 13 years ago
parent a1ac6df20e
commit 2dcbbd6a3a
  1. 12
      outline.cpp
  2. 18
      xcbutils.h

@ -96,17 +96,7 @@ void Outline::showWithX()
m_initialized = true;
}
int screen = QX11Info::appScreen();
int defaultDepth = 0;
// TODO: move into xcbutils or maybe kwinglobals
for (xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(connection()));
it.rem;
--screen, xcb_screen_next(&it)) {
if (screen == 0) {
defaultDepth = it.data->root_depth;
break;
}
}
const int defaultDepth = Xcb::defaultDepth();
// left/right parts are between top/bottom, they don't reach as far as the corners
const uint16_t verticalWidth = 5;

@ -512,6 +512,24 @@ static inline void restackWindowsWithRaise(const QVector<xcb_window_t> &windows)
restackWindows(windows);
}
static inline int defaultDepth()
{
static int depth = 0;
if (depth != 0) {
return depth;
}
int screen = QX11Info::appScreen();
for (xcb_screen_iterator_t it = xcb_setup_roots_iterator(xcb_get_setup(connection()));
it.rem;
--screen, xcb_screen_next(&it)) {
if (screen == 0) {
depth = it.data->root_depth;
break;
}
}
return depth;
}
} // namespace X11
} // namespace KWin

Loading…
Cancel
Save