After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694725 - new background menu always displays on primary monitor
new background menu always displays on primary monitor
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-26 06:12 UTC by darkxst
Modified: 2013-02-28 02:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screen: fix meta_screen_get_monitor_for_rect for 0x0 rects (3.35 KB, patch)
2013-02-27 22:49 UTC, Ray Strode [halfline]
committed Details | Review
layout: fix findIndexForActor for point-sized actors (2.63 KB, patch)
2013-02-27 22:49 UTC, Ray Strode [halfline]
none Details | Review
backgroundMenu: force dummy cursor actor to have a size (2.48 KB, patch)
2013-02-27 22:49 UTC, Ray Strode [halfline]
none Details | Review

Description darkxst 2013-02-26 06:12:21 UTC
The new background menu always displays on primary monitor, even when I right click on my second monitor.
Comment 1 Ray Strode [halfline] 2013-02-27 22:42:40 UTC
i'll post 3 possible candidate patches for this and let the reviewer pick their favorite.
Comment 2 Ray Strode [halfline] 2013-02-27 22:49:13 UTC
Created attachment 237566 [details] [review]
screen: fix meta_screen_get_monitor_for_rect for 0x0 rects

meta_screen_get_monitor_for_rect will return the monitor that
a given rect belongs in (choosing the "best" monitor based on
overlap, if there are overlapping monitors).

It doesn't work with 0x0 rects, though.

This commit fixes that.
Comment 3 Ray Strode [halfline] 2013-02-27 22:49:34 UTC
Created attachment 237567 [details] [review]
layout: fix findIndexForActor for point-sized actors

The background menu code uses a 0x0 dummy actor for positioning
a context menu where the user clicks when the user right clicks
on a background actor.

As part of this positioning process, the popup menu code identifies
the monitor the actor should pop up on using LayoutManager's
findIndexForActor function.

This function creates a MetaRectangle from the actor's position
and dimensions and passes the rect to mutter's
get_monitor_index_for_rect() function.  That function doesn't
allow 0x0 rects, though, so the background menu shows up in the
wrong place.

This commit forces the rect passed to mutter to always be atleast 1x1.
Comment 4 Ray Strode [halfline] 2013-02-27 22:49:48 UTC
Created attachment 237568 [details] [review]
backgroundMenu: force dummy cursor actor to have a size

The background menu code uses a 0x0 dummy actor for positioning
a context menu where the user clicks when the user right clicks
on a background actor.

The popup menu doesn't allow 0x0 sized actors, though,
which causes the menu to get mispositioned.

This commit makes the dummy actor be 1x1 instead of 0x0 to satisfy
the popup menu code's requirements.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-27 23:28:36 UTC
Review of attachment 237566 [details] [review]:

I like this one the most.
Comment 6 Ray Strode [halfline] 2013-02-28 02:35:41 UTC
Attachment 237566 [details] pushed as de36d51 - screen: fix meta_screen_get_monitor_for_rect for 0x0 rects