[mutter/foo: 3/3] window: Wait until MapNotify before adding the window to the compositor
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/foo: 3/3] window: Wait until MapNotify before adding the window to the compositor
- Date: Fri, 10 Jan 2014 20:27:20 +0000 (UTC)
commit 702c2e18e7990d1cf6ceb36cbd2f7d0ba018d375
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Dec 9 16:10:36 2013 -0500
window: Wait until MapNotify before adding the window to the compositor
src/core/display.c | 7 +++-
src/core/window-private.h | 2 +
src/core/window.c | 67 +++++++++++++++++++++------------------------
3 files changed, 38 insertions(+), 38 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index edb122d..dc90cbb 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2778,8 +2778,11 @@ event_callback (XEvent *event,
/* NB: override redirect windows wont cause a map request so we
* watch out for map notifies against any root windows too if a
* compositor is enabled: */
- if (display->compositor && window == NULL
- && meta_display_screen_for_root (display, event->xmap.event))
+ if (window)
+ {
+ meta_window_shown (window);
+ }
+ else if (display->compositor && meta_display_screen_for_root (display, event->xmap.event))
{
window = meta_window_new (display, event->xmap.window,
FALSE, META_COMP_EFFECT_CREATE);
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 31f029a..8dc9513 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -699,4 +699,6 @@ void meta_window_set_opacity (MetaWindow *window,
Window meta_window_get_toplevel_xwindow (MetaWindow *window);
+void meta_window_shown (MetaWindow *window);
+
#endif
diff --git a/src/core/window.c b/src/core/window.c
index 84e506c..d0c501c 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2905,6 +2905,37 @@ meta_window_force_placement (MetaWindow *window)
window->denied_focus_and_not_transient = FALSE;
}
+void
+meta_window_shown (MetaWindow *window)
+{
+ if (window->display->compositor)
+ {
+ meta_compositor_add_window (window->display->compositor, window);
+
+ if (!window->visible_to_compositor)
+ {
+ MetaCompEffect effect = META_COMP_EFFECT_NONE;
+
+ window->visible_to_compositor = TRUE;
+
+ switch (window->pending_compositor_effect)
+ {
+ case META_COMP_EFFECT_CREATE:
+ case META_COMP_EFFECT_UNMINIMIZE:
+ effect = window->pending_compositor_effect;
+ break;
+ case META_COMP_EFFECT_NONE:
+ case META_COMP_EFFECT_DESTROY:
+ case META_COMP_EFFECT_MINIMIZE:
+ break;
+ }
+
+ meta_compositor_show_window (window->display->compositor,
+ window, effect);
+ }
+ }
+}
+
static void
meta_window_show (MetaWindow *window)
{
@@ -2913,16 +2944,12 @@ meta_window_show (MetaWindow *window)
gboolean place_on_top_on_map;
gboolean needs_stacking_adjustment;
MetaWindow *focus_window;
- gboolean toplevel_was_mapped;
- gboolean toplevel_now_mapped;
gboolean notify_demands_attention = FALSE;
meta_topic (META_DEBUG_WINDOW_STATE,
"Showing window %s, shaded: %d iconic: %d placed: %d\n",
window->desc, window->shaded, window->iconic, window->placed);
- toplevel_was_mapped = meta_window_toplevel_is_mapped (window);
-
focus_window = window->display->focus_window; /* May be NULL! */
did_show = FALSE;
window_state_on_map (window, &takes_focus_on_map, &place_on_top_on_map);
@@ -3084,38 +3111,6 @@ meta_window_show (MetaWindow *window)
}
}
- toplevel_now_mapped = meta_window_toplevel_is_mapped (window);
- if (toplevel_now_mapped != toplevel_was_mapped)
- {
- if (window->display->compositor)
- meta_compositor_add_window (window->display->compositor, window);
- }
-
- if (!window->visible_to_compositor)
- {
- window->visible_to_compositor = TRUE;
-
- if (window->display->compositor)
- {
- MetaCompEffect effect = META_COMP_EFFECT_NONE;
-
- switch (window->pending_compositor_effect)
- {
- case META_COMP_EFFECT_CREATE:
- case META_COMP_EFFECT_UNMINIMIZE:
- effect = window->pending_compositor_effect;
- break;
- case META_COMP_EFFECT_NONE:
- case META_COMP_EFFECT_DESTROY:
- case META_COMP_EFFECT_MINIMIZE:
- break;
- }
-
- meta_compositor_show_window (window->display->compositor,
- window, effect);
- }
- }
-
/* We don't want to worry about all cases from inside
* implement_showing(); we only want to worry about focus if this
* window has not been shown before.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]