ui.backend.x11, implement (fullscreen?)

factor-shell
Jon Harper 2017-11-19 17:01:56 +01:00 committed by John Benediktsson
parent d2f3977768
commit 2a2aa7f915
1 changed files with 10 additions and 3 deletions

View 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 ]