]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.backend.x11, implement (fullscreen?)
authorJon Harper <jon.harper87@gmail.com>
Sun, 19 Nov 2017 16:01:56 +0000 (17:01 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 19 Nov 2017 21:24:40 +0000 (13:24 -0800)
basis/ui/backend/x11/x11.factor

index 4a85b42a422f455df36b3405cb4ceaf04490e3fb..d8bc60730815d91a972b1320c3288325b7f0ee7b 100644 (file)
@@ -28,12 +28,12 @@ CONSTANT: _NET_WM_STATE_TOGGLE 2
 : XA_NET_WM_STATE_FULLSCREEN ( -- atom ) "_NET_WM_STATE_FULLSCREEN" x-atom ;
 : XA_NET_ACTIVE_WINDOW ( -- atom ) "_NET_ACTIVE_WINDOW" x-atom ;
 
-: supported-net-wm-hints ( -- seq )
+:: get-atom-properties ( window name -- seq )
     { Atom int ulong ulong pointer: Atom }
     [| type format n-atoms bytes-after atoms |
         dpy get
-        root get
-        XA_NET_SUPPORTED
+        window
+        name
         0
         ulong c-type-interval nip
         0
@@ -52,6 +52,9 @@ CONSTANT: _NET_WM_STATE_TOGGLE 2
         atoms XFree
     ] call ;
 
+: supported-net-wm-hints ( -- seq )
+    root get XA_NET_SUPPORTED get-atom-properties ;
+
 : net-wm-hint-supported? ( atom -- ? )
     supported-net-wm-hints member? ;
 
@@ -271,6 +274,10 @@ M: x11-ui-backend set-title ( string world -- )
 M: x11-ui-backend (set-fullscreen) ( world ? -- )
     [ handle>> window>> ] dip make-fullscreen-msg send-event ;
 
+M: x11-ui-backend (fullscreen?) ( world -- ? )
+    handle>> window>> XA_NET_WM_STATE get-atom-properties
+    XA_NET_WM_STATE_FULLSCREEN swap member? ;
+
 M: x11-ui-backend (open-window) ( world -- )
     dup gadget-window handle>> window>>
     [ set-closable ]