nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

Full Screening Videos without un-full-screening it causes nyxt to be stuck in full screen mode in XMonad

Open mariari opened this issue 2 years ago • 10 comments

Describe the bug

When one watches a video on nyxt and full screens it then tabs away they can't unfull screen. This bug does not show up on stumpwm due to how it handles fullscreen

What would be nice is a way to force it to un-fullscreen or handle it slightly differently (Firefox oddly enough has good unintended behavior where I can then force the window size to return to normal yet it keeps the video full screened in the browser itself. This means that for other sites nyxt will just behave normally even in this state.)

This issue has been with nyxt since before 4/23/2021

Precise recipe to reproduce the issue

#1677 Play the video given in full screen, switch buffers switch-buffer-previous. Notice how you can't un fullscreen.

Depending on how your WM handles this issue it may or may not allow the buffer to unfull screen

Information

  • OS name+version:
    • Arch Linux
  • Desktop environment / Window manager name+version:
    • XMonad

mariari avatar Aug 07 '21 03:08 mariari

I could not reproduce this issue on my XMonad setup. The un-fullscreen button I squared out in screenshot below works even after switch-buffer-previous.

How do you set up fullscreenEventHook and ewmhDesktopsStartup in XMonad.Hooks.EwmhDesktop?

Also, _NET_WM_STATE_FULLSCREEN support seems not propagated even with EwmhDesktop. mpv has workaround parameter x11-netwm=yes for this issue. I don't know of stumpwm but this can cause the difference. https://github.com/mpv-player/mpv/issues/888#issuecomment-53065149 2021-10-21-211519_3840x1080_scrot

qst0528 avatar Oct 21 '21 12:10 qst0528

I could not reproduce this issue on my XMonad setup. The un-fullscreen button I squared out in screenshot below works even after switch-buffer-previous.

How do you set up fullscreenEventHook and ewmhDesktopsStartup in XMonad.Hooks.EwmhDesktop?

Also, _NET_WM_STATE_FULLSCREEN support seems not propagated even with EwmhDesktop. mpv has workaround parameter x11-netwm=yes for this issue. I don't know of stumpwm but this can cause the difference. mpv-player/mpv#888 (comment) 2021-10-21-211519_3840x1080_scrot

for my EMWH hooks I have the following

applyEwmh :: XConfig a -> XConfig a
applyEwmh c = c
  { startupHook     = startupHook c <> EWMH.ewmhDesktopsStartup
  , handleEventHook = handleEventHook c <> MousePos.ewmhEventHook
  , logHook         = logHook c <> EWMH.ewmhDesktopsLogHook
  }

Most notabely though I don't use the fullscreenHookEvent

myHandleEventHook :: Event -> X Monoid.All
myHandleEventHook = ManageDocks.docksEventHook -- <> EWMH.fullscreenEventHook
                 <> handleEventHook def

But the issue isn't with the button. The button works and unfullscreens nyxt. However try to unfullscreen nyxt without the button. That is when the issue begins, as you could say delete the buffer and then lack the ability to unfullscreen nyxt until you find a new video.

Firefox oddly enough does a nice thing, where the media in the browser stays fullscreen (thus youtube videos are full screened), but the browser comes out of fullscreen mode.

mariari avatar Oct 21 '21 18:10 mariari

Hmm, I still cannot reproduce it. Nyxt can go to and back from fullscreen with M-x toggle-fullscreen in my setup.

Basically my configuration is following. main = xmonad $ docks . ewmhFullscreen . ewmh $ def

I'm afraid I misunderstand the word 'tabs away'. Do you mean clipped window contents? Then I found this hack, which I haven't tested. https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/XMonad-Util-Hacks.html#g:1

qst0528 avatar Nov 01 '21 17:11 qst0528

Hmm, I still cannot reproduce it. Nyxt can go to and back from fullscreen with M-x toggle-fullscreen in my setup.

Basically my configuration is following. main = xmonad $ docks . ewmhFullscreen . ewmh $ def

I'm afraid I misunderstand the word 'tabs away'. Do you mean clipped window contents? Then I found this hack, which I haven't tested. https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/XMonad-Util-Hacks.html#g:1

yeah M-x toggle-fullscreen works. However you can't do that from your wm itself.

Normally for applications, when you press the toggle full screeen button on your WM (not M-x toggle-fullscreen), the window will shrink to the correct spot on the screen. Firefox acts ideally, just full sizing itself in the window size, meaning the WM can freely chose to full screen it. Applications like Chrome act less ideally but work well, in that they full screen to the screen size, but when a user presses the unfull screen key on their WM, chrome shrinks to it's correct size unfullscreening itself.

However with nyxt, you have to initiate it from either the button which may be long gone or Mx- toggle-fullscreen. Which would be confusing to new users if they lost the page with the unfullscreen button (as not all users know about that command).

by tabs away I meant more of switching the buffer to something else. Sometimes one has the browser full screen not realizing that they've hit full screen on the video and already killed the buffer. Thus they are stuck with a full screen nyxt that they can't unfullscreen if not for M-x toggle-fullscreen

mariari avatar Nov 01 '21 18:11 mariari

@aartaka Any idea if WebKitGTK could help here?

Ambrevar avatar Nov 19 '21 07:11 Ambrevar

@aartaka Any idea if WebKitGTK could help here?

The only guess I can make is the "enter-fullscreen" signal. Either this or GTK Widget/Window configuration.

aartaka avatar Nov 19 '21 10:11 aartaka

Both (enter|leave)-fullscreen and focus-out-event are handled by Nyxt at c89c0c5d8595426c71fee52a62ed4e86b2390a37. @mariari, care to try and reproduce the issue?

aartaka avatar Feb 08 '22 13:02 aartaka

Both (enter|leave)-fullscreen and focus-out-event are handled by Nyxt at c89c0c5. @mariari, care to try and reproduce the issue?

Just tested it, it works for the given example, however it also unfullscreens the player when the mouse moves out of the window and onto another monitor.

Better behavior than before, but that last bit still seems like a bug?

mariari avatar Feb 08 '22 17:02 mariari

Huh, that's indeed a bug. Not sure how to solve it properly, but we'll sure do something :)

aartaka avatar Feb 10 '22 07:02 aartaka

I couldn't reproduce it with master (c9a98dd7a2a12b7d500ac2abe4ae015887b752b3) on a 0 configuration xmonad using this diff. Is this still an issue with said diff @mariari ?

diff --git a/source/renderer/gtk.lisp b/source/renderer/gtk.lisp
index 82c2bf0e..826cc7e8 100644
--- a/source/renderer/gtk.lisp
+++ b/source/renderer/gtk.lisp
@@ -1413,11 +1413,6 @@ See `finalize-buffer'."
   (connect-signal buffer "load-changed" t (web-view load-event)
     (declare (ignore web-view))
     (on-signal-load-changed buffer load-event))
-  (connect-signal buffer "focus-out-event" t (web-view event)
-    (declare (ignore web-view event))
-    (when (fullscreen-p (current-window))
-      (ffi-window-unfullscreen (current-window)))
-    nil)
   (connect-signal buffer "mouse-target-changed" nil (web-view hit-test-result modifiers)
     (declare (ignore web-view))
     (on-signal-mouse-target-changed buffer hit-test-result modifiers))

Edit: It's probably important to note that it was fullscreened within nyxt, xmonad didn't fullscreen anything.

CorruptedVor avatar Jul 09 '22 12:07 CorruptedVor