add OPACITY, TRANSPARENTLIST config macros; add clang-format back to build script; update docs
This commit is contained in:
parent
b23f229ca5
commit
496da4fe6e
15 changed files with 414 additions and 262 deletions
|
@ -39,6 +39,7 @@ The primary additions I've made are:
|
||||||
- Other new features customizable by `config.h`:
|
- Other new features customizable by `config.h`:
|
||||||
+ Show/hide 'Stick' Button3 menuitem
|
+ Show/hide 'Stick' Button3 menuitem
|
||||||
+ `AUTOSTICK` list of windows to spawn sticky by default and not focus (pseudo-panel/dock windows)
|
+ `AUTOSTICK` list of windows to spawn sticky by default and not focus (pseudo-panel/dock windows)
|
||||||
|
+ `TRANSPARENTLIST` of window classes to be rendered with partial transparency (and corresponding OPACITY setting)
|
||||||
+ Optionally notify with `notify-send` which desktop is switched to (I use it with `dunst`)
|
+ Optionally notify with `notify-send` which desktop is switched to (I use it with `dunst`)
|
||||||
+ Gaps for pseudo-tiling
|
+ Gaps for pseudo-tiling
|
||||||
+ Option to swap the keyboard shortcuts between "Snap Big Center" and "Snap Floating Center" (and the preferred behavior for terminals launched by keyboard)
|
+ Option to swap the keyboard shortcuts between "Snap Big Center" and "Snap Floating Center" (and the preferred behavior for terminals launched by keyboard)
|
||||||
|
@ -61,7 +62,9 @@ to point to the proper location of your plan9port's `mkwsysrules.sh`.
|
||||||
|
|
||||||
### Bugs and Caveats
|
### Bugs and Caveats
|
||||||
Of the bugs and caveats not already mentioned in Rio's readme:
|
Of the bugs and caveats not already mentioned in Rio's readme:
|
||||||
- Rendering of windows with RGBA surfaces is bound to RGB space (xshove and transset can be leveraged to get transparent terminals if you want it)
|
|
||||||
|
- Rendering of windows with RGBA surfaces is bound to RGB space (ie, transparency cannot be set on a per-pixel level beyond a binary resolution)
|
||||||
|
- Switching back and forth between virtual desktops very quickly can cause some windows to glitch out, lose their parent, and become unfocusable (doesn't happen if switching just in one direction).
|
||||||
- Multimonitor setups are treated like one giant monitor. This is on the short list.
|
- Multimonitor setups are treated like one giant monitor. This is on the short list.
|
||||||
- Some applications that render fullscreen or dedicated OSD windows (Virtualbox, Zoom, etc) will need to be manually maximized to fix their alignment (in the former case) or otherwise misbehave.
|
- Some applications that render fullscreen or dedicated OSD windows (Virtualbox, Zoom, etc) will need to be manually maximized to fix their alignment (in the former case) or otherwise misbehave.
|
||||||
- Probably more!
|
- Probably more!
|
||||||
|
|
2
build.sh
2
build.sh
|
@ -4,6 +4,8 @@ if [ ! -e config.h ]; then
|
||||||
cp config.def.h config.h
|
cp config.def.h config.h
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
clang-format -i ./*.c ./*.h ./*/*.c ./*/*.h
|
||||||
|
|
||||||
mk clean
|
mk clean
|
||||||
mk o.rio
|
mk o.rio
|
||||||
|
|
||||||
|
|
41
client.c
41
client.c
|
@ -337,6 +337,47 @@ int isautostick(Client* c) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ALWAYSDRAW
|
||||||
|
int shouldalwaysdraw(Client* c) {
|
||||||
|
static char* alwaysdraw[] = ALWAYSDRAW;
|
||||||
|
char** a = alwaysdraw;
|
||||||
|
|
||||||
|
while (*a) {
|
||||||
|
if (c && c->class && strstr(c->class, *a)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
++a;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int isterminalwindow(Client* c) {
|
||||||
|
static char* termnames[] = TERMINALS;
|
||||||
|
char** t = termnames;
|
||||||
|
|
||||||
|
while (*t) {
|
||||||
|
if (c && c->class && strstr(c->class, *t)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
++t;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int istransparent(Client* c) {
|
||||||
|
static char* transnames[] = TRANSPARENTLIST;
|
||||||
|
char** t = transnames;
|
||||||
|
|
||||||
|
while (*t) {
|
||||||
|
if (c && c->class && strstr(c->class, *t)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
++t;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void ensureactive() {
|
void ensureactive() {
|
||||||
if (!current)
|
if (!current)
|
||||||
shuffle(0);
|
shuffle(0);
|
||||||
|
|
18
config.def.h
18
config.def.h
|
@ -37,8 +37,26 @@
|
||||||
#define SMENUFGCOL 0x000000
|
#define SMENUFGCOL 0x000000
|
||||||
#define SMENUBGCOL 0x1F9B92
|
#define SMENUBGCOL 0x1F9B92
|
||||||
|
|
||||||
|
/* You must use a compositor (eg xcompmgr, picom) for the next 2 settings
|
||||||
|
* to have any effect!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* From 0 - 255, the opacity of windows marked 'transparent' */
|
||||||
|
|
||||||
|
#define OPACITY 217
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
|
/* Window classes marked 'transparent' */
|
||||||
|
|
||||||
|
#define TRANSPARENTLIST { \
|
||||||
|
"Alacritty", \
|
||||||
|
"kate", \
|
||||||
|
"acme", \
|
||||||
|
0 \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* List of fonts to try, in order, for rendering the menus.
|
/* List of fonts to try, in order, for rendering the menus.
|
||||||
* Remember the backslash at the end of non-terminating lines!
|
* Remember the backslash at the end of non-terminating lines!
|
||||||
*/
|
*/
|
||||||
|
|
6
dat.h
6
dat.h
|
@ -6,16 +6,16 @@
|
||||||
#define CORNER _corner
|
#define CORNER _corner
|
||||||
#define INSET _inset
|
#define INSET _inset
|
||||||
#define MAXHIDDEN 128
|
#define MAXHIDDEN 128
|
||||||
#if defined (SHOWMAX) && defined (SHOWSTICK)
|
#if defined(SHOWMAX) && defined(SHOWSTICK)
|
||||||
#define B3FIXED 7
|
#define B3FIXED 7
|
||||||
#elif defined (SHOWMAX) || defined (SHOWSTICK)
|
#elif defined(SHOWMAX) || defined(SHOWSTICK)
|
||||||
#define B3FIXED 6
|
#define B3FIXED 6
|
||||||
#else
|
#else
|
||||||
#define B3FIXED 5
|
#define B3FIXED 5
|
||||||
#endif
|
#endif
|
||||||
#define NUMVIRTUALS 12
|
#define NUMVIRTUALS 12
|
||||||
|
|
||||||
#define AllButtonMask \
|
#define AllButtonMask \
|
||||||
(Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)
|
(Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)
|
||||||
#define ButtonMask (ButtonPressMask | ButtonReleaseMask)
|
#define ButtonMask (ButtonPressMask | ButtonReleaseMask)
|
||||||
#define MenuMask (ButtonMask | ButtonMotionMask | ExposureMask)
|
#define MenuMask (ButtonMask | ButtonMotionMask | ExposureMask)
|
||||||
|
|
26
event.c
26
event.c
|
@ -283,6 +283,30 @@ void newwindow(XCreateWindowEvent* e) {
|
||||||
if (c->parent == None)
|
if (c->parent == None)
|
||||||
c->parent = c->screen->root;
|
c->parent = c->screen->root;
|
||||||
}
|
}
|
||||||
|
if (istransparent(c)) {
|
||||||
|
/* We need to set the atom on both the window and its parent */
|
||||||
|
const Atom alpha_atom = XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", 0);
|
||||||
|
unsigned long opacity = (unsigned long)OPACITY * 0x1010101;
|
||||||
|
XChangeProperty(
|
||||||
|
dpy,
|
||||||
|
c->window,
|
||||||
|
alpha_atom,
|
||||||
|
XA_CARDINAL,
|
||||||
|
32,
|
||||||
|
PropModeReplace,
|
||||||
|
(unsigned char*)&opacity,
|
||||||
|
1);
|
||||||
|
XChangeProperty(
|
||||||
|
dpy,
|
||||||
|
c->parent,
|
||||||
|
alpha_atom,
|
||||||
|
XA_CARDINAL,
|
||||||
|
32,
|
||||||
|
PropModeReplace,
|
||||||
|
(unsigned char*)&opacity,
|
||||||
|
1);
|
||||||
|
}
|
||||||
|
|
||||||
if (kbLaunch) {
|
if (kbLaunch) {
|
||||||
usleep(100000);
|
usleep(100000);
|
||||||
#ifdef CENTERVMAX
|
#ifdef CENTERVMAX
|
||||||
|
@ -529,7 +553,7 @@ void focusin(XFocusChangeEvent* e) {
|
||||||
c = getclient(e->window, 0);
|
c = getclient(e->window, 0);
|
||||||
if (c != 0 && c->window == e->window && c != current) {
|
if (c != 0 && c->window == e->window && c != current) {
|
||||||
#ifdef AUTOSTICK
|
#ifdef AUTOSTICK
|
||||||
if (isautostick(c)) {
|
if (!isautostick(c)) {
|
||||||
#endif
|
#endif
|
||||||
/* someone grabbed keyboard or seized focus; make them current */
|
/* someone grabbed keyboard or seized focus; make them current */
|
||||||
XMapRaised(dpy, c->parent);
|
XMapRaised(dpy, c->parent);
|
||||||
|
|
9
fns.h
9
fns.h
|
@ -9,8 +9,8 @@
|
||||||
#define setstate setstaterio
|
#define setstate setstaterio
|
||||||
|
|
||||||
/* color.c */
|
/* color.c */
|
||||||
unsigned long
|
unsigned long colorpixel(
|
||||||
colorpixel(Display*, ScreenInfo*, int, unsigned long, unsigned long);
|
Display*, ScreenInfo*, int, unsigned long, unsigned long);
|
||||||
|
|
||||||
/* main.c */
|
/* main.c */
|
||||||
void usage();
|
void usage();
|
||||||
|
@ -60,8 +60,6 @@ void setstate();
|
||||||
void setlabel();
|
void setlabel();
|
||||||
void getproto();
|
void getproto();
|
||||||
void gettrans();
|
void gettrans();
|
||||||
int shouldalwaysdraw(Client* c);
|
|
||||||
int isterminalwindow(Client* c);
|
|
||||||
|
|
||||||
/* key.c */
|
/* key.c */
|
||||||
void keypress();
|
void keypress();
|
||||||
|
@ -99,6 +97,9 @@ void dump_revert();
|
||||||
void dump_clients();
|
void dump_clients();
|
||||||
void shuffle(int);
|
void shuffle(int);
|
||||||
int isautostick(Client* c);
|
int isautostick(Client* c);
|
||||||
|
int istransparent(Client* c);
|
||||||
|
int shouldalwaysdraw(Client* c);
|
||||||
|
int isterminalwindow(Client* c);
|
||||||
void ensureactive();
|
void ensureactive();
|
||||||
|
|
||||||
/* grab.c */
|
/* grab.c */
|
||||||
|
|
|
@ -22,7 +22,7 @@ else
|
||||||
chmod a+x ${PLAN9}/bin/ryudo
|
chmod a+x ${PLAN9}/bin/ryudo
|
||||||
|
|
||||||
echo "ryudo has been installed to '${PLAN9}/bin/';"
|
echo "ryudo has been installed to '${PLAN9}/bin/';"
|
||||||
echo "xsession has been installed to '/usr/share/xsessions';"
|
echo "xsession has been installed to '/usr/share/xsessions/';"
|
||||||
echo "startryudo script has been installed to '/usr/bin/';"
|
echo "startryudo script has been installed to '/usr/bin/';"
|
||||||
echo "The manual pages have been installed to '${PLAN9}/man/'"
|
echo "The manual pages have been installed to '${PLAN9}/man/'"
|
||||||
fi
|
fi
|
||||||
|
|
8
main.c
8
main.c
|
@ -224,14 +224,14 @@ int main(int argc, char* argv[]) {
|
||||||
for (i = 0; i < num_screens; i++)
|
for (i = 0; i < num_screens; i++)
|
||||||
scanwins(&screens[i]);
|
scanwins(&screens[i]);
|
||||||
|
|
||||||
#ifdef VIRTNOTIFY
|
#ifdef VIRTNOTIFY
|
||||||
notify_init("ryudo");
|
notify_init("ryudo");
|
||||||
#endif
|
#endif
|
||||||
keysetup();
|
keysetup();
|
||||||
mainloop(shape_event);
|
mainloop(shape_event);
|
||||||
#ifdef VIRTNOTIFY
|
#ifdef VIRTNOTIFY
|
||||||
notify_uninit();
|
notify_uninit();
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
28
manage.c
28
manage.c
|
@ -546,31 +546,3 @@ void getproto(Client* c) {
|
||||||
|
|
||||||
XFree((char*)p);
|
XFree((char*)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ALWAYSDRAW
|
|
||||||
int shouldalwaysdraw(Client* c) {
|
|
||||||
static char* alwaysdraw[] = ALWAYSDRAW;
|
|
||||||
char** a = alwaysdraw;
|
|
||||||
|
|
||||||
while (*a) {
|
|
||||||
if (c && c->class && strstr(c->class, *a)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
++a;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int isterminalwindow(Client* c) {
|
|
||||||
static char* termnames[] = TERMINALS;
|
|
||||||
char** t = termnames;
|
|
||||||
|
|
||||||
while (*t) {
|
|
||||||
if (c && c->class && strstr(c->class, *t)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
++t;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
33
menu.c
33
menu.c
|
@ -156,8 +156,7 @@ void button(XButtonEvent* e) {
|
||||||
break;
|
break;
|
||||||
case Button4:
|
case Button4:
|
||||||
/* scroll up changes to previous virtual screen, wraps around */
|
/* scroll up changes to previous virtual screen, wraps around */
|
||||||
if (!c && e->type == ButtonPress)
|
if (!c && e->type == ButtonPress) {
|
||||||
{
|
|
||||||
if (numvirtuals > 1) {
|
if (numvirtuals > 1) {
|
||||||
if (virt > 0) {
|
if (virt > 0) {
|
||||||
switch_to(virt - 1);
|
switch_to(virt - 1);
|
||||||
|
@ -470,10 +469,8 @@ void switch_to_c(int n, Client* c) {
|
||||||
void switch_to(int n) {
|
void switch_to(int n) {
|
||||||
#ifdef VIRTNOTIFY
|
#ifdef VIRTNOTIFY
|
||||||
static char virtmsg[32];
|
static char virtmsg[32];
|
||||||
NotifyNotification* notification = notify_notification_new(
|
NotifyNotification* notification =
|
||||||
VIRTHEADER,
|
notify_notification_new(VIRTHEADER, NULL, NULL);
|
||||||
NULL,
|
|
||||||
NULL);
|
|
||||||
#endif
|
#endif
|
||||||
if (n == virt)
|
if (n == virt)
|
||||||
return;
|
return;
|
||||||
|
@ -491,32 +488,10 @@ void switch_to(int n) {
|
||||||
top(current);
|
top(current);
|
||||||
#ifdef VIRTNOTIFY
|
#ifdef VIRTNOTIFY
|
||||||
sprintf(virtmsg, VIRTMSG, b2items[virt]);
|
sprintf(virtmsg, VIRTMSG, b2items[virt]);
|
||||||
notify_notification_update(notification,
|
notify_notification_update(notification, VIRTHEADER, virtmsg, NULL);
|
||||||
VIRTHEADER,
|
|
||||||
virtmsg,
|
|
||||||
NULL);
|
|
||||||
notify_notification_set_category(notification, "virtual");
|
notify_notification_set_category(notification, "virtual");
|
||||||
notify_notification_show(notification, NULL);
|
notify_notification_show(notification, NULL);
|
||||||
notify_notification_close(notification, NULL);
|
notify_notification_close(notification, NULL);
|
||||||
/* if (fork() == 0) {
|
|
||||||
if (fork() == 0) {
|
|
||||||
close(ConnectionNumber(dpy));
|
|
||||||
if (dpy != '\0')
|
|
||||||
putenv(dpy);
|
|
||||||
signal(SIGINT, SIG_DFL);
|
|
||||||
signal(SIGTERM, SIG_DFL);
|
|
||||||
signal(SIGHUP, SIG_DFL);
|
|
||||||
sprintf(virtmsg, VIRTMSG, b2items[virt]);
|
|
||||||
execlp(
|
|
||||||
"notify-send",
|
|
||||||
"notify-send",
|
|
||||||
"-c",
|
|
||||||
"virtual",
|
|
||||||
VIRTHEADER,
|
|
||||||
virtmsg,
|
|
||||||
(char*)0);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
ryudo.1
4
ryudo.1
|
@ -149,7 +149,7 @@ Multimonitor output is not currently supported \-\- the whole "screen" (collecti
|
||||||
Click events don\'t pass through when clicking to activate a window\.
|
Click events don\'t pass through when clicking to activate a window\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Clicking mouse button 3 on an inactive window brings up the Button 3 Menu instead of focusing the window\. I personally sometimes find this behavior useful\.
|
Clicking mouse button 2/3 on an inactive window brings up the Button 2/3 Menu instead of focusing the window\. I personally sometimes find this behavior useful\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at\. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so\.
|
Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at\. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so\.
|
||||||
|
@ -158,7 +158,7 @@ Programs that expect to run fullscreen will probably just open in a window the s
|
||||||
Fullscreen Virtualbox VM windows are a strange outlier and start with their graphics offset\. Maximize the window after opening and it should be good\.
|
Fullscreen Virtualbox VM windows are a strange outlier and start with their graphics offset\. Maximize the window after opening and it should be good\.
|
||||||
.
|
.
|
||||||
.P
|
.P
|
||||||
There is no native support for compositing, but included is a shell script (\fBtranssetter\.sh\fR) which I use for translucent terminal and editor windows\. It works well and is decently lightweight\.
|
While there is naitive support for per\-window opacity via the \fBOPACITY\fR and \fBTRANSPARENTLIST\fR configuration macros, there is no support for per\-pixel opacity\. Programs that expect this behavior will render all pixels at the same opacity (unless using the \fBXSHAPE\fR extension for boolean opacity per\-pixel (eg, \fBxeyes\fR), which works\.)
|
||||||
.
|
.
|
||||||
.SH "AUTHORS"
|
.SH "AUTHORS"
|
||||||
.
|
.
|
||||||
|
|
|
@ -162,19 +162,19 @@
|
||||||
|
|
||||||
<p>Click events don't pass through when clicking to activate a window.</p>
|
<p>Click events don't pass through when clicking to activate a window.</p>
|
||||||
|
|
||||||
<p>Clicking mouse button 3 on an inactive window brings up the Button 3 Menu instead of focusing the window. I personally sometimes find this behavior useful.</p>
|
<p>Clicking mouse button 2/3 on an inactive window brings up the Button 2/3 Menu instead of focusing the window. I personally sometimes find this behavior useful.</p>
|
||||||
|
|
||||||
<p>Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so.</p>
|
<p>Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so.</p>
|
||||||
|
|
||||||
<p>Fullscreen Virtualbox VM windows are a strange outlier and start with their graphics offset. Maximize the window after opening and it should be good.</p>
|
<p>Fullscreen Virtualbox VM windows are a strange outlier and start with their graphics offset. Maximize the window after opening and it should be good.</p>
|
||||||
|
|
||||||
<p>There is no native support for compositing, but included is a shell script (<code>transsetter.sh</code>) which I use for translucent terminal and editor windows. It works well and is decently lightweight.</p>
|
<p>While there is naitive support for per-window opacity via the <code>OPACITY</code> and <code>TRANSPARENTLIST</code> configuration macros, there is no support for per-pixel opacity. Programs that expect this behavior will render all pixels at the same opacity (unless using the <code>XSHAPE</code> extension for boolean opacity per-pixel (eg, <code>xeyes</code>), which works.)</p>
|
||||||
|
|
||||||
<h2 id="AUTHORS">AUTHORS</h2>
|
<h2 id="AUTHORS">AUTHORS</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Derek Stevens <a href="mailto:nilix@nilfm.cc" data-bare-link="true">nilix@nilfm.cc</a></li>
|
<li>Derek Stevens <a href="mailto:nilix@nilfm.cc" data-bare-link="true">nilix@nilfm.cc</a></li>
|
||||||
<li>Russ Cox <a href="mailto:rsc@swtch.com" data-bare-link="true">rsc@swtch.com</a></li>
|
<li>Russ Cox <a href="mailto:rsc@swtch.com" data-bare-link="true">rsc@swtch.com</a></li>
|
||||||
<li>David Hogan, RIP</li>
|
<li>David Hogan, RIP</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
|
@ -83,13 +83,13 @@ Multimonitor output is not currently supported -- the whole "screen" (collection
|
||||||
|
|
||||||
Click events don't pass through when clicking to activate a window.
|
Click events don't pass through when clicking to activate a window.
|
||||||
|
|
||||||
Clicking mouse button 3 on an inactive window brings up the Button 3 Menu instead of focusing the window. I personally sometimes find this behavior useful.
|
Clicking mouse button 2/3 on an inactive window brings up the Button 2/3 Menu instead of focusing the window. I personally sometimes find this behavior useful.
|
||||||
|
|
||||||
Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so.
|
Programs that expect to run fullscreen will probably just open in a window the size of whatever resolution they expect to run at. Depending on the implementation, they may respond well to being maximized or you may have to change your screen resolution manually before doing so.
|
||||||
|
|
||||||
Fullscreen Virtualbox VM windows are a strange outlier and start with their graphics offset. Maximize the window after opening and it should be good.
|
Fullscreen Virtualbox VM windows are a strange outlier and start with their graphics offset. Maximize the window after opening and it should be good.
|
||||||
|
|
||||||
There is no native support for compositing, but included is a shell script (`transsetter.sh`) which I use for translucent terminal and editor windows. It works well and is decently lightweight.
|
While there is naitive support for per-window opacity via the `OPACITY` and `TRANSPARENTLIST` configuration macros, there is no support for per-pixel opacity. Programs that expect this behavior will render all pixels at the same opacity (unless using the `XSHAPE` extension for boolean opacity per-pixel (eg, `xeyes`), which works.)
|
||||||
|
|
||||||
## AUTHORS
|
## AUTHORS
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,14 @@ static char* sep;
|
||||||
static char* TorF(bool) int bool;
|
static char* TorF(bool) int bool;
|
||||||
{
|
{
|
||||||
switch (bool) {
|
switch (bool) {
|
||||||
case True: return ("True");
|
case True:
|
||||||
|
return ("True");
|
||||||
|
|
||||||
case False: return ("False");
|
case False:
|
||||||
|
return ("False");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,11 +27,14 @@ static char* TorF(bool) int bool;
|
||||||
static char* PropertyState(state) int state;
|
static char* PropertyState(state) int state;
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case PropertyNewValue: return ("PropertyNewValue");
|
case PropertyNewValue:
|
||||||
|
return ("PropertyNewValue");
|
||||||
|
|
||||||
case PropertyDelete: return ("PropertyDelete");
|
case PropertyDelete:
|
||||||
|
return ("PropertyDelete");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,13 +42,17 @@ static char* PropertyState(state) int state;
|
||||||
static char* VisibilityState(state) int state;
|
static char* VisibilityState(state) int state;
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case VisibilityUnobscured: return ("VisibilityUnobscured");
|
case VisibilityUnobscured:
|
||||||
|
return ("VisibilityUnobscured");
|
||||||
|
|
||||||
case VisibilityPartiallyObscured: return ("VisibilityPartiallyObscured");
|
case VisibilityPartiallyObscured:
|
||||||
|
return ("VisibilityPartiallyObscured");
|
||||||
|
|
||||||
case VisibilityFullyObscured: return ("VisibilityFullyObscured");
|
case VisibilityFullyObscured:
|
||||||
|
return ("VisibilityFullyObscured");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,11 +167,14 @@ static char* ConfigureValueMask(valuemask) unsigned int valuemask;
|
||||||
static char* IsHint(is_hint) char is_hint;
|
static char* IsHint(is_hint) char is_hint;
|
||||||
{
|
{
|
||||||
switch (is_hint) {
|
switch (is_hint) {
|
||||||
case NotifyNormal: return ("NotifyNormal");
|
case NotifyNormal:
|
||||||
|
return ("NotifyNormal");
|
||||||
|
|
||||||
case NotifyHint: return ("NotifyHint");
|
case NotifyHint:
|
||||||
|
return ("NotifyHint");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,11 +195,14 @@ static char* MaybeNone(value) int value;
|
||||||
static char* ColormapState(state) int state;
|
static char* ColormapState(state) int state;
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ColormapInstalled: return ("ColormapInstalled");
|
case ColormapInstalled:
|
||||||
|
return ("ColormapInstalled");
|
||||||
|
|
||||||
case ColormapUninstalled: return ("ColormapUninstalled");
|
case ColormapUninstalled:
|
||||||
|
return ("ColormapUninstalled");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,17 +210,23 @@ static char* ColormapState(state) int state;
|
||||||
static char* CrossingDetail(detail) int detail;
|
static char* CrossingDetail(detail) int detail;
|
||||||
{
|
{
|
||||||
switch (detail) {
|
switch (detail) {
|
||||||
case NotifyAncestor: return ("NotifyAncestor");
|
case NotifyAncestor:
|
||||||
|
return ("NotifyAncestor");
|
||||||
|
|
||||||
case NotifyInferior: return ("NotifyInferior");
|
case NotifyInferior:
|
||||||
|
return ("NotifyInferior");
|
||||||
|
|
||||||
case NotifyVirtual: return ("NotifyVirtual");
|
case NotifyVirtual:
|
||||||
|
return ("NotifyVirtual");
|
||||||
|
|
||||||
case NotifyNonlinear: return ("NotifyNonlinear");
|
case NotifyNonlinear:
|
||||||
|
return ("NotifyNonlinear");
|
||||||
|
|
||||||
case NotifyNonlinearVirtual: return ("NotifyNonlinearVirtual");
|
case NotifyNonlinearVirtual:
|
||||||
|
return ("NotifyNonlinearVirtual");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,23 +234,32 @@ static char* CrossingDetail(detail) int detail;
|
||||||
static char* FocusChangeDetail(detail) int detail;
|
static char* FocusChangeDetail(detail) int detail;
|
||||||
{
|
{
|
||||||
switch (detail) {
|
switch (detail) {
|
||||||
case NotifyAncestor: return ("NotifyAncestor");
|
case NotifyAncestor:
|
||||||
|
return ("NotifyAncestor");
|
||||||
|
|
||||||
case NotifyInferior: return ("NotifyInferior");
|
case NotifyInferior:
|
||||||
|
return ("NotifyInferior");
|
||||||
|
|
||||||
case NotifyVirtual: return ("NotifyVirtual");
|
case NotifyVirtual:
|
||||||
|
return ("NotifyVirtual");
|
||||||
|
|
||||||
case NotifyNonlinear: return ("NotifyNonlinear");
|
case NotifyNonlinear:
|
||||||
|
return ("NotifyNonlinear");
|
||||||
|
|
||||||
case NotifyNonlinearVirtual: return ("NotifyNonlinearVirtual");
|
case NotifyNonlinearVirtual:
|
||||||
|
return ("NotifyNonlinearVirtual");
|
||||||
|
|
||||||
case NotifyPointer: return ("NotifyPointer");
|
case NotifyPointer:
|
||||||
|
return ("NotifyPointer");
|
||||||
|
|
||||||
case NotifyPointerRoot: return ("NotifyPointerRoot");
|
case NotifyPointerRoot:
|
||||||
|
return ("NotifyPointerRoot");
|
||||||
|
|
||||||
case NotifyDetailNone: return ("NotifyDetailNone");
|
case NotifyDetailNone:
|
||||||
|
return ("NotifyDetailNone");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,17 +267,23 @@ static char* FocusChangeDetail(detail) int detail;
|
||||||
static char* ConfigureDetail(detail) int detail;
|
static char* ConfigureDetail(detail) int detail;
|
||||||
{
|
{
|
||||||
switch (detail) {
|
switch (detail) {
|
||||||
case Above: return ("Above");
|
case Above:
|
||||||
|
return ("Above");
|
||||||
|
|
||||||
case Below: return ("Below");
|
case Below:
|
||||||
|
return ("Below");
|
||||||
|
|
||||||
case TopIf: return ("TopIf");
|
case TopIf:
|
||||||
|
return ("TopIf");
|
||||||
|
|
||||||
case BottomIf: return ("BottomIf");
|
case BottomIf:
|
||||||
|
return ("BottomIf");
|
||||||
|
|
||||||
case Opposite: return ("Opposite");
|
case Opposite:
|
||||||
|
return ("Opposite");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,15 +291,20 @@ static char* ConfigureDetail(detail) int detail;
|
||||||
static char* GrabMode(mode) int mode;
|
static char* GrabMode(mode) int mode;
|
||||||
{
|
{
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case NotifyNormal: return ("NotifyNormal");
|
case NotifyNormal:
|
||||||
|
return ("NotifyNormal");
|
||||||
|
|
||||||
case NotifyGrab: return ("NotifyGrab");
|
case NotifyGrab:
|
||||||
|
return ("NotifyGrab");
|
||||||
|
|
||||||
case NotifyUngrab: return ("NotifyUngrab");
|
case NotifyUngrab:
|
||||||
|
return ("NotifyUngrab");
|
||||||
|
|
||||||
case NotifyWhileGrabbed: return ("NotifyWhileGrabbed");
|
case NotifyWhileGrabbed:
|
||||||
|
return ("NotifyWhileGrabbed");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,13 +312,17 @@ static char* GrabMode(mode) int mode;
|
||||||
static char* MappingRequest(request) int request;
|
static char* MappingRequest(request) int request;
|
||||||
{
|
{
|
||||||
switch (request) {
|
switch (request) {
|
||||||
case MappingModifier: return ("MappingModifier");
|
case MappingModifier:
|
||||||
|
return ("MappingModifier");
|
||||||
|
|
||||||
case MappingKeyboard: return ("MappingKeyboard");
|
case MappingKeyboard:
|
||||||
|
return ("MappingKeyboard");
|
||||||
|
|
||||||
case MappingPointer: return ("MappingPointer");
|
case MappingPointer:
|
||||||
|
return ("MappingPointer");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,11 +330,14 @@ static char* MappingRequest(request) int request;
|
||||||
static char* Place(place) int place;
|
static char* Place(place) int place;
|
||||||
{
|
{
|
||||||
switch (place) {
|
switch (place) {
|
||||||
case PlaceOnTop: return ("PlaceOnTop");
|
case PlaceOnTop:
|
||||||
|
return ("PlaceOnTop");
|
||||||
|
|
||||||
case PlaceOnBottom: return ("PlaceOnBottom");
|
case PlaceOnBottom:
|
||||||
|
return ("PlaceOnBottom");
|
||||||
|
|
||||||
default: return ("?");
|
default:
|
||||||
|
return ("?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,11 +347,15 @@ static char* MajorCode(code) int code;
|
||||||
static char buffer[32];
|
static char buffer[32];
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case X_CopyArea: return ("X_CopyArea");
|
case X_CopyArea:
|
||||||
|
return ("X_CopyArea");
|
||||||
|
|
||||||
case X_CopyPlane: return ("X_CopyPlane");
|
case X_CopyPlane:
|
||||||
|
return ("X_CopyPlane");
|
||||||
|
|
||||||
default: sprintf(buffer, "0x%x", code); return (buffer);
|
default:
|
||||||
|
sprintf(buffer, "0x%x", code);
|
||||||
|
return (buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,12 +383,12 @@ static char* Keycode(ev) XKeyEvent* ev;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the string equivalent of an atom or "None"*/
|
/* Returns the string equivalent of an atom or "None"*/
|
||||||
static char*
|
static char* AtomName(Display* dpy, Atom atom) {
|
||||||
AtomName(Display* dpy, Atom atom) {
|
|
||||||
static char buffer[256];
|
static char buffer[256];
|
||||||
char* atom_name;
|
char* atom_name;
|
||||||
|
|
||||||
if (atom == None) return ("None");
|
if (atom == None)
|
||||||
|
return ("None");
|
||||||
|
|
||||||
atom_name = XGetAtomName(dpy, atom);
|
atom_name = XGetAtomName(dpy, atom);
|
||||||
strncpy(buffer, atom_name, 256);
|
strncpy(buffer, atom_name, 256);
|
||||||
|
@ -347,8 +400,7 @@ AtomName(Display* dpy, Atom atom) {
|
||||||
/**** Routines to print out readable values for the field of various events ***/
|
/**** Routines to print out readable values for the field of various events ***/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
static void
|
static void VerbMotion(XMotionEvent* ev) {
|
||||||
VerbMotion(XMotionEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
||||||
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
||||||
|
@ -360,8 +412,7 @@ VerbMotion(XMotionEvent* ev) {
|
||||||
printf("same_screen=%s\n", TorF(ev->same_screen));
|
printf("same_screen=%s\n", TorF(ev->same_screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbButton(XButtonEvent* ev) {
|
||||||
VerbButton(XButtonEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
||||||
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
||||||
|
@ -373,16 +424,14 @@ VerbButton(XButtonEvent* ev) {
|
||||||
printf("same_screen=%s\n", TorF(ev->same_screen));
|
printf("same_screen=%s\n", TorF(ev->same_screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbColormap(XColormapEvent* ev) {
|
||||||
VerbColormap(XColormapEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("colormap=%s%s", MaybeNone(ev->colormap), sep);
|
printf("colormap=%s%s", MaybeNone(ev->colormap), sep);
|
||||||
printf("new=%s%s", TorF(ev->new), sep);
|
printf("new=%s%s", TorF(ev->new), sep);
|
||||||
printf("state=%s\n", ColormapState(ev->state));
|
printf("state=%s\n", ColormapState(ev->state));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbCrossing(XCrossingEvent* ev) {
|
||||||
VerbCrossing(XCrossingEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
||||||
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
||||||
|
@ -396,16 +445,14 @@ VerbCrossing(XCrossingEvent* ev) {
|
||||||
printf("state=%s\n", ButtonAndOrModifierState(ev->state));
|
printf("state=%s\n", ButtonAndOrModifierState(ev->state));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbExpose(XExposeEvent* ev) {
|
||||||
VerbExpose(XExposeEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
||||||
printf("width=%d height=%d%s", ev->width, ev->height, sep);
|
printf("width=%d height=%d%s", ev->width, ev->height, sep);
|
||||||
printf("count=%d\n", ev->count);
|
printf("count=%d\n", ev->count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbGraphicsExpose(XGraphicsExposeEvent* ev) {
|
||||||
VerbGraphicsExpose(XGraphicsExposeEvent* ev) {
|
|
||||||
printf("drawable=0x%x%s", (unsigned)ev->drawable, sep);
|
printf("drawable=0x%x%s", (unsigned)ev->drawable, sep);
|
||||||
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
||||||
printf("width=%d height=%d%s", ev->width, ev->height, sep);
|
printf("width=%d height=%d%s", ev->width, ev->height, sep);
|
||||||
|
@ -413,32 +460,29 @@ VerbGraphicsExpose(XGraphicsExposeEvent* ev) {
|
||||||
printf("minor_code=%d\n", ev->minor_code);
|
printf("minor_code=%d\n", ev->minor_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbNoExpose(XNoExposeEvent* ev) {
|
||||||
VerbNoExpose(XNoExposeEvent* ev) {
|
|
||||||
printf("drawable=0x%x%s", (unsigned)ev->drawable, sep);
|
printf("drawable=0x%x%s", (unsigned)ev->drawable, sep);
|
||||||
printf("major_code=%s%s", MajorCode(ev->major_code), sep);
|
printf("major_code=%s%s", MajorCode(ev->major_code), sep);
|
||||||
printf("minor_code=%d\n", ev->minor_code);
|
printf("minor_code=%d\n", ev->minor_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbFocus(XFocusChangeEvent* ev) {
|
||||||
VerbFocus(XFocusChangeEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("mode=%s%s", GrabMode(ev->mode), sep);
|
printf("mode=%s%s", GrabMode(ev->mode), sep);
|
||||||
printf("detail=%s\n", FocusChangeDetail(ev->detail));
|
printf("detail=%s\n", FocusChangeDetail(ev->detail));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbKeymap(XKeymapEvent* ev) {
|
||||||
VerbKeymap(XKeymapEvent* ev) {
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("key_vector=");
|
printf("key_vector=");
|
||||||
for (i = 0; i < 32; i++) printf("%02x", ev->key_vector[i]);
|
for (i = 0; i < 32; i++)
|
||||||
|
printf("%02x", ev->key_vector[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbKey(XKeyEvent* ev) {
|
||||||
VerbKey(XKeyEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
printf("root=0x%x%s", (unsigned)ev->root, sep);
|
||||||
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
printf("subwindow=0x%x%s", (unsigned)ev->subwindow, sep);
|
||||||
|
@ -450,29 +494,25 @@ VerbKey(XKeyEvent* ev) {
|
||||||
printf("same_screen=%s\n", TorF(ev->same_screen));
|
printf("same_screen=%s\n", TorF(ev->same_screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbProperty(XPropertyEvent* ev) {
|
||||||
VerbProperty(XPropertyEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("atom=%s%s", AtomName(ev->display, ev->atom), sep);
|
printf("atom=%s%s", AtomName(ev->display, ev->atom), sep);
|
||||||
printf("time=%s%s", ServerTime(ev->time), sep);
|
printf("time=%s%s", ServerTime(ev->time), sep);
|
||||||
printf("state=%s\n", PropertyState(ev->state));
|
printf("state=%s\n", PropertyState(ev->state));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbResizeRequest(XResizeRequestEvent* ev) {
|
||||||
VerbResizeRequest(XResizeRequestEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("width=%d height=%d\n", ev->width, ev->height);
|
printf("width=%d height=%d\n", ev->width, ev->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbCirculate(XCirculateEvent* ev) {
|
||||||
VerbCirculate(XCirculateEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("place=%s\n", Place(ev->place));
|
printf("place=%s\n", Place(ev->place));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbConfigure(XConfigureEvent* ev) {
|
||||||
VerbConfigure(XConfigureEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
||||||
|
@ -482,8 +522,7 @@ VerbConfigure(XConfigureEvent* ev) {
|
||||||
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbCreateWindow(XCreateWindowEvent* ev) {
|
||||||
VerbCreateWindow(XCreateWindowEvent* ev) {
|
|
||||||
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
||||||
|
@ -492,28 +531,24 @@ VerbCreateWindow(XCreateWindowEvent* ev) {
|
||||||
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbDestroyWindow(XDestroyWindowEvent* ev) {
|
||||||
VerbDestroyWindow(XDestroyWindowEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x\n", (unsigned)ev->window);
|
printf("window=0x%x\n", (unsigned)ev->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbGravity(XGravityEvent* ev) {
|
||||||
VerbGravity(XGravityEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("x=%d y=%d\n", ev->x, ev->y);
|
printf("x=%d y=%d\n", ev->x, ev->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbMap(XMapEvent* ev) {
|
||||||
VerbMap(XMapEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbReparent(XReparentEvent* ev) {
|
||||||
VerbReparent(XReparentEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
||||||
|
@ -521,22 +556,19 @@ VerbReparent(XReparentEvent* ev) {
|
||||||
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
printf("override_redirect=%s\n", TorF(ev->override_redirect));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbUnmap(XUnmapEvent* ev) {
|
||||||
VerbUnmap(XUnmapEvent* ev) {
|
|
||||||
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
printf("event=0x%x%s", (unsigned)ev->event, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("from_configure=%s\n", TorF(ev->from_configure));
|
printf("from_configure=%s\n", TorF(ev->from_configure));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbCirculateRequest(XCirculateRequestEvent* ev) {
|
||||||
VerbCirculateRequest(XCirculateRequestEvent* ev) {
|
|
||||||
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("place=%s\n", Place(ev->place));
|
printf("place=%s\n", Place(ev->place));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbConfigureRequest(XConfigureRequestEvent* ev) {
|
||||||
VerbConfigureRequest(XConfigureRequestEvent* ev) {
|
|
||||||
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
printf("x=%d y=%d%s", ev->x, ev->y, sep);
|
||||||
|
@ -547,41 +579,37 @@ VerbConfigureRequest(XConfigureRequestEvent* ev) {
|
||||||
printf("value_mask=%s\n", ConfigureValueMask(ev->value_mask));
|
printf("value_mask=%s\n", ConfigureValueMask(ev->value_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbMapRequest(XMapRequestEvent* ev) {
|
||||||
VerbMapRequest(XMapRequestEvent* ev) {
|
|
||||||
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
printf("parent=0x%x%s", (unsigned)ev->parent, sep);
|
||||||
printf("window=0x%x\n", (unsigned)ev->window);
|
printf("window=0x%x\n", (unsigned)ev->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbClient(XClientMessageEvent* ev) {
|
||||||
VerbClient(XClientMessageEvent* ev) {
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("message_type=%s%s", AtomName(ev->display, ev->message_type), sep);
|
printf("message_type=%s%s", AtomName(ev->display, ev->message_type), sep);
|
||||||
printf("format=%d\n", ev->format);
|
printf("format=%d\n", ev->format);
|
||||||
printf("data (shown as longs)=");
|
printf("data (shown as longs)=");
|
||||||
for (i = 0; i < 5; i++) printf(" 0x%08lx", ev->data.l[i]);
|
for (i = 0; i < 5; i++)
|
||||||
|
printf(" 0x%08lx", ev->data.l[i]);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbMapping(XMappingEvent* ev) {
|
||||||
VerbMapping(XMappingEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("request=%s%s", MappingRequest(ev->request), sep);
|
printf("request=%s%s", MappingRequest(ev->request), sep);
|
||||||
printf("first_keycode=0x%x%s", ev->first_keycode, sep);
|
printf("first_keycode=0x%x%s", ev->first_keycode, sep);
|
||||||
printf("count=0x%x\n", ev->count);
|
printf("count=0x%x\n", ev->count);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbSelectionClear(XSelectionClearEvent* ev) {
|
||||||
VerbSelectionClear(XSelectionClearEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("selection=%s%s", AtomName(ev->display, ev->selection), sep);
|
printf("selection=%s%s", AtomName(ev->display, ev->selection), sep);
|
||||||
printf("time=%s\n", ServerTime(ev->time));
|
printf("time=%s\n", ServerTime(ev->time));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbSelection(XSelectionEvent* ev) {
|
||||||
VerbSelection(XSelectionEvent* ev) {
|
|
||||||
printf("requestor=0x%x%s", (unsigned)ev->requestor, sep);
|
printf("requestor=0x%x%s", (unsigned)ev->requestor, sep);
|
||||||
printf("selection=%s%s", AtomName(ev->display, ev->selection), sep);
|
printf("selection=%s%s", AtomName(ev->display, ev->selection), sep);
|
||||||
printf("target=%s%s", AtomName(ev->display, ev->target), sep);
|
printf("target=%s%s", AtomName(ev->display, ev->target), sep);
|
||||||
|
@ -589,8 +617,7 @@ VerbSelection(XSelectionEvent* ev) {
|
||||||
printf("time=%s\n", ServerTime(ev->time));
|
printf("time=%s\n", ServerTime(ev->time));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbSelectionRequest(XSelectionRequestEvent* ev) {
|
||||||
VerbSelectionRequest(XSelectionRequestEvent* ev) {
|
|
||||||
printf("owner=0x%x%s", (unsigned)ev->owner, sep);
|
printf("owner=0x%x%s", (unsigned)ev->owner, sep);
|
||||||
printf("requestor=0x%x%s", (unsigned)ev->requestor, sep);
|
printf("requestor=0x%x%s", (unsigned)ev->requestor, sep);
|
||||||
printf("selection=%s%s", AtomName(ev->display, ev->selection), sep);
|
printf("selection=%s%s", AtomName(ev->display, ev->selection), sep);
|
||||||
|
@ -599,8 +626,7 @@ VerbSelectionRequest(XSelectionRequestEvent* ev) {
|
||||||
printf("time=%s\n", ServerTime(ev->time));
|
printf("time=%s\n", ServerTime(ev->time));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void VerbVisibility(XVisibilityEvent* ev) {
|
||||||
VerbVisibility(XVisibilityEvent* ev) {
|
|
||||||
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
printf("window=0x%x%s", (unsigned)ev->window, sep);
|
||||||
printf("state=%s\n", VisibilityState(ev->state));
|
printf("state=%s\n", VisibilityState(ev->state));
|
||||||
}
|
}
|
||||||
|
@ -612,39 +638,72 @@ VerbVisibility(XVisibilityEvent* ev) {
|
||||||
char* GetType(ev) XEvent* ev;
|
char* GetType(ev) XEvent* ev;
|
||||||
{
|
{
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
case KeyPress: return ("KeyPress");
|
case KeyPress:
|
||||||
case KeyRelease: return ("KeyRelease");
|
return ("KeyPress");
|
||||||
case ButtonPress: return ("ButtonPress");
|
case KeyRelease:
|
||||||
case ButtonRelease: return ("ButtonRelease");
|
return ("KeyRelease");
|
||||||
case MotionNotify: return ("MotionNotify");
|
case ButtonPress:
|
||||||
case EnterNotify: return ("EnterNotify");
|
return ("ButtonPress");
|
||||||
case LeaveNotify: return ("LeaveNotify");
|
case ButtonRelease:
|
||||||
case FocusIn: return ("FocusIn");
|
return ("ButtonRelease");
|
||||||
case FocusOut: return ("FocusOut");
|
case MotionNotify:
|
||||||
case KeymapNotify: return ("KeymapNotify");
|
return ("MotionNotify");
|
||||||
case Expose: return ("Expose");
|
case EnterNotify:
|
||||||
case GraphicsExpose: return ("GraphicsExpose");
|
return ("EnterNotify");
|
||||||
case NoExpose: return ("NoExpose");
|
case LeaveNotify:
|
||||||
case VisibilityNotify: return ("VisibilityNotify");
|
return ("LeaveNotify");
|
||||||
case CreateNotify: return ("CreateNotify");
|
case FocusIn:
|
||||||
case DestroyNotify: return ("DestroyNotify");
|
return ("FocusIn");
|
||||||
case UnmapNotify: return ("UnmapNotify");
|
case FocusOut:
|
||||||
case MapNotify: return ("MapNotify");
|
return ("FocusOut");
|
||||||
case MapRequest: return ("MapRequest");
|
case KeymapNotify:
|
||||||
case ReparentNotify: return ("ReparentNotify");
|
return ("KeymapNotify");
|
||||||
case ConfigureNotify: return ("ConfigureNotify");
|
case Expose:
|
||||||
case ConfigureRequest: return ("ConfigureRequest");
|
return ("Expose");
|
||||||
case GravityNotify: return ("GravityNotify");
|
case GraphicsExpose:
|
||||||
case ResizeRequest: return ("ResizeRequest");
|
return ("GraphicsExpose");
|
||||||
case CirculateNotify: return ("CirculateNotify");
|
case NoExpose:
|
||||||
case CirculateRequest: return ("CirculateRequest");
|
return ("NoExpose");
|
||||||
case PropertyNotify: return ("PropertyNotify");
|
case VisibilityNotify:
|
||||||
case SelectionClear: return ("SelectionClear");
|
return ("VisibilityNotify");
|
||||||
case SelectionRequest: return ("SelectionRequest");
|
case CreateNotify:
|
||||||
case SelectionNotify: return ("SelectionNotify");
|
return ("CreateNotify");
|
||||||
case ColormapNotify: return ("ColormapNotify");
|
case DestroyNotify:
|
||||||
case ClientMessage: return ("ClientMessage");
|
return ("DestroyNotify");
|
||||||
case MappingNotify: return ("MappingNotify");
|
case UnmapNotify:
|
||||||
|
return ("UnmapNotify");
|
||||||
|
case MapNotify:
|
||||||
|
return ("MapNotify");
|
||||||
|
case MapRequest:
|
||||||
|
return ("MapRequest");
|
||||||
|
case ReparentNotify:
|
||||||
|
return ("ReparentNotify");
|
||||||
|
case ConfigureNotify:
|
||||||
|
return ("ConfigureNotify");
|
||||||
|
case ConfigureRequest:
|
||||||
|
return ("ConfigureRequest");
|
||||||
|
case GravityNotify:
|
||||||
|
return ("GravityNotify");
|
||||||
|
case ResizeRequest:
|
||||||
|
return ("ResizeRequest");
|
||||||
|
case CirculateNotify:
|
||||||
|
return ("CirculateNotify");
|
||||||
|
case CirculateRequest:
|
||||||
|
return ("CirculateRequest");
|
||||||
|
case PropertyNotify:
|
||||||
|
return ("PropertyNotify");
|
||||||
|
case SelectionClear:
|
||||||
|
return ("SelectionClear");
|
||||||
|
case SelectionRequest:
|
||||||
|
return ("SelectionRequest");
|
||||||
|
case SelectionNotify:
|
||||||
|
return ("SelectionNotify");
|
||||||
|
case ColormapNotify:
|
||||||
|
return ("ColormapNotify");
|
||||||
|
case ClientMessage:
|
||||||
|
return ("ClientMessage");
|
||||||
|
case MappingNotify:
|
||||||
|
return ("MappingNotify");
|
||||||
}
|
}
|
||||||
return "???";
|
return "???";
|
||||||
}
|
}
|
||||||
|
@ -653,8 +712,7 @@ char* GetType(ev) XEvent* ev;
|
||||||
/**************** Print the values of all fields for any event ****************/
|
/**************** Print the values of all fields for any event ****************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
void
|
void ShowEvent(XEvent* eev) {
|
||||||
ShowEvent(XEvent* eev) {
|
|
||||||
XAnyEvent* ev = (XAnyEvent*)eev;
|
XAnyEvent* ev = (XAnyEvent*)eev;
|
||||||
/* determine which field separator to use */
|
/* determine which field separator to use */
|
||||||
if (use_separate_lines)
|
if (use_separate_lines)
|
||||||
|
@ -668,66 +726,124 @@ ShowEvent(XEvent* eev) {
|
||||||
printf("display=0x%p%s", ev->display, sep);
|
printf("display=0x%p%s", ev->display, sep);
|
||||||
|
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
case MotionNotify: VerbMotion((void*)ev); break;
|
case MotionNotify:
|
||||||
|
VerbMotion((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease: VerbButton((void*)ev); break;
|
case ButtonRelease:
|
||||||
|
VerbButton((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ColormapNotify: VerbColormap((void*)ev); break;
|
case ColormapNotify:
|
||||||
|
VerbColormap((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
case LeaveNotify: VerbCrossing((void*)ev); break;
|
case LeaveNotify:
|
||||||
|
VerbCrossing((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case Expose: VerbExpose((void*)ev); break;
|
case Expose:
|
||||||
|
VerbExpose((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case GraphicsExpose: VerbGraphicsExpose((void*)ev); break;
|
case GraphicsExpose:
|
||||||
|
VerbGraphicsExpose((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case NoExpose: VerbNoExpose((void*)ev); break;
|
case NoExpose:
|
||||||
|
VerbNoExpose((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
case FocusOut: VerbFocus((void*)ev); break;
|
case FocusOut:
|
||||||
|
VerbFocus((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case KeymapNotify: VerbKeymap((void*)ev); break;
|
case KeymapNotify:
|
||||||
|
VerbKeymap((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease: VerbKey((void*)ev); break;
|
case KeyRelease:
|
||||||
|
VerbKey((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case PropertyNotify: VerbProperty((void*)ev); break;
|
case PropertyNotify:
|
||||||
|
VerbProperty((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ResizeRequest: VerbResizeRequest((void*)ev); break;
|
case ResizeRequest:
|
||||||
|
VerbResizeRequest((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case CirculateNotify: VerbCirculate((void*)ev); break;
|
case CirculateNotify:
|
||||||
|
VerbCirculate((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ConfigureNotify: VerbConfigure((void*)ev); break;
|
case ConfigureNotify:
|
||||||
|
VerbConfigure((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case CreateNotify: VerbCreateWindow((void*)ev); break;
|
case CreateNotify:
|
||||||
|
VerbCreateWindow((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case DestroyNotify: VerbDestroyWindow((void*)ev); break;
|
case DestroyNotify:
|
||||||
|
VerbDestroyWindow((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case GravityNotify: VerbGravity((void*)ev); break;
|
case GravityNotify:
|
||||||
|
VerbGravity((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case MapNotify: VerbMap((void*)ev); break;
|
case MapNotify:
|
||||||
|
VerbMap((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ReparentNotify: VerbReparent((void*)ev); break;
|
case ReparentNotify:
|
||||||
|
VerbReparent((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case UnmapNotify: VerbUnmap((void*)ev); break;
|
case UnmapNotify:
|
||||||
|
VerbUnmap((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case CirculateRequest: VerbCirculateRequest((void*)ev); break;
|
case CirculateRequest:
|
||||||
|
VerbCirculateRequest((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ConfigureRequest: VerbConfigureRequest((void*)ev); break;
|
case ConfigureRequest:
|
||||||
|
VerbConfigureRequest((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case MapRequest: VerbMapRequest((void*)ev); break;
|
case MapRequest:
|
||||||
|
VerbMapRequest((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case ClientMessage: VerbClient((void*)ev); break;
|
case ClientMessage:
|
||||||
|
VerbClient((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case MappingNotify: VerbMapping((void*)ev); break;
|
case MappingNotify:
|
||||||
|
VerbMapping((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case SelectionClear: VerbSelectionClear((void*)ev); break;
|
case SelectionClear:
|
||||||
|
VerbSelectionClear((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case SelectionNotify: VerbSelection((void*)ev); break;
|
case SelectionNotify:
|
||||||
|
VerbSelection((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case SelectionRequest: VerbSelectionRequest((void*)ev); break;
|
case SelectionRequest:
|
||||||
|
VerbSelectionRequest((void*)ev);
|
||||||
|
break;
|
||||||
|
|
||||||
case VisibilityNotify: VerbVisibility((void*)ev); break;
|
case VisibilityNotify:
|
||||||
|
VerbVisibility((void*)ev);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue