summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2011-10-30 16:46:01 +0900
committerArnaud Fontaine <arnau@debian.org>2011-10-30 16:46:01 +0900
commitc63bf55e69fc50e08b9bf500e9b05cf36ce48680 (patch)
tree4325e732173f32da144df1e4d8bd794125fc18c3
parent88d9e28837f71f391402654c33394635d27d4b30 (diff)
2007-09-21 Daniel Forchheimer <n04df@student.lth.se>transset-df
Release v6 * transSet.c Select flag: --actual Set transparency to the actual focused X11 window Thanks to Roman Divacky for the patch
-rw-r--r--README3
-rw-r--r--transSet.c30
2 files changed, 27 insertions, 6 deletions
diff --git a/README b/README
index 4ae16e7..9671f78 100644
--- a/README
+++ b/README
@@ -16,6 +16,7 @@ changing any wm-code. And it's a very "unix way" of doing things too :)
Features
*select window by clicking (as transset)
+ *select actual focused X11 window
*select window by pointing
*select by window name or id
*force toggle
@@ -33,4 +34,4 @@ me a email
Cheers
Daniel Forchheimer (upiom)
-n04df@efd.lth.se
+n04df@student.lth.se
diff --git a/transSet.c b/transSet.c
index 3ed63be..684a752 100644
--- a/transSet.c
+++ b/transSet.c
@@ -4,12 +4,15 @@
The purpos is to bind it from your wm to a key or mouse-button
License: Use however you want.
- Written by: Daniel Forchheimer (upiom)
-
+ Authors:
+ Matthew Hawn
+ Daniel Forchheimer
+ Andreas Kohn
+ Roman Divacky
*/
-#define VERSIONSTR "5"
-#define RELEASEDATESTR "2006-01-10"
+#define VERSIONSTR "6"
+#define RELEASEDATESTR "2007-09-21"
#include <stdio.h>
#include <X11/Xlib.h>
@@ -39,6 +42,8 @@ void usage()
fprintf(stderr,
" -p, --point select the window currently under the cursor\n");
fprintf(stderr,
+ " -a, --actual select the actual window\n");
+ fprintf(stderr,
" -n, --name NAME select by name, NAME is matched as regular expression\n");
fprintf(stderr,
" --no-regex don't use regular expression for matching name\n");
@@ -85,6 +90,15 @@ Window get_top_window(Display *dpy,Window child) {
return child;
}
+/* returns the actual window */
+Window get_actual_window(Display *dpy)
+{
+ int i;
+ Window w;
+
+ XGetInputFocus(dpy, &w, &i);
+ return get_top_window(dpy, w);
+}
/* nothing fancy */
int main(int argc, char **argv)
@@ -109,6 +123,7 @@ int main(int argc, char **argv)
{"toggle",0,NULL,'t'},
{"help",0,NULL,'h'},
{"point",0,NULL,'p'},
+ {"actual",0,NULL,'a'},
{"click",0,NULL,'c'},
{"id",1,NULL,'i'},
{"name",1,NULL,'n'},
@@ -131,7 +146,7 @@ int main(int argc, char **argv)
Setup_Display_And_Screen(&argc, argv);
/* parse arguments */
- while ((o = getopt_long(argc, argv, "thpci:n:vVm:x:123",long_options,&options_index)) != -1)
+ while ((o = getopt_long(argc, argv, "thapci:n:vVm:x:123",long_options,&options_index)) != -1)
{
switch (o) {
case 't':
@@ -156,6 +171,9 @@ int main(int argc, char **argv)
namestr = optarg;
select_method=3;
break;
+ case 'a':
+ select_method=4;
+ break;
case '1':
flag_increase=1;
break;
@@ -228,6 +246,8 @@ int main(int argc, char **argv)
target_win = get_top_window(dpy,target_win);
if(flag_verbose) printf("found 0x%x\n",(unsigned int)target_win);
+ } else if(select_method==4) {
+ target_win = get_actual_window(dpy);
} else {
/* grab mouse and return window that is next clicked */
target_win = Select_Window(dpy);