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 358715 - Strange behavior while moving maximized window (xinerama)
Strange behavior while moving maximized window (xinerama)
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 391710 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-10-01 09:25 UTC by Sebastien Bacher
Modified: 2007-04-12 22:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
patch by Christof Krüger (628 bytes, patch)
2006-10-01 09:26 UTC, Sebastien Bacher
none Details | Review

Description Sebastien Bacher 2006-10-01 09:25:25 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/metacity/+bug/62894

"This one is not easy to describe. But let's try it.

I have a dual-head setup using xinerama.
On the right screen I open a window and maximize it.
Now I drag the window title and move it over to the left screen.

Supposed behavior is to un-maximize the window when dragged to a position where the title bar is NOT near the upper margin of a monitor and maximize if it actually is.

Please watch the video I uploaded on youtube:

http://www.youtube.com/watch?v=_8Uz_nja5fY

The resolution of the video is very limited so you can't actually see the cursor. What I do is I drag the image preview window of the "fire" photograph straight to the left. This does not work when I drag the window purely horizontally. It starts to jump around, appears, disappears...

It works when I first drag it downwards to "detach" it from the right screen, then drag it over to the left screen and "reattach" it to maximized state again.
...
> Thanks for your bug. What version of Ubuntu do you use?
...
It's Ubuntu Edgy Beta. This behaviour already occurred in Dapper I didn't manage to file a bug before.

I have panels on the top of the left and on the right monitor (both are equally high) if that helps.
If you need further information or testing, please tell me.

http://librarian.launchpad.net/4565558/007_moving_maximized_windows.patch
Patch fixing strange behaviour when moving maximized windows

Hi Sebastien,

I've looked into the source code of metacity and could find the crucial lines. I've atteched a diff. This is my very first patch, so please forgive me if there's anything wrong with it.

The problem did not only occur when dragging horizontally starting on the right monitor without "shaking loose" the windows first. It also occurs when first "shaking loose", then moving to the left and reattaching with the cursor on the left monitor but with the window-center on the right monitor.

Metacity first sets the coordinates (window->saved_rect) to the top left corner of the monitor and unmaximizes the grabbed window. Then, it is maximizes it again. At this point window->user_rect is used as reference to which xinerama workspace the window belongs. Therefore, the window is maximized on the wrong monitor. When dragging the window further the procedure is repeated: restoring the window to the left monitor top left and immediately maximizing to the wrong monitor yielding the weird window "jumping".

The patch is a two-liner: The window->save_rect coordinates are also written to window->user_rect which is legitimate since it is a user requested moving operation. With that the window is maximized to the correct xinerama workspace.

What are the right steps to fix the bug upstream, too?"
Comment 1 Sebastien Bacher 2006-10-01 09:26:12 UTC
Created attachment 73739 [details] [review]
patch by Christof Krüger
Comment 2 Thomas Thurman 2006-12-06 01:34:54 UTC
Tested, it works fine, and now it's checked in. Thank you!

Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.
Comment 3 Elijah Newren 2007-04-12 22:11:35 UTC
*** Bug 391710 has been marked as a duplicate of this bug. ***