mirror of
https://github.com/brl/mutter.git
synced 2025-02-18 06:04:10 +00:00
surface-actor-x11: Recreate damage when the toplevel X window changes
This commit is contained in:
parent
83aca0b53d
commit
020cfa7283
@ -414,21 +414,43 @@ meta_surface_actor_x11_init (MetaSurfaceActorX11 *self)
|
|||||||
priv->last_height = -1;
|
priv->last_height = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
create_damage (MetaSurfaceActorX11 *self)
|
||||||
|
{
|
||||||
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
|
Display *xdisplay = meta_display_get_xdisplay (priv->display);
|
||||||
|
Window xwindow = meta_window_get_toplevel_xwindow (priv->window);
|
||||||
|
|
||||||
|
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
window_decorated_notify (MetaWindow *window,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (user_data);
|
||||||
|
|
||||||
|
free_damage (self);
|
||||||
|
create_damage (self);
|
||||||
|
}
|
||||||
|
|
||||||
MetaSurfaceActor *
|
MetaSurfaceActor *
|
||||||
meta_surface_actor_x11_new (MetaWindow *window)
|
meta_surface_actor_x11_new (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaSurfaceActorX11 *self = g_object_new (META_TYPE_SURFACE_ACTOR_X11, NULL);
|
MetaSurfaceActorX11 *self = g_object_new (META_TYPE_SURFACE_ACTOR_X11, NULL);
|
||||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||||
MetaDisplay *display = meta_window_get_display (window);
|
MetaDisplay *display = meta_window_get_display (window);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
|
||||||
Window xwindow = meta_window_get_toplevel_xwindow (window);
|
|
||||||
|
|
||||||
g_assert (!meta_is_wayland_compositor ());
|
g_assert (!meta_is_wayland_compositor ());
|
||||||
|
|
||||||
priv->window = window;
|
priv->window = window;
|
||||||
priv->display = display;
|
priv->display = display;
|
||||||
|
|
||||||
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
|
create_damage (self);
|
||||||
|
g_signal_connect_object (priv->window, "notify::decorated",
|
||||||
|
G_CALLBACK (window_decorated_notify), self, 0);
|
||||||
|
|
||||||
update_is_argb32 (self);
|
update_is_argb32 (self);
|
||||||
|
|
||||||
priv->unredirected = FALSE;
|
priv->unredirected = FALSE;
|
||||||
|
@ -84,7 +84,6 @@ struct _MetaWindowActorPrivate
|
|||||||
|
|
||||||
guint visible : 1;
|
guint visible : 1;
|
||||||
guint disposed : 1;
|
guint disposed : 1;
|
||||||
guint redecorating : 1;
|
|
||||||
|
|
||||||
/* If set, the client needs to be sent a _NET_WM_FRAME_DRAWN
|
/* If set, the client needs to be sent a _NET_WM_FRAME_DRAWN
|
||||||
* client message using the most recent frame in ->frames */
|
* client message using the most recent frame in ->frames */
|
||||||
@ -219,26 +218,6 @@ meta_window_actor_init (MetaWindowActor *self)
|
|||||||
priv->shadow_class = NULL;
|
priv->shadow_class = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
window_decorated_notify (MetaWindow *mw,
|
|
||||||
GParamSpec *arg1,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
MetaWindowActor *self = META_WINDOW_ACTOR (data);
|
|
||||||
MetaWindowActorPrivate *priv = self->priv;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Basically, we have to reconstruct the the internals of this object
|
|
||||||
* from scratch, as everything has changed.
|
|
||||||
*/
|
|
||||||
priv->redecorating = TRUE;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Recreate the contents.
|
|
||||||
*/
|
|
||||||
meta_window_actor_constructed (G_OBJECT (self));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
window_appears_focused_notify (MetaWindow *mw,
|
window_appears_focused_notify (MetaWindow *mw,
|
||||||
GParamSpec *arg1,
|
GParamSpec *arg1,
|
||||||
@ -414,9 +393,6 @@ meta_window_actor_set_property (GObject *object,
|
|||||||
{
|
{
|
||||||
case PROP_META_WINDOW:
|
case PROP_META_WINDOW:
|
||||||
priv->window = g_value_dup_object (value);
|
priv->window = g_value_dup_object (value);
|
||||||
|
|
||||||
g_signal_connect_object (priv->window, "notify::decorated",
|
|
||||||
G_CALLBACK (window_decorated_notify), self, 0);
|
|
||||||
g_signal_connect_object (priv->window, "notify::appears-focused",
|
g_signal_connect_object (priv->window, "notify::appears-focused",
|
||||||
G_CALLBACK (window_appears_focused_notify), self, 0);
|
G_CALLBACK (window_appears_focused_notify), self, 0);
|
||||||
break;
|
break;
|
||||||
@ -1179,13 +1155,11 @@ meta_window_actor_show (MetaWindowActor *self,
|
|||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->redecorating ||
|
if (info->switch_workspace_in_progress ||
|
||||||
info->switch_workspace_in_progress ||
|
|
||||||
event == 0 ||
|
event == 0 ||
|
||||||
!start_simple_effect (self, event))
|
!start_simple_effect (self, event))
|
||||||
{
|
{
|
||||||
clutter_actor_show (CLUTTER_ACTOR (self));
|
clutter_actor_show (CLUTTER_ACTOR (self));
|
||||||
priv->redecorating = FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user