summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-24 16:11:38 +0200
committerinfirit <[email protected]>2014-10-24 16:11:38 +0200
commitbbdef45fbb7c7addea5a3be99fbebf823d83192d (patch)
treebaa93272555d974e58eddce43802b669515bca1e /src
parentc8d59e4f2176c5afcefcc02d88f8b47141284f16 (diff)
downloadmarco-bbdef45fbb7c7addea5a3be99fbebf823d83192d.tar.bz2
marco-bbdef45fbb7c7addea5a3be99fbebf823d83192d.tar.xz
Fix new window focus
Based on metacity commit: cd481d37ec2551e98db758ff640d02f3745259db From: Alberts Muktupāvels <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=534752
Diffstat (limited to 'src')
-rw-r--r--src/core/window.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/window.c b/src/core/window.c
index 5fe9256e..b0e69548 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2085,6 +2085,9 @@ window_state_on_map (MetaWindow *window,
static gboolean
windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
{
+ if (w1->minimized || w2->minimized)
+ return FALSE;
+
MetaRectangle w1rect, w2rect;
meta_window_get_outer_rect (w1, &w1rect);
meta_window_get_outer_rect (w2, &w2rect);
@@ -2140,6 +2143,7 @@ meta_window_show (MetaWindow *window)
gboolean takes_focus_on_map;
gboolean place_on_top_on_map;
gboolean needs_stacking_adjustment;
+ gboolean will_be_covered;
MetaWindow *focus_window;
guint32 timestamp;
@@ -2157,6 +2161,7 @@ meta_window_show (MetaWindow *window)
did_show = FALSE;
window_state_on_map (window, &takes_focus_on_map, &place_on_top_on_map);
needs_stacking_adjustment = FALSE;
+ will_be_covered = window_would_be_covered (window);
meta_topic (META_DEBUG_WINDOW_STATE,
"Window %s %s focus on map, and %s place on top on map.\n",
@@ -2177,7 +2182,7 @@ meta_window_show (MetaWindow *window)
if ( focus_window != NULL && window->showing_for_first_time &&
( (!place_on_top_on_map && !takes_focus_on_map) ||
- window_would_be_covered (window) )
+ will_be_covered )
) {
if (meta_window_is_ancestor_of_transient (focus_window, window))
{
@@ -2261,21 +2266,21 @@ meta_window_show (MetaWindow *window)
* in the stack when it doesn't overlap it confusingly places
* that new window below a lot of other windows.
*/
- if (overlap ||
+ if (!will_be_covered && (overlap ||
(meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
- meta_prefs_get_raise_on_click ()))
+ meta_prefs_get_raise_on_click ())))
meta_window_stack_just_below (window, focus_window);
- /* If the window will be obscured by the focus window, then the
- * user might not notice the window appearing so set the
- * demands attention hint.
+ /* If the window will be obscured by the focus window or a window set to
+ * always on top, then the user might not notice the window appearing so
+ * set the demands attention hint.
*
* We set the hint ourselves rather than calling
* meta_window_set_demands_attention() because that would cause
* a recalculation of overlap, and a call to set_net_wm_state()
* which we are going to call ourselves here a few lines down.
*/
- if (overlap)
+ if (overlap || will_be_covered)
window->wm_state_demands_attention = TRUE;
}