From c41d2a17da8bfba03a22e285e3de03fd678f5328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 17 Sep 2021 21:31:20 +0200 Subject: [PATCH] xkb-a11y/x11: Get X11 display from X11 backend Instead of from ClutterX11. Part-of: --- src/backends/x11/meta-xkb-a11y-x11.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/backends/x11/meta-xkb-a11y-x11.c b/src/backends/x11/meta-xkb-a11y-x11.c index 32ad17d57..31313774c 100644 --- a/src/backends/x11/meta-xkb-a11y-x11.c +++ b/src/backends/x11/meta-xkb-a11y-x11.c @@ -27,7 +27,9 @@ #include #include +#include "backends/x11/meta-backend-x11.h" #include "backends/x11/meta-clutter-backend-x11.h" +#include "backends/x11/meta-seat-x11.h" #include "core/display-private.h" #include "meta/meta-x11-errors.h" @@ -43,6 +45,15 @@ static int _xkb_event_base; +static Display * +xdisplay_from_seat (ClutterSeat *seat) +{ + MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat); + MetaBackend *backend = meta_seat_x11_get_backend (META_SEAT_X11 (seat_x11)); + + return meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend)); +} + static XkbDescRec * get_xkb_desc_rec (Display *xdisplay) { @@ -78,7 +89,7 @@ set_xkb_desc_rec (Display *xdisplay, static void check_settings_changed (ClutterSeat *seat) { - Display *xdisplay = meta_clutter_x11_get_default_display (); + Display *xdisplay = xdisplay_from_seat (seat); MetaKbdA11ySettings kbd_a11y_settings; MetaKeyboardA11yFlags what_changed = 0; MetaInputSettings *input_settings; @@ -206,7 +217,7 @@ void meta_seat_x11_apply_kbd_a11y_settings (ClutterSeat *seat, MetaKbdA11ySettings *kbd_a11y_settings) { - Display *xdisplay = meta_clutter_x11_get_default_display (); + Display *xdisplay = xdisplay_from_seat (seat); XkbDescRec *desc; gboolean enable_accessX; @@ -328,7 +339,7 @@ meta_seat_x11_a11y_init (ClutterSeat *seat) ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); MetaClutterBackendX11 *clutter_backend_x11 = META_CLUTTER_BACKEND_X11 (clutter_backend); - Display *xdisplay = meta_clutter_x11_get_default_display (); + Display *xdisplay = xdisplay_from_seat (seat); guint event_mask; if (!is_xkb_available (xdisplay))