all repos — openbox @ e070a051c6a78a1737da5456b9747c8cb05e8396

openbox fork - make it a bit more like ryudo

Add a --root option for obxprop
Dana Jansens danakj@orodu.net
commit

e070a051c6a78a1737da5456b9747c8cb05e8396

parent

e8588737c944f4dc5f94ca67bf0c7e3ff7133004

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M tools/obxprop/obxprop.ctools/obxprop/obxprop.c

@@ -16,7 +16,8 @@ "Usage: obxprop [OPTIONS]\n\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; }

@@ -256,11 +257,14 @@ Display *d;

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); } + else if (!strcmp(argv[i], "--root")) + root = TRUE; else if (!strcmp(argv[i], "--id")) { if (++i == argc) return fail(0);

@@ -286,6 +290,9 @@ if (!d) {

return fail("Unable to find an X 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)),