Discussion:
[xmonad] GLFW fullscreen
Tuncer Ayaz
2017-03-02 00:35:30 UTC
Permalink
I wrote a patch[1] for MuPDF's OpenGL viewer (which makes use of GLFW)
to enable fullscreen toggle, but XMonad doesn't like GLFW's
implementation. Also, since glfwSetWindowTitle sets X11's title,
class, and instance to the same value, it's currently impossible[2] to
apply a rule for the window, but it's easy to patch and test if you
think this can be solved with a manageHook rule.

Entering and returning from fullscreen does work correctly with
FVWM, Fluxbox, WindowMaker, dwm, Weston, and sway, of which two are
Wayland compositors and dwm is a tiling wm like XMonad.

What happens with XMonad is that it enters GLFW fullscreen after a
multi-second delay and is not able to return from it on toggle.

If I patch mupdf to not update the title, add a doFloat rule, and
toggle fullscreen, it does not enter fullscreen until I manually
interact with the still visibly floating window by trying to move it
with a mouse. However, it does return from fullscreen into its
original size/position when I press 'f' again.

My config is a a personal extension of
https://github.com/xmonad/xmonad-testing/blob/master/example-config.hs.

Is GLFW's fullscreen toggle implementation generally problematic in
XMonad, or can I solve this in my config?


As noted in [1], llpp fullscreen toggle works with XMonad, and it uses
OpenGL as well, but it doesn't rely on GLFW, so this isn't a general
issue with OpenGL but specific to GLFW.

[1] https://bugs.ghostscript.com/show_bug.cgi?id=697593
[2] https://bugs.ghostscript.com/show_bug.cgi?id=697634
Tuncer Ayaz
2017-03-02 05:29:27 UTC
Permalink
Also, since glfwSetWindowTitle sets X11's title, class, and instance
to the same value, it's currently impossible[2] to apply a rule for
the window, but it's easy to patch and test if you think this can be
solved with a manageHook rule.
[...]
[2] https://bugs.ghostscript.com/show_bug.cgi?id=697634
Actually, glfwSetwindowtitle is not at fault. MuPDF didn't pass the
correct string when calling glfwCreateWindow(). Patch attached in
MuPDF bug report.

So, if a manageHook rule can fix the fullscreen problem, we'll be able
to match instance or class now.
Dmitriy Matrosov
2017-03-05 08:51:11 UTC
Permalink
Post by Tuncer Ayaz
Post by Tuncer Ayaz
[..]
[2] https://bugs.ghostscript.com/show_bug.cgi?id=697634
Actually, glfwSetwindowtitle is not at fault. MuPDF didn't pass the
correct string when calling glfwCreateWindow(). Patch attached in
MuPDF bug report.
So, if a manageHook rule can fix the fullscreen problem, we'll be able
to match instance or class now.
Hi.

