Jelmerro / Vieb

Vim Inspired Electron Browser - Vim bindings for the web by design
https://vieb.dev
GNU General Public License v3.0
1.29k stars 61 forks source link

Support Linux OS fullscreen for `guifullscreen` settings #507

Closed TheSast closed 10 months ago

TheSast commented 11 months ago

Checklist

Addition or change Detect fullscreen set by the wayland compositor and have it work in Vieb as if fullscreen was triggered by action.toggleFullscreen, thus triggering the different behaviours for guifullscreennavbar and guifullscreentabbar.

Jelmerro commented 10 months ago

This is actually not wayland specific, since I could reproduce it on Cinnamon (which uses X). There is actually no way to detect this type of fullscreen within Electron (and via commands would require a separate implementation per DE/WM), so instead I'll be adding a check for if the window size is exactly the same size as the screen size, without being maximized, which should realistically only happen during this special OS fullscreen. One gotcha is that this will also trigger if one were to resize the window to exactly the size of the screen, but I don't really see that as a problem personally, since you would really only do that if you wanted fullscreen anyway, or just use maximize or proper fullscreen most of the time. This commit implements this behavior.

Another option which might or might not work depending on how the system handles shortcuts, is that you could add a mapping to Vieb with the same shortcut as the OS fullscreen, in my case something like this: map <A-F12> <toggleFullscreen> Though this should not be needed with the commit above in place, as that should account for this scenario. If you could be so kind to run Vieb from source to try this out, instructions are in the main readme under Building. Do let me know if you need help with this or have any further questions.

TheSast commented 10 months ago

I'll close this since the implemented behavior does resolve the issue. It was tested successfully and the feedback and replies to it can be found on Matrix. I thank you again Jelmerro.