summaryrefslogtreecommitdiff
path: root/src/compositor/meta-compositor-x11.c
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2019-08-16 16:23:08 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-08-19 08:44:58 +0000
commit8ee00cee60216e70ea4640a93f0f388aaa462187 (patch)
tree05ffc7e1b8cbdb9a59b93309702cacba5b1d039f /src/compositor/meta-compositor-x11.c
parent984aad4b8624a65bcb2dba7aa794d5d31de0b267 (diff)
downloadmutter-8ee00cee60216e70ea4640a93f0f388aaa462187.tar.gz
compositor/x11: Move stage input region setting to MetaX11Display
It doesn't use anything specific to MetaCompositor, and MetaCompositorX11 isn't exposed, so move it to MetaX11Display. https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
Diffstat (limited to 'src/compositor/meta-compositor-x11.c')
-rw-r--r--src/compositor/meta-compositor-x11.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c
index de10628d1..15534ccd3 100644
--- a/src/compositor/meta-compositor-x11.c
+++ b/src/compositor/meta-compositor-x11.c
@@ -97,61 +97,6 @@ meta_compositor_x11_process_xevent (MetaCompositorX11 *compositor_x11,
clutter_x11_handle_event (xevent);
}
-void
-meta_set_stage_input_region (MetaDisplay *display,
- XserverRegion region)
-{
- MetaCompositor *compositor = display->compositor;
- MetaCompositorX11 *compositor_x11 = META_COMPOSITOR_X11 (display->compositor);
- Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
- ClutterStage *stage = meta_compositor_get_stage (compositor);
- Window xstage;
-
- /*
- * As a wayland compositor we can simply ignore all this trickery
- * for setting an input region on the stage for capturing events in
- * clutter since all input comes to us first and we get to choose
- * who else sees them.
- */
- if (meta_is_wayland_compositor ())
- return;
-
- xstage = clutter_x11_get_stage_window (stage);
- XFixesSetWindowShapeRegion (xdisplay, xstage, ShapeInput, 0, 0, region);
-
- /*
- * It's generally a good heuristic that when a crossing event is generated
- * because we reshape the overlay, we don't want it to affect
- * focus-follows-mouse focus - it's not the user doing something, it's the
- * environment changing under the user.
- */
- meta_display_add_ignored_crossing_serial (display, XNextRequest (xdisplay));
- XFixesSetWindowShapeRegion (xdisplay, compositor_x11->output,
- ShapeInput, 0, 0, region);
-}
-
-void
-meta_empty_stage_input_region (MetaDisplay *display)
-{
- /*
- * Using a static region here is a bit hacky, but when running as X11
- * compositing manager we only ever open a single XDisplay.
- */
- static XserverRegion region = None;
-
- if (meta_is_wayland_compositor ())
- return;
-
- if (region == None)
- {
- Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
-
- region = XFixesCreateRegion (xdisplay, NULL, 0);
- }
-
- meta_set_stage_input_region (display, region);
-}
-
static void
meta_compositor_x11_manage (MetaCompositor *compositor)
{
@@ -167,7 +112,7 @@ meta_compositor_x11_manage (MetaCompositor *compositor)
XReparentWindow (xdisplay, xwindow, compositor_x11->output, 0, 0);
- meta_empty_stage_input_region (display);
+ meta_x11_display_clear_stage_input_region (display->x11_display);
/*
* Make sure there isn't any left-over output shape on the overlay window by