Merge lp://qastaging/~cristiklein/notify-osd/multihead-bottompanel into lp://qastaging/notify-osd/trunk

Proposed by Cristian Klein
Status: Needs review
Proposed branch: lp://qastaging/~cristiklein/notify-osd/multihead-bottompanel
Merge into: lp://qastaging/notify-osd/trunk
Diff against target: 116 lines (+30/-16)
1 file modified
src/defaults.c (+30/-16)
To merge this branch: bzr merge lp://qastaging/~cristiklein/notify-osd/multihead-bottompanel
Reviewer Review Type Date Requested Status
Karl Lattimer (community) Needs Information
Review via email: mp+14983@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Karl Lattimer (karl-qdh) wrote :

I have a few concerns about this patch partly because the conversation with Chow Loong Jin doesn't come to any actual conclusion.

 1, I'm concerned the patch breaks the following specification for spacing; https://wiki.ubuntu.com/NotifyOSD#Outside%20the%20bubble
 2, That in certain monitor configurations e.g. fullscreen application on the screen above the desktop screen and other similar corner cases this patch fails to correctly assign a screen for the notification to be on.
 3, There are commented out pieces of code left in the patch.

Revision history for this message
Karl Lattimer (karl-qdh) wrote :

This patch needs more information and clarification from the author.

review: Needs Information

Unmerged revisions

408. By Cristian Klein

* Fix: correctly place notify window on multi-head screens, with invizible
  zone and bottom panel. (LP #475373)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/defaults.c'
2--- src/defaults.c 2009-09-29 09:52:49 +0000
3+++ src/defaults.c 2009-11-18 08:20:25 +0000
4@@ -2377,7 +2377,7 @@
5 }
6
7 static gboolean
8-_window_look_for_top_panel_attributes (GdkWindow *win)
9+_window_look_for_panel_attributes (GdkWindow *win, gboolean *ptop)
10 {
11 XClassHint class_hints = {0, 0};
12 gboolean is_panel = FALSE;
13@@ -2405,8 +2405,13 @@
14
15 /* select only the top panel */
16 gdk_window_get_frame_extents (win, &frame);
17- if (frame.x != 0 || frame.y != 0)
18- goto failed;
19+ if (ptop)
20+ {
21+ if (frame.x != 0 || frame.y != 0)
22+ *ptop = FALSE;
23+ else
24+ *ptop = TRUE;
25+ }
26
27 if (frame.width < frame.height)
28 goto failed;
29@@ -2425,22 +2430,25 @@
30 }
31
32 static GdkWindow*
33-get_panel_window (void)
34+get_panel_window (gboolean *top)
35 {
36 GdkWindow *panel_window = NULL;
37 GList *window;
38 GList *iter;
39
40+ *top = FALSE;
41 window = gdk_screen_get_window_stack (gdk_screen_get_default ());
42
43 for (iter = g_list_first (window);
44 iter != NULL;
45 iter = g_list_next (iter))
46 {
47- if (_window_look_for_top_panel_attributes (iter->data))
48+ if (_window_look_for_panel_attributes (iter->data, top))
49 {
50 panel_window = iter->data;
51- break;
52+ if (*top)
53+ break;
54+ /* else keep looking */
55 }
56 }
57
58@@ -2463,6 +2471,7 @@
59 gint panel_monitor = 0;
60 gint aw_monitor;
61 gboolean has_panel_window = FALSE;
62+ gboolean top_panel = FALSE;
63
64 g_return_if_fail (self != NULL && IS_DEFAULTS (self));
65
66@@ -2472,7 +2481,7 @@
67 &my,
68 NULL);
69
70- panel_window = get_panel_window ();
71+ panel_window = get_panel_window (&top_panel);
72
73 if (panel_window != NULL)
74 {
75@@ -2480,7 +2489,8 @@
76 panel_monitor = gdk_screen_get_monitor_at_window (screen,
77 panel_window);
78 monitor = panel_monitor;
79- g_debug ("found panel (%d,%d) - %dx%d on monitor %d",
80+ g_debug ("found %s panel (%d,%d) - %dx%d on monitor %d",
81+ top_panel ? "top" : "non-top",
82 panel_rect.x,
83 panel_rect.y,
84 panel_rect.width,
85@@ -2526,19 +2536,23 @@
86 if (has_panel_window &&
87 panel_monitor == monitor)
88 {
89- /* position the corner on the selected monitor */
90- rect.y += panel_rect.y + panel_rect.height;
91+ if (top_panel)
92+ {
93+ /* position the corner on the selected monitor */
94+ rect.y += panel_rect.y + panel_rect.height;
95+ }
96 } else if (! has_panel_window)
97 {
98- g_debug ("no panel detetected; using workarea fallback");
99+ //g_debug ("no panel detetected; using workarea fallback");
100+ g_debug ("no panel detected");
101
102- defaults_refresh_screen_dimension_properties (self);
103+ //defaults_refresh_screen_dimension_properties (self);
104
105 /* workarea rectangle */
106- g_object_get (self, "desktop-left", &rect.x, NULL);
107- g_object_get (self, "desktop-top", &rect.y, NULL);
108- g_object_get (self, "desktop-width", &rect.width, NULL);
109- g_object_get (self, "desktop-height", &rect.height, NULL);
110+ //g_object_get (self, "desktop-left", &rect.x, NULL);
111+ //g_object_get (self, "desktop-top", &rect.y, NULL);
112+ //g_object_get (self, "desktop-width", &rect.width, NULL);
113+ //g_object_get (self, "desktop-height", &rect.height, NULL);
114 }
115
116 *y = rect.y;

Subscribers

People subscribed via source and target branches