I think, you need to enable EWMH support. I've tried with minimal config
from [XMonad.Hooks.EwmhDesktops][1] and fullscreen works (in `mupdf-x11`
with and without your patch, if i've applied it correctly).


[1]:
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-EwmhDesktops.html
Tuncer Ayaz
2017-03-05 12:08:17 UTC
Permalink
Post by Dmitriy Matrosov
Post by Tuncer Ayaz
Post by Tuncer Ayaz
[..]
[2] https://bugs.ghostscript.com/show_bug.cgi?id=697634
Actually, glfwSetwindowtitle is not at fault. MuPDF didn't pass
the correct string when calling glfwCreateWindow(). Patch attached
in MuPDF bug report.
So, if a manageHook rule can fix the fullscreen problem, we'll be
able to match instance or class now.
Hi.
I think, you need to enable EWMH support. I've tried with minimal
config from [XMonad.Hooks.EwmhDesktops][1] and fullscreen works (in
`mupdf-x11` with and without your patch, if i've applied it
correctly).
Thanks for taking a look.

My patches are for fixing mupdf-gl (the GLFW created OpenGL viewer).

desktopConfig, which is what I use in my extended version of
example-config.hs, has basic EWMH enabled. Nonetheless, I've added
handleEventHook with EwmhDesktops.fullscreenEventHook, but it didn't
make a difference.

I think you tried the x11 viewer and not glfw. Test mupdf-gl instead.

So, if you manage to modify

https://raw.githubusercontent.com/xmonad/xmonad-testing/master/example-config.hs

such that it doesn't (on entering fullscreen) print a set of

gl error 65544: X11: Iconification of full screen windows requires a
WM that supports EWMH fullscreen

and thereby toggles fullscreen like mupdf-x11, we can fix the example
config.
Brandon Allbery
2017-03-05 17:32:48 UTC
Permalink
Post by Tuncer Ayaz
gl error 65544: X11: Iconification of full screen windows requires a
WM that supports EWMH fullscreen
This is xmonad not *advertising* EWMH fuillscreen, because the startupHook
can't tell whether the fullscreenEventHook is present or not.
--
brandon s allbery kf8nh sine nomine associates
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Dmitriy Matrosov
2017-03-06 20:03:29 UTC
Permalink
This post might be inappropriate. Click to display it.
Dmitriy Matrosov
2017-03-06 20:13:48 UTC
Permalink
Post by Dmitriy Matrosov
[..]
So, apart from regular `XMonad.Hooks.EwmhDesktops` i need to advertise two
It seems, gmail wraps the lines.. Here is the xmonad.hs from previous
message again:
https://gist.github.com/sgf-dma/a609f855bbacf1a0292e660c32a5a04e
Brandon Allbery
2017-03-06 20:16:14 UTC
Permalink
Post by Dmitriy Matrosov
It seems, gmail wraps the lines
Use "Fixed Width" font in the formatting toolbar at the bottom of the
compose window. Indenting the code is also a good idea, since mail readers
don't always agree on how to treat such things.
--
brandon s allbery kf8nh sine nomine associates
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Tuncer Ayaz
2017-03-20 00:00:40 UTC
Permalink
This post might be inappropriate. Click to display it.
Dmitriy Matrosov
2017-03-20 17:28:32 UTC
Permalink
Post by Tuncer Ayaz
Post by Dmitriy Matrosov
Post by Tuncer Ayaz
My patches are for fixing mupdf-gl (the GLFW created OpenGL viewer).
desktopConfig, which is what I use in my extended version of
example-config.hs, has basic EWMH enabled. Nonetheless, I've added
handleEventHook with EwmhDesktops.fullscreenEventHook, but it didn't
make a difference.
I think you tried the x11 viewer and not glfw. Test mupdf-gl instead.
Ah, yes, i've tried `mupdf-x11`. But now, i think, i found the
reason why fullscreen doesn't work: as Brandon Allbery noted, the
problem is in advertising EWMH. It turns out, two atoms are missed
in `_NET_SUPPORTED`: `_NET_WM_STATE` and `_NET_WM_STATE_FULLSCREEN`.
Without them glfw goes with "override redirect" way and fullscreen
does not work properly. Here is the relevant code from
Sorry for the late reply. I haven't had success with your xmonad.hs
"hack" yet, but my mupdf patches landed upstream, so vanilla
mupdf-gl from master will work correctly if the window manager does as
well.
You have tried my config or copied changes to yours? In the latter case,
please, provide the exact entire config you've tried. And also the git
revision in mupdf repository may help.
Post by Tuncer Ayaz
Also, it sounds like the bug could be fixed in xmonad-contrib. Is that
correct? Or would it make more sense to include the "hack" in
xmonad-testing/example.hs?
It should be fixed in xmonad-contrib in X.H.EwmhDesktops, as i
understand. There is already PR adding [part][1] of what needed, but it
haven't been merged yet.

[1]: https://github.com/xmonad/xmonad-contrib/pull/109

Loading...