mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
compositor/x11: Move unredirect logic to helper
It makes it clearer what is required for unredirecting a window. https://gitlab.gnome.org/GNOME/mutter/merge_requests/734
This commit is contained in:
parent
f059466337
commit
9ac52f0340
@ -229,27 +229,36 @@ set_unredirected_window (MetaCompositorX11 *compositor_x11,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
maybe_unredirect_top_window (MetaCompositorX11 *compositor_x11)
|
||||
{
|
||||
MetaCompositor *compositor = META_COMPOSITOR (compositor_x11);
|
||||
MetaWindow *window_to_unredirect = NULL;
|
||||
MetaWindowActor *window_actor;
|
||||
|
||||
if (meta_compositor_is_unredirect_inhibited (compositor))
|
||||
goto out;
|
||||
|
||||
window_actor = meta_compositor_get_top_window_actor (compositor);
|
||||
if (!window_actor)
|
||||
goto out;
|
||||
|
||||
if (!meta_window_actor_should_unredirect (window_actor))
|
||||
goto out;
|
||||
|
||||
window_to_unredirect = meta_window_actor_get_meta_window (window_actor);
|
||||
|
||||
out:
|
||||
set_unredirected_window (compositor_x11, window_to_unredirect);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_compositor_x11_pre_paint (MetaCompositor *compositor)
|
||||
{
|
||||
MetaCompositorX11 *compositor_x11 = META_COMPOSITOR_X11 (compositor);
|
||||
MetaWindowActor *top_window_actor;
|
||||
MetaCompositorClass *parent_class;
|
||||
|
||||
top_window_actor = meta_compositor_get_top_window_actor (compositor);
|
||||
if (!meta_compositor_is_unredirect_inhibited (compositor) &&
|
||||
top_window_actor &&
|
||||
meta_window_actor_should_unredirect (top_window_actor))
|
||||
{
|
||||
MetaWindow *top_window;
|
||||
|
||||
top_window = meta_window_actor_get_meta_window (top_window_actor);
|
||||
set_unredirected_window (compositor_x11, top_window);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_unredirected_window (compositor_x11, NULL);
|
||||
}
|
||||
maybe_unredirect_top_window (compositor_x11);
|
||||
|
||||
parent_class = META_COMPOSITOR_CLASS (meta_compositor_x11_parent_class);
|
||||
parent_class->pre_paint (compositor);
|
||||
|
Loading…
Reference in New Issue
Block a user