From: Abhishek Kulkarni <abbyzcool@gmail.com>
To: 9fans@9fans.net
Subject: [9fans] 9vx: ...and if you love plan9 more than your x86 host
Date: Mon, 30 Jun 2008 16:13:33 +0000 [thread overview]
Message-ID: <ba892019-cdb8-4979-8311-77e3910f5f21@l28g2000prd.googlegroups.com> (raw)
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);
next reply other threads:[~2008-06-30 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 16:13 Abhishek Kulkarni [this message]
2008-06-30 17:37 ` Russ Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba892019-cdb8-4979-8311-77e3910f5f21@l28g2000prd.googlegroups.com \
--to=abbyzcool@gmail.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).