shell/global: Stop tracking xdisplay/input-region

Instead, let mutter do that

Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3362>
This commit is contained in:
Bilal Elmoussaoui 2024-06-27 09:38:23 +02:00
parent 446bee5f1d
commit 4c771e2da0

View File

@ -29,7 +29,6 @@
#ifdef HAVE_X11 #ifdef HAVE_X11
#include <meta/meta-x11-display.h> #include <meta/meta-x11-display.h>
#include <X11/extensions/Xfixes.h>
#endif #endif
#define GNOME_DESKTOP_USE_UNSTABLE_API #define GNOME_DESKTOP_USE_UNSTABLE_API
@ -62,12 +61,6 @@ struct _ShellGlobal {
MetaDisplay *meta_display; MetaDisplay *meta_display;
MetaCompositor *compositor; MetaCompositor *compositor;
MetaWorkspaceManager *workspace_manager; MetaWorkspaceManager *workspace_manager;
#ifdef HAVE_X11
Display *xdisplay;
XserverRegion input_region;
#endif
char *session_mode; char *session_mode;
@ -811,13 +804,8 @@ shell_global_set_stage_input_region (ShellGlobal *global,
rects[i].height = rect->height; rects[i].height = rect->height;
} }
if (global->input_region) meta_x11_display_set_stage_input_region (x11_display, rects, nrects);
XFixesDestroyRegion (global->xdisplay, global->input_region);
global->input_region = XFixesCreateRegion (global->xdisplay, rects, nrects);
g_free (rects); g_free (rects);
meta_x11_display_set_stage_input_region (x11_display, global->input_region);
#endif #endif
} }
@ -1029,6 +1017,9 @@ _shell_global_set_plugin (ShellGlobal *global,
MetaDisplay *display; MetaDisplay *display;
MetaBackend *backend; MetaBackend *backend;
MetaSettings *settings; MetaSettings *settings;
#ifdef HAVE_X11
MetaX11Display *x11_display;
#endif
g_return_if_fail (SHELL_IS_GLOBAL (global)); g_return_if_fail (SHELL_IS_GLOBAL (global));
g_return_if_fail (global->plugin == NULL); g_return_if_fail (global->plugin == NULL);
@ -1047,14 +1038,6 @@ _shell_global_set_plugin (ShellGlobal *global,
global->stage = CLUTTER_STAGE (meta_get_stage_for_display (display)); global->stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
#ifdef HAVE_X11
if (!meta_is_wayland_compositor ())
{
MetaX11Display *x11_display = meta_display_get_x11_display (display);
global->xdisplay = meta_x11_display_get_xdisplay (x11_display);
}
#endif
st_entry_set_cursor_func (entry_cursor_func, global); st_entry_set_cursor_func (entry_cursor_func, global);
st_clipboard_set_selection (meta_display_get_selection (display)); st_clipboard_set_selection (meta_display_get_selection (display));
@ -1088,7 +1071,8 @@ _shell_global_set_plugin (ShellGlobal *global,
""); "");
#ifdef HAVE_X11 #ifdef HAVE_X11
if (global->xdisplay) x11_display = meta_display_get_x11_display (display);
if (x11_display && meta_x11_display_get_xdisplay (x11_display))
g_signal_connect_object (global->meta_display, "x11-display-closing", g_signal_connect_object (global->meta_display, "x11-display-closing",
G_CALLBACK (on_x11_display_closed), global, 0); G_CALLBACK (on_x11_display_closed), global, 0);
#endif #endif