! 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 !
Maximizing a window horizontally or vertically prevents maximizing on the oth...


Description OmegaPhil 2016-04-09 17:03:24 CEST
Start with a normalized window, then maximize horizontally, e.g.:


wmctrl -i -r '<window ID>' -b add,maximized_horz


This works. Then issue the maximized_vert command:


wmctrl -i -r '<window ID>' -b add,maximized_vert


Nothing happens. If you start off with a successful vertical maximization command, then the horizontal one fails (but of course doesn't tell wmctrl...).

It looks like the code is hardcoded to treat either MAXIMIZED_HORZ or MAXIMIZED_VERT as 'maximized' (client.h:157):




so when the command to add the maximized state is processed in netwm.c:clientUpdateNetState, line 381, the code ignores valid maximization commands in the axis that hasn't been maximized:


            if ((action == NET_WM_STATE_ADD) && !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED))
                mode = 0L;
                if ((first  == display_info->atoms[NET_WM_STATE_MAXIMIZED_HORZ]) ||
                    (second == display_info->atoms[NET_WM_STATE_MAXIMIZED_HORZ]))
                    mode |= !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ) ? CLIENT_FLAG_MAXIMIZED_HORIZ : 0;



is there a reason maximization in one axis only isn't being considered? Feels deliberate.

Comment 1 OmegaPhil 2016-04-28 17:42:14 CEST
As this has been ignored, I have looked into fixing it - turns out there is already a proper test that can be applied here - FLAG_TEST should be swapped with FLAG_TEST_ALL, since a window is only truly maximized when both axes are maximized:




This way just being maximized in one axis doesn't prevent the other from being applied.
Comment 2 Git Bot editbugs 2020-05-29 12:10:32 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/215.

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 #12538

Reported by:
Reported on: 2016-04-09
Last modified on: 2020-05-29


Olivier Fourdan
CC List:
0 users




Additional information