GNOME Bugzilla – Bug 748478
wayland: dragging window to top with multiple monitors maximizes it on originating monitor
Last modified: 2015-04-30 12:03:01 UTC
Created attachment 302365 [details] screencast of issue reproduction Steps to reproduce: Prerequisites: * plug in at least two monitors to your PC * start GNOME session with wayland from GDM Then: * Open a window * Drag it over to the top of another monitor Expected Results: It maximizes on the other monitor. Actual Results: It maximizes on the monitor where it was before the dragging began. Also see appended video.
I just noticed this only happens to some windows. It happens with: * gnome-terminal * gnome-calendar * gedit * gnome-boxes * brasero It doesn't happen with: * PyCharm * Chrome * Firefox * VLC * gimp Even with this small test set leads to the conclusion that this somehow primarily affects GNOME applications...
Created attachment 302570 [details] [review] core/events: Invalidate monitor cache when we're a wayland compositor When running as an X11 compositor we do this for every event we see on the X event stream. As a wayland compositor we don't go through that code path but since we see all events we can easily do this on motion events. In fact, we don't even need this caching when we're a wayland compositor since we can always find where the pointer is without a round trip but we're sharing the current monitor logic with the X path so let's keep it as is for now.
Review of attachment 302570 [details] [review]: Uh, I'm confused, we don't do a round-trip even under X11, right? It's just some local math about monitor rectangles. It only needs to be invalidated on pointer motion. https://git.gnome.org/browse/mutter/tree/src/core/screen.c#n1634
(In reply to Jasper St. Pierre from comment #3) > Review of attachment 302570 [details] [review] [review]: > > Uh, I'm confused, we don't do a round-trip even under X11, right? It's just > some local math about monitor rectangles. It only needs to be invalidated on > pointer motion. > > https://git.gnome.org/browse/mutter/tree/src/core/screen.c#n1634 Look at the function below that one, meta_screen_get_current_monitor(), it round trips on X11 through meta_cursor_tracker_get_pointer(). Other callers of meta_screen_get_current_monitor_for_pos() like window.c:update_move(), which is where the bug reported here happens, already have coords so they don't need the round trip.
Review of attachment 302570 [details] [review]: Ah, right. I still think this is a bit silly, but let's go with it.
7bdd698..7f0ed14 gnome-3-16 -> gnome-3-16 7eca43c..d478d8f master -> master Attachment 302570 [details] pushed as d478d8f - core/events: Invalidate monitor cache when we're a wayland compositor