[mutter] Lower a window and all its transients as a unit
- From: Maxim Ermilov <mermilov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Lower a window and all its transients as a unit
- Date: Sat, 11 Sep 2010 01:40:24 +0000 (UTC)
commit bb1ab0afd9ee19259d4d10fbe40cd3361f447d46
Author: Maxim Ermilov <zaspire rambler ru>
Date: Sat Sep 11 05:00:15 2010 +0400
Lower a window and all its transients as a unit
It's strange to leave transients windows around, after ancestor window was
lowered and unfocused.
https://bugzilla.gnome.org/show_bug.cgi?id=612726
src/core/core.c | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/src/core/core.c b/src/core/core.c
index 6fd2edd..9464b0d 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -260,15 +260,14 @@ meta_core_user_raise (Display *xdisplay,
meta_window_raise (window);
}
-void
-meta_core_user_lower_and_unfocus (Display *xdisplay,
- Window frame_xwindow,
- guint32 timestamp)
+static gboolean
+lower_window_and_transients (MetaWindow *window,
+ gpointer data)
{
- MetaWindow *window = get_window (xdisplay, frame_xwindow);
-
meta_window_lower (window);
+ meta_window_foreach_transient (window, lower_window_and_transients, NULL);
+
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
meta_prefs_get_raise_on_click ())
{
@@ -296,11 +295,25 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
}
}
- /* focus the default window, if needed */
- if (window->has_focus)
- meta_workspace_focus_default_window (window->screen->active_workspace,
- NULL,
- timestamp);
+ return FALSE;
+}
+
+void
+meta_core_user_lower_and_unfocus (Display *xdisplay,
+ Window frame_xwindow,
+ guint32 timestamp)
+{
+ MetaWindow *window = get_window (xdisplay, frame_xwindow);
+
+ lower_window_and_transients (window, NULL);
+
+ /* Rather than try to figure that out whether we just lowered
+ * the focus window, assume that's always the case. (Typically,
+ * this will be invoked via keyboard action or by a mouse action;
+ * in either case the window or a modal child will have been focused.) */
+ meta_workspace_focus_default_window (window->screen->active_workspace,
+ NULL,
+ timestamp);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]