diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index b7c72fb70..e2150be8d 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -955,9 +955,11 @@ update_input_region (MetaWindowActorX11 *actor_x11) meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11)); MetaSurfaceActor *surface = meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11)); + MetaWindowX11Private *priv = + meta_window_x11_get_private (META_WINDOW_X11 (window)); g_autoptr (MtkRegion) region = NULL; - if (window->shape_region && window->input_region) + if (window->shape_region && priv->input_region) { MtkRectangle client_area; g_autoptr (MtkRegion) frames_input = NULL; @@ -965,11 +967,11 @@ update_input_region (MetaWindowActorX11 *actor_x11) get_client_area_rect (actor_x11, &client_area); - frames_input = mtk_region_copy (window->input_region); + frames_input = mtk_region_copy (priv->input_region); mtk_region_subtract_rectangle (frames_input, &client_area); client_input = mtk_region_copy (actor_x11->shape_region); - mtk_region_intersect (client_input, window->input_region); + mtk_region_intersect (client_input, priv->input_region); mtk_region_union (frames_input, client_input); @@ -984,8 +986,8 @@ update_input_region (MetaWindowActorX11 *actor_x11) region = mtk_region_copy (window->shape_region); mtk_region_translate (region, client_area.x, client_area.y); } - else if (window->input_region) - region = mtk_region_ref (window->input_region); + else if (priv->input_region) + region = mtk_region_ref (priv->input_region); else region = NULL; diff --git a/src/core/window-private.h b/src/core/window-private.h index fa53bd885..aebe57d54 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -243,9 +243,6 @@ struct _MetaWindow * the server-side client window. */ MtkRegion *shape_region; - /* the input shape region for picking */ - MtkRegion *input_region; - /* _NET_WM_WINDOW_OPACITY rescaled to 0xFF */ guint8 opacity; diff --git a/src/core/window.c b/src/core/window.c index 1029715ca..4c3fb29e9 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -315,7 +315,6 @@ meta_window_finalize (GObject *object) g_clear_pointer (&window->frame_bounds, mtk_region_unref); g_clear_pointer (&window->shape_region, mtk_region_unref); - g_clear_pointer (&window->input_region, mtk_region_unref); if (window->transient_for) g_object_unref (window->transient_for); diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index 3a7e6974f..95f4aec2c 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -72,6 +72,9 @@ struct _MetaWindowX11Private /* if non-NULL, the opaque region _NET_WM_OPAQUE_REGION */ MtkRegion *opaque_region; + /* the input shape region for picking */ + MtkRegion *input_region; + Pixmap wm_hints_pixmap; Pixmap wm_hints_mask; diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index 0fbcabce5..def0d36c7 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -2149,6 +2149,7 @@ meta_window_x11_finalize (GObject *object) MetaWindowX11 *win = META_WINDOW_X11 (object); MetaWindowX11Private *priv = meta_window_x11_get_instance_private (win); + g_clear_pointer (&priv->input_region, mtk_region_unref); g_clear_pointer (&priv->opaque_region, mtk_region_unref); g_clear_pointer (&priv->wm_client_machine, g_free); g_clear_pointer (&priv->sm_client_id, g_free); @@ -2364,13 +2365,16 @@ static void meta_window_set_input_region (MetaWindow *window, MtkRegion *region) { - if (mtk_region_equal (window->input_region, region)) + MetaWindowX11Private *priv = + meta_window_x11_get_private (META_WINDOW_X11 (window)); + + if (mtk_region_equal (priv->input_region, region)) return; - g_clear_pointer (&window->input_region, mtk_region_unref); + g_clear_pointer (&priv->input_region, mtk_region_unref); if (region != NULL) - window->input_region = mtk_region_ref (region); + priv->input_region = mtk_region_ref (region); meta_compositor_window_shape_changed (window->display->compositor, window); } @@ -2409,7 +2413,7 @@ meta_window_x11_update_input_region (MetaWindow *window) { if (!window->frame) { - if (window->input_region) + if (priv->input_region) meta_window_set_input_region (window, NULL); return; }