ice-wm / icewm

IceWM releases only, see Wiki
https://github.com/ice-wm/icewm/releases
Other
289 stars 15 forks source link

qt programs behaving oddly with maximize #141

Closed bananaliker closed 1 year ago

bananaliker commented 1 year ago

Example programs: pcmanfm-qt, lximage-qt (only when open with an image, behaves normally if opened on its own), audacious.

Windows of said programs maximize just fine (via KeyWinMaximize in my case, but the maximize window button has the same effect), but when un-maximizing (same input again), the windows retain their maximized size, rather then returning to the size they had pre-maximization. GTK based programs ie. Mousepad, Firefox don't seem to have this issue.

Using IceWM 3.4.0

gijsbers commented 1 year ago

Confirmed for lximage-qt and audacious in Qt mode, but not for pcmanfm-qt version 1.2.1, funnily enough. What version of pcmanfm-qt do you run?

bananaliker commented 1 year ago

1.2.1-1, the latest in Debian stable. I also tested it just now with a bunch of different qt style plugins (motif, cde, windows, fusion, clearlooks, plastique, gtk2) in case that was the cause, and the issue seems to persist across all of them.

gijsbers commented 1 year ago

This fixes it for me.

bananaliker commented 1 year ago

Seems to fix it for me, too. Excellent work and thank you.

zaza42 commented 1 year ago

This patch unfortunately made a bug. When I switch to fullscreen in chromium and switch back, the window get shrinked until I haven't focused another window. Then the chromium window "magically" restores its original dimensions.

Original: 1485x867-5-16, fullscreen: 1600x900+0+0, after quiting fullscreen: 1483x787-5-16, after focus on another window, it restores the original 1485x867-5-16.

gijsbers commented 1 year ago

Reproduced. Also for chrome, but not for Firefox, Epiphany or Opera. Can you confirm that this only happens for F11, but not for the icewm hotkey? Hence it is the chromium internal means to go fullscreen. What is your xprop | grep -e '[:=]'? And icesh -c chromium-browser list spy?

zaza42 commented 1 year ago

Yes, this only happens when chromium's internal fullscreen switching - the most common way is to put youtube (or any) videos to fullscreen.

