projects
/
mikachu
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e858873
)
Add a --root option for obxprop
author
Dana Jansens
<danakj@orodu.net>
Wed, 6 Jan 2010 18:24:41 +0000
(13:24 -0500)
committer
Dana Jansens
<danakj@orodu.net>
Wed, 6 Jan 2010 22:13:03 +0000
(17:13 -0500)
tools/obxprop/obxprop.c
patch
|
blob
|
history
diff --git
a/tools/obxprop/obxprop.c
b/tools/obxprop/obxprop.c
index
2685154
..
6ea8a4d
100644
(file)
--- a/
tools/obxprop/obxprop.c
+++ b/
tools/obxprop/obxprop.c
@@
-16,7
+16,8
@@
gint fail(const gchar *s) {
"Options:\n"
" --help Display this help and exit\n"
" --display DISPLAY Connect to this X display\n"
"Options:\n"
" --help Display this help and exit\n"
" --display DISPLAY Connect to this X display\n"
- " --id ID Show the properties for this window\n");
+ " --id ID Show the properties for this window\n"
+ " --root Show the properties for the root window\n");
return 1;
}
return 1;
}
@@
-256,11
+257,14
@@
int main(int argc, char **argv)
Window id, userid = None;
int i;
char *dname = NULL;
Window id, userid = None;
int i;
char *dname = NULL;
+ gboolean root = FALSE;
for (i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "--help")) {
return fail(0);
}
for (i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "--help")) {
return fail(0);
}
+ else if (!strcmp(argv[i], "--root"))
+ root = TRUE;
else if (!strcmp(argv[i], "--id")) {
if (++i == argc)
return fail(0);
else if (!strcmp(argv[i], "--id")) {
if (++i == argc)
return fail(0);
@@
-287,6
+291,9
@@
int main(int argc, char **argv)
"Ensure you have permission to connect to the display.");
}
"Ensure you have permission to connect to the display.");
}
+ if (root)
+ userid = RootWindow(d, DefaultScreen(d));
+
if (userid == None) {
i = XGrabPointer(d, RootWindow(d, DefaultScreen(d)),
False, ButtonPressMask,
if (userid == None) {
i = XGrabPointer(d, RootWindow(d, DefaultScreen(d)),
False, ButtonPressMask,