diff --git a/basis/ui/backend/x11/x11.factor b/basis/ui/backend/x11/x11.factor index 65f45e2927..ac0ce79821 100644 --- a/basis/ui/backend/x11/x11.factor +++ b/basis/ui/backend/x11/x11.factor @@ -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 ] diff --git a/basis/ui/render/render.factor b/basis/ui/render/render.factor index 33c1f812bb..f77a4e5582 100644 --- a/basis/ui/render/render.factor +++ b/basis/ui/render/render.factor @@ -33,13 +33,13 @@ SLOT: background-color check-extensions "1.0" require-gl-version GL_SMOOTH glShadeModel GL_BLEND glEnable - GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc GL_VERTEX_ARRAY glEnableClientState GL_PACK_ALIGNMENT 1 glPixelStorei GL_UNPACK_ALIGNMENT 1 glPixelStorei ; : gl-draw-init ( world -- ) GL_SCISSOR_TEST glEnable + GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA glBlendFunc init-matrices [ init-clip ] [ diff --git a/extra/gopher/ui/ui.factor b/extra/gopher/ui/ui.factor index f60ad7e245..3e33a92853 100644 --- a/extra/gopher/ui/ui.factor +++ b/extra/gopher/ui/ui.factor @@ -6,7 +6,7 @@ kernel math.vectors models present sequences ui ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.toolbar ui.gadgets.tracks ui.gadgets.viewports ui.gestures ui.operations ui.tools.browser -ui.tools.browser.history ui.tools.common urls ; +ui.tools.browser.history ui.tools.common urls webbrowser ; IN: gopher.ui @@ -29,12 +29,14 @@ M: gopher-gadget model-changed : show-gopher ( url gopher-gadget -- ) [ [ >url ] [ f ] if* ] dip - [ - 2dup control-value = - [ 2drop ] [ nip history>> add-history ] if - ] - [ set-control-value ] - 2bi ; + over [ protocol>> "gopher" = ] [ t ] if* [ + [ + 2dup control-value = + [ 2drop ] [ nip history>> add-history ] if + ] + [ set-control-value ] + 2bi + ] [ drop open-url ] if ; : ( gopher-gadget -- field ) '[ >url _ show-gopher ]