screen: Select for events on the guard window on the backend connection
Otherwise, we'll never see them. This fixes the background menu not working in gnome-shell.
This commit is contained in:
parent
12c1a06e60
commit
bc8328d7c2
@ -56,6 +56,8 @@
|
|||||||
#include "x11/window-x11.h"
|
#include "x11/window-x11.h"
|
||||||
#include "x11/xprops.h"
|
#include "x11/xprops.h"
|
||||||
|
|
||||||
|
#include "backends/x11/meta-backend-x11.h"
|
||||||
|
|
||||||
static char* get_screen_name (MetaDisplay *display,
|
static char* get_screen_name (MetaDisplay *display,
|
||||||
int number);
|
int number);
|
||||||
|
|
||||||
@ -470,13 +472,24 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
|
|||||||
XStoreName (xdisplay, guard_window, "mutter guard window");
|
XStoreName (xdisplay, guard_window, "mutter guard window");
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
if (!meta_is_wayland_compositor ())
|
||||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
{
|
||||||
|
MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
|
||||||
|
Display *backend_xdisplay = meta_backend_x11_get_xdisplay (backend);
|
||||||
|
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
||||||
|
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||||
|
|
||||||
XISetMask (mask.mask, XI_ButtonPress);
|
XISetMask (mask.mask, XI_ButtonPress);
|
||||||
XISetMask (mask.mask, XI_ButtonRelease);
|
XISetMask (mask.mask, XI_ButtonRelease);
|
||||||
XISetMask (mask.mask, XI_Motion);
|
XISetMask (mask.mask, XI_Motion);
|
||||||
XISelectEvents (xdisplay, guard_window, &mask, 1);
|
|
||||||
|
/* Sync on the connection we created the window on to
|
||||||
|
* make sure it's created before we select on it on the
|
||||||
|
* backend connection. */
|
||||||
|
XSync (xdisplay, False);
|
||||||
|
|
||||||
|
XISelectEvents (backend_xdisplay, guard_window, &mask, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
|
stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user