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 323820 - Moving maximized windows between xineramas doesn't work properly
Moving maximized windows between xineramas doesn't work properly
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 333329 334830 337534 341879 344541 345382 (view as bug list)
Depends on:
Blocks: 324773
 
 
Reported: 2005-12-11 20:33 UTC by Rob Adams
Modified: 2006-09-28 01:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for constraints.c (609 bytes, patch)
2006-06-13 22:19 UTC, Stéphane Rosi
committed Details | Review

Description Rob Adams 2005-12-11 20:33:44 UTC
As part of the "tear-off" unmaximizing code, it was possible to drag a window
from one xinerama to the other without actually having it unmaximize by dragging
the titlebar horizontally.  Now, if you try that, it will repeatedly unmaximize
and maximize the window but stay "stuck" on the old xinerama, unless you bring
the titlebar far enough down to trigger the normal tear off, then drag it over,
then hook it back into the top of the other xinerama.

Also, when doing this, it sometimes seems to treat the xinerama boundary like a
screen boundary instead of a regular edge.
Comment 1 Elijah Newren 2006-03-04 15:47:07 UTC
*** Bug 333329 has been marked as a duplicate of this bug. ***
Comment 2 Elijah Newren 2006-04-07 04:56:03 UTC
*** Bug 337534 has been marked as a duplicate of this bug. ***
Comment 3 Elijah Newren 2006-04-07 05:24:38 UTC
See also bug 315622, which is kind of related, though about the old (intentional) behavior being unintuitive rather than about a bug in the new behavior being uncompatible with the old.

For those not swamped with metacity bugs and interested in looking into this problem; the answer can probably be found between meta_window_get_work_area_current_xinerama(), setup_constraint_info(), constrain_maximization(), and update_move() (in the last function, I basically ignored the "remaximize" section of the code when rewriting the constraints as it was difficult at the time to grok and I couldn't test; I assumed leaving it alone despite other changes wouldn't cause problems but this bug seems to say otherwise).
Comment 4 Markus Meyer 2006-04-20 09:00:27 UTC
I can confirm this bug. It worked in Ubuntu Breezy, but I now have Ubuntu Dapper flight6 (pre-release) and it doesn't work anymore. I don't think the old behaviour was unintuitive. Indeed, I discovered the functionality by "intuition" and I was very happy that this worked.
Comment 5 Elijah Newren 2006-04-27 20:07:01 UTC
Hehe, the cause of the bug is pretty simple and will be easy to fix.  Maximization means make the window the size of the workarea of "the xinerama".  When you're moving a window though, there's two different xineramas to consider -- the one which best fits the previous position of the window and the one that best fits the new proposed position of the window.  The current code always computes "the xinerama" as being the one corresponding to the old position of the window.  Thus the reason for this bug.

To fix this, just make setup_constraint_info() use the new position of the window instead of the old in computing info->work_area_xinerama and info->entire_xinerama.  There is code in place_window_if_needed() that computes the xinerama this way, which may be helpful.
Comment 6 Elijah Newren 2006-05-15 18:01:21 UTC
*** Bug 341879 has been marked as a duplicate of this bug. ***
Comment 7 Elijah Newren 2006-06-11 05:32:00 UTC
*** Bug 344541 has been marked as a duplicate of this bug. ***
Comment 8 Stéphane Rosi 2006-06-13 22:19:57 UTC
Created attachment 67302 [details] [review]
Patch for constraints.c

I created a patch as described in the comments above.

To get the correct xinerama information, I used meta_screen_get_current_xinerama() that uses the location of the pointer. In fact meta_screen_get_xinerama_for_rect() would return the correct xinerama only when the cursor has passed half of the new screen, which is not the expected behaviour.

Using the pointer makes sense as the user surely wants to put the window on the monitor where the cursor is, instead of the one with the major part of the window on it.
Comment 9 Elijah Newren 2006-06-20 16:14:03 UTC
*** Bug 345382 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Thurman 2006-07-01 02:06:51 UTC
I've tested this patch, and it works fine. (Am I allowed to confirm patches? I'm not sure.)

Stéphane: thanks a whole lot! Just one thing: next time, please use the "-up" switches to cvs diff so that you get a unified diff; they're much easier for us to work with.
Comment 11 Elijah Newren 2006-08-08 00:36:56 UTC
Crap, I missed this patch for the release yesterday since it was in the commented-on state.  Doh!  Sorry about that.

Anyway, the patch looks good, I've just got a minor nit (besides the -up thing Thomas mentioned) -- the patch bases the xinerama decision on the mouse position rather than where the majority of the window is.  While both should be fine, I think I'd prefer based off where the majority of the window is.  Besides, that will allow us to avoid a roundtrip to the x-server.  :)  So, I made a minor change to the patch to do that and committed it.

2006-08-07  Elijah Newren  <newren gmail com>

	* src/constraints.c (setup_constraint_info): patch from Stéphane
	Rosi to allow moving maximized windows between xineramas again.
	#323820

Thanks for the work!
Comment 12 Elijah Newren 2006-09-28 01:00:49 UTC
*** Bug 334830 has been marked as a duplicate of this bug. ***