atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.88k stars 413 forks source link

Foreign interface of `ffi-window-fullscreen` and `ffi-window-maximize` #3439

Open aadcg opened 3 months ago

aadcg commented 3 months ago

In the context of #3435, I noticed that ffi-window-{un,}maximize could be greatly simplified. Instead of defining two generics, there could be a single one that gets the maximized state of the window and a setf method that mutates it.

The same reasoning holds for ffi-window-fullscreen.

To get the fullscreen state:

(gdk:gdk-window-get-state (gtk:gtk-widget-window (nyxt/renderer/gtk::gtk-object window)))

To get the maximized state (either as above or):

(gtk:gtk-window-is-maximized (nyxt/renderer/gtk::gtk-object window))

aadcg commented 3 months ago

I believe this will greatly simplify the architecture. I find it extremely odd that this strategy wasn't taken from day 1.