4
--- a/src/core/window.c
5
+++ b/src/core/window.c
7
windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
9
MetaRectangle w1rect, w2rect;
11
+ if (w1->minimized || w2->minimized)
14
meta_window_get_outer_rect (w1, &w1rect);
15
meta_window_get_outer_rect (w2, &w2rect);
16
return meta_rectangle_overlap (&w1rect, &w2rect);
18
gboolean takes_focus_on_map;
19
gboolean place_on_top_on_map;
20
gboolean needs_stacking_adjustment;
21
+ gboolean will_be_covered;
22
MetaWindow *focus_window;
27
window_state_on_map (window, &takes_focus_on_map, &place_on_top_on_map);
28
needs_stacking_adjustment = FALSE;
29
+ will_be_covered = window_would_be_covered (window);
31
meta_topic (META_DEBUG_WINDOW_STATE,
32
"Window %s %s focus on map, and %s place on top on map.\n",
35
if ( focus_window != NULL && window->showing_for_first_time &&
36
( (!place_on_top_on_map && !takes_focus_on_map) ||
37
- window_would_be_covered (window) )
40
if (meta_window_is_ancestor_of_transient (focus_window, window))
42
@@ -2220,21 +2226,21 @@
43
* in the stack when it doesn't overlap it confusingly places
44
* that new window below a lot of other windows.
47
+ if (!will_be_covered && (overlap ||
48
(meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK &&
49
- meta_prefs_get_raise_on_click ()))
50
+ meta_prefs_get_raise_on_click ())))
51
meta_window_stack_just_below (window, focus_window);
53
- /* If the window will be obscured by the focus window, then the
54
- * user might not notice the window appearing so set the
55
- * demands attention hint.
56
+ /* If the window will be obscured by the focus window or a window set to
57
+ * always on top, then the user might not notice the window appearing so
58
+ * set the demands attention hint.
60
* We set the hint ourselves rather than calling
61
* meta_window_set_demands_attention() because that would cause
62
* a recalculation of overlap, and a call to set_net_wm_state()
63
* which we are going to call ourselves here a few lines down.
66
+ if (overlap || will_be_covered)
67
window->wm_state_demands_attention = TRUE;