From af11e1673b4057b9b9b81900ba9ab9a1d0fd058b Mon Sep 17 00:00:00 2001 From: Matthew Willis Date: Mon, 11 Feb 2008 22:52:02 -0800 Subject: [PATCH 1/2] Implemented the set-fullscreen* hook for the x11 backend. I doubt that fullscreen* can be implemented for x11, so it might need to be removed or always return f. --- extra/ui/x11/x11.factor | 13 +++++++++++++ extra/x11/constants/constants.factor | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/extra/ui/x11/x11.factor b/extra/ui/x11/x11.factor index 62944500ef..6a0560cb28 100755 --- a/extra/ui/x11/x11.factor +++ b/extra/ui/x11/x11.factor @@ -217,6 +217,19 @@ M: x-clipboard paste-clipboard M: x11-ui-backend set-title ( string world -- ) world-handle x11-handle-window swap dpy get -rot 3dup set-title-old set-title-new ; + +M: x11-ui-backend set-fullscreen* ( ? world -- ) + world-handle x11-handle-window "XClientMessageEvent" + tuck set-XClientMessageEvent-window + swap _NET_WM_STATE_ADD _NET_WM_STATE_REMOVE ? + over set-XClientMessageEvent-data0 + ClientMessage over set-XClientMessageEvent-type + dpy get over set-XClientMessageEvent-display + "_NET_WM_STATE" x-atom over set-XClientMessageEvent-message_type + 32 over set-XClientMessageEvent-format + "_NET_WM_STATE_FULLSCREEN" x-atom over set-XClientMessageEvent-data1 + >r dpy get root get 0 SubstructureNotifyMask r> XSendEvent drop ; + M: x11-ui-backend (open-window) ( world -- ) dup gadget-window diff --git a/extra/x11/constants/constants.factor b/extra/x11/constants/constants.factor index 367f40cebd..5781fdc806 100644 --- a/extra/x11/constants/constants.factor +++ b/extra/x11/constants/constants.factor @@ -402,3 +402,8 @@ TYPEDEF: uchar KeyCode : LSBFirst 0 ; : MSBFirst 1 ; +! ***************************************************************** +! * EXTENDED WINDOW MANAGER HINTS +! ***************************************************************** + +C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ; \ No newline at end of file From 0210823dfcdaa0874097ccdfe41d2510051e0a03 Mon Sep 17 00:00:00 2001 From: Matthew Willis Date: Mon, 11 Feb 2008 23:01:49 -0800 Subject: [PATCH 2/2] forgot to add alien.c-types to USING: --- extra/ui/x11/x11.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/ui/x11/x11.factor b/extra/ui/x11/x11.factor index 6a0560cb28..e4794452c7 100755 --- a/extra/ui/x11/x11.factor +++ b/extra/ui/x11/x11.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2005, 2007 Eduardo Cavazos and Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: alien arrays ui ui.gadgets ui.gestures ui.backend +USING: alien alien.c-types arrays ui ui.gadgets ui.gestures ui.backend ui.clipboards ui.gadgets.worlds assocs kernel math namespaces opengl sequences strings x11.xlib x11.events x11.xim x11.glx x11.clipboard x11.constants x11.windows io.utf8 combinators