GNOME Bugzilla – Bug 694725
new background menu always displays on primary monitor
Last modified: 2013-02-28 02:35:44 UTC
The new background menu always displays on primary monitor, even when I right click on my second monitor.
i'll post 3 possible candidate patches for this and let the reviewer pick their favorite.
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.
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.
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.
Review of attachment 237566 [details] [review]: I like this one the most.
Attachment 237566 [details] pushed as de36d51 - screen: fix meta_screen_get_monitor_for_rect for 0x0 rects