Merge lp:~vanvugt/unity/fix-742544-alt-trunk into lp:unity

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~vanvugt/unity/fix-742544-alt-trunk
Merge into: lp:unity
Diff against target: 75 lines (+22/-26)
1 file modified
plugins/unityshell/src/UScreen.cpp (+22/-26)
To merge this branch: bzr merge lp:~vanvugt/unity/fix-742544-alt-trunk
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Disapprove
Sam Spilsbury (community) Abstain
Review via email: mp+86779@code.launchpad.net

Description of the change

The primary monitor (the one the launcher appears on) should always be chosen by the user (LP: #742544)

You select the primary monitor in the Gnome Displays panel, or the NVIDIA control panel for the nvidia driver.

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This branch removes the fallback to the left-most monitor that was introduced late just before oneiric was released.

If you still want the old (oneiric-only) behaviour then see the more complex version of this fix:
https://code.launchpad.net/~vanvugt/unity/fix-742544-trunk/+merge/79492

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve
Revision history for this message
Neil J. Patel (njpatel) wrote :

The launcher is shown on the left-most screen for some user-experience reasons, specifically because the launcher, in it's default auto-hide mode, cannot be shown via the mouse if it's not on the left-most monitor easily. Most people just assume it's broken. Jason Smith is working on a fix for this for 5.0, and that will solve this bug. For 4.0, we can't make such a big change that Jason is doing, so I don't think this should be applied to it either.

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I know the justification but take a look at how many people this is upsetting: bug 742544

Also, if Jason is working on it then why wasn't the bug updated to show that? It's been assigned to me for 3 months and not a single comment from Jason or yourself to say any Unity devs were working on it.

Revision history for this message
Tim Penhey (thumper) wrote :

Hi Daniel,

With the new multi-monitor work and a launcher on each monitor, this change doesn't really make sense any more does it?

Tim

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Unity's inability to detect the correct primary monitor might become irrelevant by the sound of it. In which case, this proposal may become redundant. Though I haven't tested the new multi-monitor support to confirm.

Revision history for this message
Alex Launi (alexlauni) wrote :

Is this proposal still relevant or can it be dismissed?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This proposal is still relevant as seen in bug 961281. I would not dismiss it until I'm sure this or something equivalent has been merged.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Daniel in current UScreen we alredy use gdk_screen_get_primary_monitor to get the primary monitor and we don't override that anymore.
So the only improvement that should be done on this side is supporting the NVIDIA drivers in some way to get a notification when the primary monitor has been changed for them.

review: Disapprove

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/UScreen.cpp'
--- plugins/unityshell/src/UScreen.cpp 2011-09-23 23:53:13 +0000
+++ plugins/unityshell/src/UScreen.cpp 2011-12-23 07:01:26 +0000
@@ -16,6 +16,7 @@
16 * Authored by: Neil Jagdish Patel <neil.patel@canonical.com>16 * Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
17 */17 */
1818
19#define G_LOG_DOMAIN "UScreen"
19#include "UScreen.h"20#include "UScreen.h"
2021
21static UScreen* _default_screen = NULL;22static UScreen* _default_screen = NULL;
@@ -92,17 +93,18 @@
92void93void
93UScreen::Refresh()94UScreen::Refresh()
94{95{
95 GdkScreen* screen;96 GdkScreen* screen = gdk_screen_get_default();
96 nux::Geometry last_geo(0, 0, 1, 1);97 _monitors.clear();
9798 g_message("Screen geometry changed:\n");
98 screen = gdk_screen_get_default();99
99100 /*
100 _monitors.erase(_monitors.begin(), _monitors.end());101 * The primary monitor MUST be the one chosen by the user. You select the
101102 * primary monitor in the Gnome Displays panel, or the NVIDIA control
102 g_print("\nScreen geometry changed:\n");103 * panel for the nvidia driver.
103104 * Don't try to override what the user has chosen or they will be unhappy.
104 int lowest_x = std::numeric_limits<int>::max();105 */
105 int highest_y = std::numeric_limits<int>::min();106 primary_ = gdk_screen_get_primary_monitor(screen);
107
106 for (int i = 0; i < gdk_screen_get_n_monitors(screen); i++)108 for (int i = 0; i < gdk_screen_get_n_monitors(screen); i++)
107 {109 {
108 GdkRectangle rect = { 0 };110 GdkRectangle rect = { 0 };
@@ -111,24 +113,18 @@
111113
112 nux::Geometry geo(rect.x, rect.y, rect.width, rect.height);114 nux::Geometry geo(rect.x, rect.y, rect.width, rect.height);
113115
114 // Check for mirrored displays
115 if (geo == last_geo)
116 continue;
117 last_geo = geo;
118
119 _monitors.push_back(geo);116 _monitors.push_back(geo);
120117
121 if (geo.x < lowest_x || (geo.x == lowest_x && geo.y > highest_y))118 gchar *name = gdk_screen_get_monitor_plug_name(screen, i);
122 {119 g_message(" #%d: %s %dx%d +%d+%d %s\n",
123 lowest_x = geo.x;120 i,
124 highest_y = geo.y;121 name == NULL ? "?" : name,
125 primary_ = i;122 geo.width, geo.height,
126 }123 geo.x, geo.y,
127124 i == primary_ ? "(primary)" : "");
128 g_print(" %dx%dx%dx%d\n", geo.x, geo.y, geo.width, geo.height);125 if (name)
126 g_free(name);
129 }127 }
130128
131 g_print("\n");
132
133 changed.emit(primary_, _monitors);129 changed.emit(primary_, _monitors);
134}130}