Merge lp:~macslow/notify-osd/notify-osd.fix-1092905 into lp:notify-osd

Proposed by Mirco Müller
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~macslow/notify-osd/notify-osd.fix-1092905
Merge into: lp:notify-osd
Diff against target: 12 lines (+2/-0)
1 file modified
src/defaults.c (+2/-0)
To merge this branch: bzr merge lp:~macslow/notify-osd/notify-osd.fix-1092905
Reviewer Review Type Date Requested Status
Iain Lane Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Sebastien Bacher Approve
Review via email: mp+203047@code.launchpad.net

Commit message

Hardcode the y-coordinate to fix synchronous notifications overlapping panel/indicators when using the 'focus-follow' with multi-monitor setups.

Description of the change

Since 'follow-focus' is the new default for 14.04 LTS, synchronous notifications (e.g. volume up/down, brightness up/down) overlap the panel and indicators on multi-monitor setups. Due to limited time and resources a quick fix was agreed upon for the default Unity-session. Thus the y-coordinate hardcoded for the 'follow-focus' mode now.

Before testing, check what multihead-mode your system is set to, using (in a gnome-terminal)...

  dconf read /apps/notify-osd/multihead-mode

To test the fix, run this branch and change multihead-mode on the fly with (in a gnome-terminal)...

  dconf write /apps/notify-osd/multihead-mode "'focus-follow'"

Now trigger a synchronous notification by e.g. the volume- or screen-brightness-up/down keys on your keyboard. The notification should no longer overlap the panel/indicators.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Mirco, that "does the job", though I'm not sure how comfortable I am with setting a fixed value like that, if we do that should we at least restrict the hack to unity session (e.g check for XDG_CURRENT_DESKTOP="Unity")?

Ideally we would fix that bug but I've no idea how difficult that is

Revision history for this message
Sebastien Bacher (seb128) wrote :

(thinking about it, the value is also going to cause issue with hi-dpi, unity is going to change the panel size there)

483. By Mirco Müller

Make the fix for synchronous notifications overlapping panel/indicators when using the 'focus-follow' with multi-monitor setups more robust.

Revision history for this message
Mirco Müller (macslow) wrote :

I've pushed a more robust fix.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks

> !g_strcmp0("Unity", g_environ_getenv (g_get_environ (), "XDG_CURRENT_DESKTOP")))

that seems a bit complicated, we usually use "!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")" (one less call)

I'm also not sure to understand the y computation ... do we have somebody knowing that code a bit that could review that? (I still don't understand why we can't just use the same computation than the no-focus-follow case since that one is correct, the panel size doesn't change between monitors)

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mirco Müller (macslow) wrote :

The code for the multihead-mode is from a time, when unity wasn't the default desktop-environment. We had plain compiz back then. The panel could appear on only on screen in a multi-monitor setup. It was wrong to assume the panel would be cloned on every screen, like we have now with the unity-plugin.

I don't want to rewrite all of defaults_get_top_corner() now.

Revision history for this message
Sebastien Bacher (seb128) wrote :

oh, in that context it makes sense ... if you fix the getenv thing the change looks fine to me then, thanks!

484. By Mirco Müller

Avoid superfluous recomputation of y-coordinate.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Great, the new version looks better to me (and works fine as well), thanks for the work there ;-)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

Seb asked me to test this, here are my results

Laptop running a gnome-panel based session, single monitor (internal panel): Synchronous notifications still overlap the panel.

Desktop, unity, multiple monitors: Synchronous notifications don't appear at all on the left (primary) montior, when a window there has focus. They appear in the correct place on the secondary one.

review: Needs Fixing
Revision history for this message
Sebastien Bacher (seb128) wrote :

Confirmed, if you use 2 monitors with different resolution, bubbles get shifted to the top on the smaller resolution one (they can end up offscreen is the resolution is low enough)

Revision history for this message
Sebastien Bacher (seb128) wrote :

Unmerged revisions

484. By Mirco Müller

Avoid superfluous recomputation of y-coordinate.

483. By Mirco Müller

Make the fix for synchronous notifications overlapping panel/indicators when using the 'focus-follow' with multi-monitor setups more robust.

482. By Mirco Müller

Hardcode the y-coordinate to fix synchronous notifications overlapping panel/indicators when using the 'focus-follow' with multi-monitor setups.

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 2012-08-29 22:05:41 +0000
3+++ src/defaults.c 2014-01-24 14:12:44 +0000
4@@ -2279,6 +2279,8 @@
5 rect.width,
6 rect.height);
7
8+ g_object_get (self, "desktop-top", &rect.y, NULL);
9+
10 /* Position the top left corner of the stack. */
11 if (has_panel_window &&
12 panel_monitor == monitor)

Subscribers

People subscribed via source and target branches