nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

Opening a prompt disables fullscreen on sway

Open CorruptedVor opened this issue 2 years ago • 10 comments

Describe the bug When using nyxt on sway in fullscreen, the fullscreen gets disabled (in sway) when a prompt pops up (tested with the command prompt).

Precise recipe to reproduce the issue Use sway (1.7) Fullscreen nyxt (in example via key combo bindsym $mod+f fullscreen) open command prompt ('Execute command') nyxt will not be fullscreen anymore

I've thought about a workaround, which would be telling sway to specifically disable border and title for nyxt, giving it the same visuals assuming there are no other windows on the same workspace. i.e. for_window [title="Nyxt"] border none Testing above line in the config worked well, making it look the same with and without fullscreen.

Information Void Linux musl, up to date Graphics card and driver: 4700U integrated graphics, xf86-video-amdgpu-22.0.0_1 Desktop environment / Window manager name+version: sway version 1.7 How you installed Nyxt (Guix pack, package manager, build from source): built from source Information from show-system-information:

Nyxt version: 3-1215-gfb7645ae
Renderer version: GI-GTK
Operating system kernel: Linux 5.15.36_1
Lisp implementation: SBCL 2.2.5.void.1 (Dynamic space size: 3221225472)
Features: (:WEBKIT2 :WEBKIT2-2.34 :WEBKIT2-CORS-ALLOWLIST :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING :WEBKIT2-MUTE :WEBKIT2-EMOJI :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22 :GTK-3-20 :GTK-3-18 :GTK-3-16 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6 :GTK-3-4 :GTK :GDK-3-22 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12 :GDK-3-10 :GDK-3-8 :GDK-3-6 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF :GLIB-2-30 :GLIB-2-32 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40 :GLIB-2-42 :GLIB-2-44 :GLIB-2-46 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54 :GLIB-2-56 :GLIB-2-58 :GLIB :NYXT-UNSTABLE :NYXT-GFB7645AE :NYXT-3 :FSET-EXT-STRINGS :CUSTOM-HASH-TABLE-NATIVE :SWANK :PLUMP-UTF-32 :PARENSCRIPT :GLOBAL-VARS :DECLARE-TYPES :NAMED-READTABLES :LPARALLEL :21BIT-CHARS :CLOSER-MOP :CL-PPCRE-UNICODE :CL-UNICODE :CL-PPCRE :CHUNGA :FLEXI-STREAMS :BORDEAUX-THREADS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS :LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO :CL-JSON-CLOS :CL-JSON :SBCL-USES-SB-ROTATE-BYTE CHIPZ-SYSTEM:GRAY-STREAMS :THREAD-SUPPORT :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :GENCGC :64-BIT :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE :SBCL :UNIX)

ASDF version: 3.3.1
ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY)
Critical dependencies: (/home/noneofyourbusiness/git/nyxt/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd /home/noneofyourbusiness/git/nyxt/_build/cl-gobject-introspection/cl-gobject-introspection.asd /home/noneofyourbusiness/git/nyxt/_build/cl-webkit/webkit2/cl-webkit2.asd)

CorruptedVor avatar Jun 11 '22 21:06 CorruptedVor

This is also true in EXWM, and probably other WMs.

aadcg avatar Jun 12 '22 12:06 aadcg

It's due to this:

(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)

@aartaka: Do you have a use case for this? I can't see what. Removing it fixes this issue.

Ambrevar avatar Jun 13 '22 13:06 Ambrevar

Reference: https://docs.gtk.org/gtk3/signal.Widget.focus-out-event.html

Ambrevar avatar Jun 13 '22 13:06 Ambrevar

I mean, unfocusing the buffer for some other window should likely unfullscreen it, I suppose? But then, Firefox doesn't bother about it, and it seems to be quite a fancy use-case. We can safely remove it, I suppose.

@mariari, any input on that? I remember that I added it in response to a bug report you opened...

aartaka avatar Jun 13 '22 16:06 aartaka

I mean, unfocusing the buffer for some other window should likely unfullscreen it, I suppose? But then, Firefox doesn't bother about it, and it seems to be quite a fancy use-case. We can safely remove it, I suppose.

@mariari, any input on that? I remember that I added it in response to a bug report you opened...

This https://github.com/atlas-engineer/nyxt/issues/1715 ?

CorruptedVor avatar Jun 13 '22 16:06 CorruptedVor

Yes.

aartaka avatar Jun 13 '22 17:06 aartaka

I mean, unfocusing the buffer for some other window should likely unfullscreen it, I suppose? But then, Firefox doesn't bother about it, and it seems to be quite a fancy use-case. We can safely remove it, I suppose.

@mariari, any input on that? I remember that I added it in response to a bug report you opened...

Well I personally don't like the solution that was implemented, as it means that in some WM's when you go out of the buffer it will make the window the normal size (namely stump). The issue in the past was that it would get stuck in fullscreen even if the WM would try to undo the fullscreen effect, meaning you would get stuck in the fullscreen mode. The only way out was to realize that nyxt had a fullscreen command. I often triggered this when watching videos. When one can press fullscreen on say an mp4 file, then deletes the buffer after watching, nyxt became unresponsive to commands from the WM to make it not fullscreen. The only solution is running M-x toggle-fullscreen which may not be known nor obvious to the user.

Ideally if the WM sends in a message to fullscreen or unfullscreen it'll contort to the requested behavior. It is thus good to remove this behavior, however I do worry that the old bug will resurface. A proper solution would be nice

mariari avatar Jun 15 '22 13:06 mariari

Hej, just mentioning that this is still a thing in nyxt-3pre2, using xfce. The steps to reproduce the issue are about the same as those originally descibed, but I'll add another case to the list: quickly switching between buffers using C-x C-left/right causes the un-fullscreen to happen as well.

Have a good day :)

hapst3r avatar Sep 20 '22 06:09 hapst3r

Any idea @aartaka?

aadcg avatar Sep 20 '22 07:09 aadcg

Well, switching buffers causes the same focus-out event, I guess—we switch/re-focus between widgets, after all.

aartaka avatar Sep 20 '22 07:09 aartaka

May we remove the offending code from nyxt? I've removed it locally and have been using it just fine without issues, fullscreening videos (in fullscreen mode) works as well, in both sway and river wm's.

shaunsingh avatar Mar 01 '23 11:03 shaunsingh

May we remove the offending code from nyxt? I've removed it locally and have been using it just fine without issues, fullscreening videos (in fullscreen mode) works as well, in both sway and river wm's.

I'm not sure which exactly piece of code you're talking about, but if you've pinned it, then we can discuss it in a PR ;)

aartaka avatar Mar 01 '23 12:03 aartaka

I believe this is the code in question:

(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)

jmercouris avatar Mar 01 '23 17:03 jmercouris

I also would like to remove it, it causes me many problems...

jmercouris avatar Mar 01 '23 18:03 jmercouris

I'll whip up a PR

shaunsingh avatar Mar 01 '23 18:03 shaunsingh

I believe this and https://github.com/atlas-engineer/nyxt/issues/1715 can be closed now

shaunsingh avatar Apr 09 '23 22:04 shaunsingh

Indeed!

jmercouris avatar Apr 10 '23 01:04 jmercouris