x11-display: Init event mask after taking manager selection

Initializing the event mask, SubstructureRedirectMask in particular,
before taking the manager selection fails with BadAccess. Fix this by
initializing said mask after taking the manager selection.

This fixes `--replace`.

Fixes: eb4307c350
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2432>
This commit is contained in:
Jonas Ådahl 2022-05-27 10:51:24 +02:00
parent a24b14e302
commit 1e95710c52

View File

@ -1303,8 +1303,6 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
xroot,
PropertyChangeMask);
init_event_masks (x11_display);
/* Select for cursor changes so the cursor tracker is up to date. */
XFixesSelectCursorInput (xdisplay, xroot, XFixesDisplayCursorNotifyMask);
@ -1418,6 +1416,8 @@ meta_x11_display_new (MetaDisplay *display, GError **error)
x11_display->wm_sn_atom = wm_sn_atom;
x11_display->wm_sn_timestamp = timestamp;
init_event_masks (x11_display);
return x11_display;
}