~xnox/metacity/ubuntu

« back to all changes in this revision

Viewing changes to debian/patches/01_focus_new_window.patch

  • Committer: Dimitri John Ledkov
  • Date: 2014-07-09 13:01:45 UTC
  • Revision ID: dimitri.ledkov@canonical.com-20140709130145-tn3p21qunh43mg9l
* debian/patches/01_focus_new_window.patch
  debian/patches/03_gtop_error.patch
  debian/patches/04_support_drag_drop_with_alt_tab.patch
  debian/patches/06_Add_UXD_shadows_and_borders.patch
  debian/patches/100_fade_on_long_title.patch
  debian/patches/10_no-ws-switcher.patch
  debian/patches/13_better_support_for_button_layout.patch
  debian/patches/14_wrong_colormap.patch
  debian/patches/21_fix_compositing_startup.patch
  debian/patches/git_support_new_schemas.patch:
  - Remove, applied upstream
* debian/patches/12_dont-show-as-user.patch:
  - Refresh

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Debian #515577
2
 
GNOME #534752
3
 
 
4
 
--- a/src/core/window.c
5
 
+++ b/src/core/window.c
6
 
@@ -2045,6 +2045,10 @@
7
 
 windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
8
 
 {
9
 
   MetaRectangle w1rect, w2rect;
10
 
+
11
 
+  if (w1->minimized || w2->minimized)
12
 
+    return FALSE;
13
 
+
14
 
   meta_window_get_outer_rect (w1, &w1rect);
15
 
   meta_window_get_outer_rect (w2, &w2rect);
16
 
   return meta_rectangle_overlap (&w1rect, &w2rect);
17
 
@@ -2099,6 +2103,7 @@
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;
23
 
   guint32     timestamp;
24
 
 
25
 
@@ -2116,6 +2121,7 @@
26
 
   did_show = FALSE;
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);
30
 
 
31
 
   meta_topic (META_DEBUG_WINDOW_STATE,
32
 
               "Window %s %s focus on map, and %s place on top on map.\n",
33
 
@@ -2136,7 +2142,7 @@
34
 
 
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) )
38
 
+      will_be_covered )
39
 
     ) {
40
 
       if (meta_window_is_ancestor_of_transient (focus_window, window))
41
 
         {
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.
45
 
        */
46
 
-      if (overlap || 
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);
52
 
 
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.
59
 
        *
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.
64
 
        */
65
 
-      if (overlap)
66
 
+      if (overlap || will_be_covered)
67
 
         window->wm_state_demands_attention = TRUE;
68
 
     } 
69