1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

Consolidate common X11 XSetWindowAttributes flags

We always specify CWOverrideRedirect. So just assign that to flags
once, instead of assigning it to flags in four different cases.
This commit is contained in:
Andrew Deason 2014-10-25 18:59:25 -05:00
parent a2b5c3f3cf
commit cd95b659c7

View File

@ -618,7 +618,7 @@ static void init_window(lua::state &l __attribute__((unused)), bool own)
#ifdef OWN_WINDOW
if (own) {
int depth = 0, flags;
int depth = 0, flags = CWOverrideRedirect;
Visual *visual = NULL;
if (!find_desktop_window(&window.root, &window.desktop)) {
@ -654,10 +654,10 @@ static void init_window(lua::state &l __attribute__((unused)), bool own)
#ifdef BUILD_ARGB
if (have_argb_visual) {
attrs.colormap = window.colourmap;
flags = CWBorderPixel | CWColormap | CWOverrideRedirect;
flags |= CWBorderPixel | CWColormap;
} else {
#endif /* BUILD_ARGB */
flags = CWBackPixel | CWOverrideRedirect;
flags |= CWBackPixel;
#ifdef BUILD_ARGB
}
#endif /* BUILD_ARGB */
@ -686,10 +686,10 @@ static void init_window(lua::state &l __attribute__((unused)), bool own)
#ifdef BUILD_ARGB
if (have_argb_visual) {
attrs.colormap = window.colourmap;
flags = CWBorderPixel | CWColormap | CWOverrideRedirect;
flags |= CWBorderPixel | CWColormap;
} else {
#endif /* BUILD_ARGB */
flags = CWBackPixel | CWOverrideRedirect;
flags |= CWBackPixel;
#ifdef BUILD_ARGB
}
#endif /* BUILD_ARGB */