feh should request Full Screen to the window manager
I'm asking this, but please be aware that I don't fully comprehend how "full screen" works on X11.
How to reproduce
- Get a system with multiple displays running KDE/Plasma. In my case, Manjaro Linux with KDE/Plasma on Xorg. (I'm not using Wayland.)
- Go to the KDE System Settings.
- Under Window Management, select KWin Scripts.
- Enable Video Wall.
- Click on the little settings button besides the Video Wall script.
- Either uncheck Apply to (which means it applies to all applications), or add
, fehto the list. - Click Ok, Apply, etc. You may even close the system settings and logout and login again, if you prefer.
- Now open
fehon any image. - Press
Fto go to full screen.
What happens
Feh is full-screen on a single display.
What I expected to happen
Feh should have expanded to all displays.
Why?
- Feh would have requested the full screen mode.
- Then, KWin (the window manager) would intercept it and run the Video Wall script.
- The Video Wall script is supposed to be executed every time
fullScreenChangedevent happens. - The Video Wall script would then set the Feh full screen window dimensions to match all the displays.
It works fine when setting full screen on Firefox, VLC, Konsole, and certainly others.
For some unknown reason, it doesn't work for Feh. I believe the fullScreenChanged event is never triggered for Feh windows, possibly because Feh's full-screen implementation is missing something that the other apps have. But this is just a guess. You can confirm it by changing the /usr/share/kwin/scripts/videowall/contents/code/main.js script to add console.log(window) (or console.log(client)) on the callback function passed to connect(). (Please remember to reload the KWin script. If unsure, just logout and login again.) On my system, that console.log() prints stuff for the aforementioned applications, but doesn't print anything for Feh, which means that callback is never called.
Relevant VLC source-code: (probably)
- https://code.videolan.org/videolan/vlc/-/blob/bc0ae4752e63638d5fe16d7304cb0edfa1f8c50f/modules/video_output/xcb/window.c#L704-766
- https://code.videolan.org/videolan/vlc/-/blob/bc0ae4752e63638d5fe16d7304cb0edfa1f8c50f/modules/video_output/xcb/window.c#L941-942
Relevant Feh source-code: (probably)
- https://github.com/derf/feh/blob/1d02f9027a39d45657e78eba19b4956158bb4365/src/winwidget.c#L294-L309
- https://github.com/derf/feh/blob/1d02f9027a39d45657e78eba19b4956158bb4365/src/winwidget.c#L344-L353
Running xwininfo -wm on VLC (before and after entering full screen):
xwininfo: Window id: 0x5c0000c "rickroll.mp4 - VLC media player"
Window manager hints:
Client accepts input or input focus: Yes
Initial state is Normal State
Displayed on desktop 0
Window type:
Normal
Process id: 545810 on host foobar
Frame extents: 0, 0, 28, 0
xwininfo: Window id: 0x5c0000c "rickroll.mp4 - VLC media player"
Window manager hints:
Client accepts input or input focus: Yes
Initial state is Normal State
Displayed on desktop 0
Window type:
Normal
Window state:
Fullscreen
Focused
Process id: 545810 on host foobar
Frame extents: 0, 0, 0, 0
Running xwininfo -wm on Feh (before and after entering full screen):
xwininfo: Window id: 0x6200001 "feh [1 of 8] - foobar.jpg"
No window manager hints defined
Window manager hints:
Displayed on desktop 0
Process id: 550205 on host foobar
Frame extents: 0, 0, 28, 0
xwininfo: Window id: 0x6200005 "feh [1 of 8] - foobar.jpg"
No window manager hints defined
Window manager hints:
Displayed on desktop 0
Window state:
Maximized Vert
Maximized Horz
Fullscreen
Process id: 550205 on host foobar
Somehow, it says "No window manager hints defined" for Feh. This may be a hint to start understanding what is the root cause.
When using xprop against both VLC and Feh, I noticed:
- VLC had
_NET_WM_STATE(ATOM) =when windowed. - Feh had
_NET_WM_STATE(ATOM) =when windowed. - VLC had
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREENwhen full screen. - Feh had
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_FULLSCREENwhen full screen. - VLC has
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL, while Feh didn't have that hint/prop. - VLC and Feh had different (hexadecimal) values for
_MOTIF_WM_HINTS.
I don't know what else to do. If you can provide a patch (or a branch), I can try compiling it myself and observing if the behavior changes.