GNOME Bugzilla – Bug 744183
layout: Compute strut side more precisely for non primary monitors
Last modified: 2015-02-20 13:00:03 UTC
I'm using the window-list extension on multiple monitors (with "show on all monitors"). If I try to maximize a window vertically on non primary monitors, the window goes under the bottom panel. I found out that it happens because gnome-shell creates a strut with META_SIDE_LEFT instead of META_SIDE_BOTTOM for the bottom panel of my left non primary monitor. The attached patch should improve how strut sides are computed on non primary monitors. It seems to me that the "NetWM struts" comment might not be relevant any more?
Created attachment 296402 [details] [review] layout: Compute strut side more precisely for non primary monitors Don't assume struts are on the primary monitor while computing the strut side. Instead, find the first monitor that overlaps the strut and compute the strut side using it.
Review of attachment 296402 [details] [review]: Ok, this looks reasonable to me. Can you submit at patch with a fixed comment instead of the FIXME? ::: js/ui/layout.js @@ +976,3 @@ + // FIXME: is this still accurate? meta_workspace_set_builtin_struts() + // bypasses the NetWM struts limitation and should work fine in + // multi-monitor scenarios. Yeah, I think should fix the the comment here, since the limitation only applies to the _NET_WORKAREA prop we export and no longer to mutter's internal concept of struts.
Created attachment 296541 [details] [review] layout: Compute strut side more precisely for non primary monitors Hi Rui, thanks for the review. I updated the patch to remove the somewhat obsolete NetWM paragraph and updated the rest.
Review of attachment 296541 [details] [review]: ::: js/ui/layout.js @@ +990,3 @@ + + if (x1 < m.x + m.width && x2 > m.x && + y1 < m.y + m.height && y2 > m.y) { Should we make meta_screen_get_monitor_for_rect() public instead?
Looks like meta_screen_get_monitor_index_for_rect() is public. And I see now that there's even a findMonitorForActor() in layout.js that could be handy. I'll try to update the patch.
Created attachment 296635 [details] [review] layout: Compute strut side more precisely for non primary monitors Much simpler now :)
Review of attachment 296635 [details] [review]: Looks good to me, thanks!
Attachment 296635 [details] pushed as c2f5813 - layout: Compute strut side more precisely for non primary monitors