Alert if root window button events cannot be selected.
SVN revision: 75320
This commit is contained in:
parent
4d4ddbc3c7
commit
cb441def79
|
@ -47,11 +47,14 @@
|
|||
#include <X11/extensions/Xrandr.h>
|
||||
#endif
|
||||
|
||||
#define EDESK_EVENT_MASK \
|
||||
(ButtonPressMask | ButtonReleaseMask | \
|
||||
EnterWindowMask | LeaveWindowMask /* | PointerMotionMask | ButtonMotionMask */ | \
|
||||
#define DESK_EVENT_MASK1 \
|
||||
(ButtonPressMask | ButtonReleaseMask)
|
||||
#define DESK_EVENT_MASK2 \
|
||||
(EnterWindowMask | LeaveWindowMask | \
|
||||
SubstructureNotifyMask | SubstructureRedirectMask | PropertyChangeMask)
|
||||
|
||||
#define DESK_EVENT_MASK (DESK_EVENT_MASK1 | DESK_EVENT_MASK2)
|
||||
|
||||
#define ENLIGHTENMENT_CONF_NUM_DESKTOPS 32
|
||||
|
||||
typedef struct {
|
||||
|
@ -438,10 +441,13 @@ DeskCreate(int desk, int configure)
|
|||
if (configure)
|
||||
DeskConfigure(dsk);
|
||||
|
||||
/* Root window: Don't include ButtonPressMask as it may cause the event
|
||||
* selection to fail for the other events too.
|
||||
* The ButtonPress/ReleaseMask events are selected in SetupX(). */
|
||||
if (desk == 0)
|
||||
ESelectInputChange(EoGetWin(dsk), EDESK_EVENT_MASK, 0);
|
||||
ESelectInputChange(EoGetWin(dsk), DESK_EVENT_MASK2, 0);
|
||||
else
|
||||
ESelectInput(EoGetWin(dsk), EDESK_EVENT_MASK);
|
||||
ESelectInput(EoGetWin(dsk), DESK_EVENT_MASK);
|
||||
|
||||
return dsk;
|
||||
}
|
||||
|
|
10
src/setup.c
10
src/setup.c
|
@ -163,6 +163,16 @@ SetupX(const char *dstr)
|
|||
EExit(1);
|
||||
}
|
||||
|
||||
mask |= ButtonPressMask | ButtonReleaseMask;
|
||||
ESelectInput(VROOT, mask);
|
||||
ESync(0);
|
||||
if (Dpy.last_error_code)
|
||||
{
|
||||
AlertX(_("Cannot select root window button press events"),
|
||||
_("OK"), NULL, NULL,
|
||||
_("Root window button actions will not work.\n"));
|
||||
}
|
||||
|
||||
/* warn, if necessary about X version problems */
|
||||
if (ProtocolVersion(disp) != 11)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue