xkb-a11y/x11: Get X11 display from X11 backend

Instead of from ClutterX11.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
This commit is contained in:
Jonas Ådahl 2021-09-17 21:31:20 +02:00
parent 4622bd7ca8
commit c41d2a17da

View File

@ -27,7 +27,9 @@
#include <X11/XKBlib.h>
#include <X11/extensions/XKBstr.h>
#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))