mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-01 11:32:34 +01:00
wmaker: make the '--replace' de-activable at compile time
As it is really unlikely that in normal use case someone would need this feature, it is now conditional code, which is not enabled by default; the configure scripts now propose a '--enable-wmreplace' option to enable the corresponding code, as people making package for distributions may want to enable the feature to provide users the ability to give a try of all the window managers. Suggested-by: Carlos R. Mafra <crmafra@gmail.com> Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
28b0169147
commit
ea2b5f0641
@@ -66,7 +66,9 @@
|
||||
|SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask\
|
||||
|KeyPressMask|KeyReleaseMask)
|
||||
|
||||
#ifdef USE_ICCCM_WMREPLACE
|
||||
#define REPLACE_WM_TIMEOUT 15
|
||||
#endif
|
||||
|
||||
#define STIPPLE_WIDTH 2
|
||||
#define STIPPLE_HEIGHT 2
|
||||
@@ -108,6 +110,7 @@ static void make_keys(void)
|
||||
*/
|
||||
static Bool replace_existing_wm(WScreen *scr)
|
||||
{
|
||||
#ifdef USE_ICCCM_WMREPLACE
|
||||
char atomName[16];
|
||||
Window wm;
|
||||
XSetWindowAttributes attribs;
|
||||
@@ -139,10 +142,12 @@ static Bool replace_existing_wm(WScreen *scr)
|
||||
if (!XChangeWindowAttributes(dpy, wm, CWEventMask, &attribs))
|
||||
wm = None;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* for our window manager info notice board and the selection owner */
|
||||
scr->info_window = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 10, 10, 0, 0, 0);
|
||||
|
||||
#ifdef USE_ICCCM_WMREPLACE
|
||||
/* Try to acquire the selection */
|
||||
current_time = CurrentTime;
|
||||
ret = XSetSelectionOwner(dpy, scr->sn_atom, scr->info_window, current_time);
|
||||
@@ -188,6 +193,7 @@ static Bool replace_existing_wm(WScreen *scr)
|
||||
event.data.l[4] = (long) 0L;
|
||||
event.window = scr->root_win;
|
||||
XSendEvent(dpy, scr->root_win, False, StructureNotifyMask, (XEvent *) &event);
|
||||
#endif
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user