! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Tile to top maximizes on wrong monitor
Status:
RESOLVED: MOVED

Comments

Description Pim Pronk 2017-01-09 19:22:34 CET
I have a tripple monitor setup as follows, it consists of one screen in Portrait mode, then one in Landscape and then another monitor in Portrait mode:
# xrandr --listmonitors
Monitors: 3
 0: +*HDMI-A-0 1920/518x1200/324+1080+480  HDMI-A-0
 1: +HDMI-A-1 1080/527x1920/297+0+271  HDMI-A-1
 2: +DVI-D-0 1050/408x1680/306+3000+0  DVI-D-0

When I drag a window from a large monitor to a smaller monitor and drag that window e.g. to the top border of monitor 0 to TILE_UP, sometimes the window is maximised on monitor 1 instead of monitor 0. But when I tile to a corner, the window is _always_ displayed on monitor 0.

I believe this is because in moveresize.c:clientMoveTile all TILE_'s are done by calling clientTile directly while passing xevent->x,y but TILE_UP is triggered by calling clientToggleMaximized without passing xevent->x,y information.
And as clientToggleMaximized always finds the current monitor by looking at the center point of the window, it could be that with dragging windows from a big to a smaller monitor that center point is not on the same monitor as the mouse is. 

Before I write a patch, would you consider this a bug or a feature?

As a patch i think you would need to pass (optionally?) the 'current' x,y variables to clientToggleMaximized so it will only use the center point of the window if there is no x,y available.
Comment 1 Pim Pronk 2017-01-09 19:44:46 CET
Allthough I am doubtfull you would consider accepting my patch for issue #11936, that patch would fix this issue by just calling clientTile for TILE_UP as well in moveresize.c:clientMoveTile:835 as that patch will correctly apply MAXIMIZED flags for all TILE events.
Comment 2 Olivier Fourdan editbugs 2017-01-10 08:58:08 CET
(In reply to Pim Pronk from comment #1)
> Allthough I am doubtfull you would consider accepting my patch for issue
> #11936,

Sorry I haven't had time to review your patch from bug 11936, so I cannot tell whether or not I would disagree on the code, but I don't disagree on the idea at least :)

> that patch would fix this issue by just calling clientTile for
> TILE_UP as well in moveresize.c:clientMoveTile:835 as that patch will
> correctly apply MAXIMIZED flags for all TILE events.

I lost you there, but if it is such a simple patch that goes on top of the one from bug 11936 maybe it's worth attaching it. At least we would have a starting point.

Thanks for your work!
Comment 3 Pim Pronk 2017-01-10 13:05:42 CET
Created attachment 6950 
fix

(In reply to Olivier Fourdan from comment #2)
> I lost you there

Yeah sorry, never mind that will not work. clientTile will not fully maximize the window at first but will only maximize horizontally to the top. 

Attached is a patch where I introduced a clientToggleMaximizedAtPoint method, this seems to work correctly. I choice to add this method to keep the impact on other code that uses clientToggleMaximized at a minimum. If you dont like introducing a new method we could change the definition of clientToggleMaximized but then we have to change all calls to clientToggleMaximized of course.
Comment 4 Olivier Fourdan editbugs 2017-01-10 14:11:26 CET
The patch makes sense to me, but could you please add a short description of the problem and the fix in the commit message?

Putting the bug number in the description is not very helpful.

See commit 3877bf4 for an example of what I'd like to see (even though I haven't been perfect in the past either...)

Rationale: http://who-t.blogspot.com/2009/12/on-commit-messages.html
Comment 5 Pim Pronk 2017-01-10 16:02:22 CET
Created attachment 6953 
Updated patch with clear commit message

Yes, my bad. Hope this commit message is more clear! :)
Comment 6 Pim Pronk 2017-11-04 18:02:47 CET
Hi, is there a reason this patch wasnt accepted/included yet? Does it still contain any issues? Should I fix it for the current branch?
Comment 7 Git Bot editbugs 2017-12-06 09:55:52 CET
P. Pronk referenced this bugreport in commit 9c888ac750265b88a865cdbd01edf50395c82c54

client: Maximize on expected output

https://git.xfce.org/xfce/xfwm4/commit?id=9c888ac750265b88a865cdbd01edf50395c82c54
Comment 8 Git Bot editbugs 2018-07-27 22:35:14 CEST
P. Pronk referenced this bugreport in commit 0c00ec4c86003e053d2e68337929fad8d7bedff1

client: Maximize on expected output

https://git.xfce.org/xfce/xfwm4/commit?id=0c00ec4c86003e053d2e68337929fad8d7bedff1
Comment 9 Git Bot editbugs 2020-05-29 12:14:06 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/xfwm4/-/issues/242.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #13284

Reported by:
Pim Pronk
Reported on: 2017-01-09
Last modified on: 2020-05-29

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Version:
4.12.0

Attachments

fix (3.66 KB, patch)
2017-01-10 13:05 CET , Pim Pronk
no flags
Updated patch with clear commit message (4.21 KB, patch)
2017-01-10 16:02 CET , Pim Pronk
no flags

Additional information