9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 9vx: ...and if you love plan9 more than your x86 host
@ 2008-06-30 16:13 Abhishek Kulkarni
  2008-06-30 17:37 ` Russ Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Abhishek Kulkarni @ 2008-06-30 16:13 UTC (permalink / raw)
  To: 9fans

It's more fun to use 9vx in the fullscreen mode to get a complete
Plan9 experience.

Press <F11> to toggle fullscreen mode.
Patch attached.

Thanks for 9vx. It makes things a lot easier :)

 -- Abhishek

diff -r 9007574b0ca2 src/9vx/x11/x11-kernel.c
--- a/src/9vx/x11/x11-kernel.c  Sun Jun 29 22:24:21 2008 -0400
+++ b/src/9vx/x11/x11-kernel.c  Mon Jun 30 10:04:59 2008 -0600
@@ -26,6 +26,14 @@ Rectangle windowrect;
 Rectangle windowrect;
 Rectangle screenrect;
 int fullscreen;
+
+enum
+{
+  _NET_WM_STATE_REMOVE =0,
+  _NET_WM_STATE_ADD = 1,
+  _NET_WM_STATE_TOGGLE =2
+
+};

 /*
  * Handle an incoming X event.
@@ -86,7 +94,24 @@ runxevent(XEvent *xev)
                XLookupString((XKeyEvent*)xev, NULL, 0, &k, NULL);
                if(k == XK_F11){
                        fullscreen = !fullscreen;
-               //TODO  _xmovewindow(fullscreen ? screenrect :
windowrect);
+               //TODO  _xmovewindow(fullscreen ? screenrect :
windowrect);
+
+                       Atom windowState = XInternAtom(_x.display,
"_NET_WM_STATE", False);
+                       Atom fullScreen =
XInternAtom(_x.display,"_NET_WM_STATE_FULLSCREEN", False);
+
+                       XEvent fscrev;
+                       fscrev.xclient.type=ClientMessage;
+                       fscrev.xclient.serial = 0;
+                       fscrev.xclient.send_event=True;
+                       fscrev.xclient.window=_x.drawable;
+                       fscrev.xclient.message_type=windowState;
+                       fscrev.xclient.format=32;
+                       fscrev.xclient.data.l[0] = (fullscreen ?
_NET_WM_STATE_ADD :_NET_WM_STATE_REMOVE);
+                       fscrev.xclient.data.l[1] = fullScreen;
+                       fscrev.xclient.data.l[2] = 0;
+
+                       XSendEvent(_x.display,
DefaultRootWindow(_x.display), False,
+                               SubstructureRedirectMask |
SubstructureNotifyMask,&fscrev);
                        return;
                }
                _xtoplan9kbd(xev);



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-30 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-30 16:13 [9fans] 9vx: ...and if you love plan9 more than your x86 host Abhishek Kulkarni
2008-06-30 17:37 ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).