$ xprop | grep -e '[:=]' 
_WIN_LAYER(CARDINAL) = 4
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
_NET_WM_STATE(ATOM) = 
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 0, 0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _NET_WM_ACTION_STICK, _NET_WM_ACTION_CHANGE_DESKTOP
_NET_WM_VISIBLE_NAME(UTF8_STRING) = "qt programs behaving oddly with maximize · Issue #141 · ice-wm/icewm ::: https://github.com/ice-wm/icewm/issues/141 - Chromium"
_NET_WM_USER_TIME(CARDINAL) = 46581296
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified location: -5, -16
        program specified minimum size: 502 by 113
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x0, 0x0, 0x0
XdndAware(ATOM) = BITMAP
_NET_WM_ICON(CARDINAL) =    Icon (128 x 128):
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED(CARDINAL) = 1
WM_NAME(UTF8_STRING) = "qt programs behaving oddly with maximize · Issue #141 · ice-wm/icewm ::: https://github.com/ice-wm/icewm/issues/141 - Chromium"
_NET_WM_NAME(UTF8_STRING) = "qt programs behaving oddly with maximize · Issue #141 · ice-wm/icewm ::: https://github.com/ice-wm/icewm/issues/141 - Chromium"
WM_WINDOW_ROLE(STRING) = "browser"
WM_CLASS(STRING) = "chromium-devel", "Chromium-devel"
_NET_WM_DESKTOP(CARDINAL) = 3
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 9182
WM_CLIENT_MACHINE(STRING) = "tecra"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING, _NET_WM_SYNC_REQUEST
$ icesh -c Chromium-devel list spy | tee /tmp/iceshspy.log                       <
0x4a00002   3  9182 "qt programs behaving oddly with maximize · Issue ": (chromium-devel.Chromium-devel) 1485x867-5-16
0x4a00004   3  9182 "Kritikus Tömeg ::: https://kritikustomeg.org/ - C": (chromium-devel.Chromium-devel) 1485x867-5-16
23:54.367: 0x4a00002: Enter Normal Nonlinear Nofocus
23:54.583: 0x4a00002: Leave Normal Nonlinear Nofocus
23:55.727: 0x4a00002: Enter Normal Nonlinear Nofocus
23:56.143: 0x4a00002: Leave Grab Ancestor Nofocus
23:56.143: 0x4a00002: _NET_WM_STATE = _NET_WM_STATE_FOCUSED
23:56.145: 0x4a00002: Focus Normal Nonlinear
23:56.145: 0x4a00002: Enter Ungrab Ancestor Focus
23:56.157: 0x4a00002: _NET_WM_USER_TIME = 46726964
23:57.615: 0x4a00002: Leave Grab Ancestor Focus
23:57.615: 0x4a00002: Enter Ungrab Ancestor Focus
23:57.616: 0x4a00002: _NET_WM_USER_TIME = 46728436
23:57.721: 0x4a00002: Visibility Unobscured 
23:57.721: 0x4a00002: Configure 0x4a00002 1600x900+0+0
23:57.721: 0x4a00002: Visibility PartiallyObscured 
23:57.721: 0x4a00002: _NET_WM_STATE = _NET_WM_STATE_FOCUSED, _NET_WM_STATE_FULLSCREEN
23:57.723: 0x4a00002: _WIN_LAYER = 14
23:57.724: 0x4a00002: Visibility Unobscured 
23:57.725: 0x4a00002: WM_NORMAL_HINTS PPos(-5,-16) MinSize(500,33)
23:57.738: 0x4a00002: _NET_WM_USER_TIME = 46728549
23:57.746: 0x4a00002: _NET_WM_USER_TIME = 46728567
23:59.799: 0x4a00002: _NET_WM_USER_TIME = 46730620
23:59.806: 0x4a00002: Visibility PartiallyObscured 
24:00.728: 0x4a00002: Visibility Unobscured 
24:00.728: 0x4a00002: Enter Normal Nonlinear Focus
24:00.728: 0x4a00002: Visibility PartiallyObscured 
24:00.728: 0x4a00004: Visibility PartiallyObscured 
24:00.728: 0x4a00002: Configure 0x4a00002 1483x787+0+0
24:00.728: 0x4a00002: Configure 0x4a00002 1483x787+-5+-16 Send
24:00.728: 0x4a00002: _NET_WM_STATE = _NET_WM_STATE_FOCUSED
24:00.729: 0x4a00002: _WIN_LAYER = 4
24:00.736: 0x4a00002: WM_NORMAL_HINTS PPos(-5,-16) MinSize(502,81)
24:00.739: 0x4a00002: WM_NORMAL_HINTS PPos(-5,-16) MinSize(502,113)
24:00.756: 0x4a00002: _NET_WM_USER_TIME = 46731559
24:00.763: 0x4a00002: _NET_WM_USER_TIME = 46731576
24:01.831: 0x4a00002: Leave Normal Nonlinear Focus
24:01.831: 0x4a00004: Enter Normal Nonlinear Nofocus
24:01.879: 0x4a00004: Leave Normal Nonlinear Nofocus
24:02.055: 0x4a00004: Enter Normal Nonlinear Nofocus
24:03.471: 0x4a00004: Leave Normal Nonlinear Nofocus
24:04.375: 0x4a00004: Visibility FullyObscured 
24:04.375: 0x4a00002: Configure 0x4a00002 1485x867+0+0
24:04.375: 0x4a00002: _NET_WM_STATE = 
24:04.377: 0x4a00002: Defocus Normal Nonlinear
24:05.607: 0x4a00002: Enter Normal Nonlinear Nofocus
24:06.519: 0x4a00002: Leave Grab Ancestor Nofocus
24:06.519: 0x4a00002: _NET_WM_STATE = _NET_WM_STATE_FOCUSED
24:06.520: 0x4a00002: Focus Normal Nonlinear
24:06.520: 0x4a00002: Enter Ungrab Ancestor Focus
24:06.531: 0x4a00002: _NET_WM_USER_TIME = 46737341
24:07.791: 0x4a00002: Leave Normal Nonlinear Focus
24:08.591: 0x4a00002: _NET_WM_STATE = 
24:08.593: 0x4a00002: Defocus Normal Nonlinear
24:08.711: 0x4a00002: Enter Normal Nonlinear Nofocus
24:08.839: 0x4a00002: Leave Normal Nonlinear Nofocus
zaza42 commented 1 year ago

Fixed, thanx!

gijsbers commented 1 year ago

Released in 3.4.2.