summaryrefslogtreecommitdiff
path: root/src/wm-tester/focus-window.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-01-07 03:26:09 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-01-07 03:26:09 +0000
commitf36ba88085160867791f73704fb023a165d29752 (patch)
tree4f4f5889c4430f7330c08c4c37858aaf0d8e27a9 /src/wm-tester/focus-window.c
parentac85e1e225a4f12e7069ca60562a92cef3d37dc6 (diff)
downloadmetacity-f36ba88085160867791f73704fb023a165d29752.tar.gz
metacity-f36ba88085160867791f73704fb023a165d29752.tar.bz2
put in attempted fix for the GTK 1.2 plug/socket screwup, now that my
2002-01-06 Havoc Pennington <hp@pobox.com> * src/window.c (meta_window_notify_focus): put in attempted fix for the GTK 1.2 plug/socket screwup, now that my fixed debug spew reveals what's actually happening. ;-) * src/gradient.c (meta_gradient_description_new): object to store gradient descriptions * src/window.c (meta_window_notify_focus): fix the debug spew that was confusing me * src/wm-tester/focus-window.c: add little program to focus a window ID
Diffstat (limited to 'src/wm-tester/focus-window.c')
-rw-r--r--src/wm-tester/focus-window.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/wm-tester/focus-window.c b/src/wm-tester/focus-window.c
new file mode 100644
index 0000000..dc33bd2
--- /dev/null
+++ b/src/wm-tester/focus-window.c
@@ -0,0 +1,37 @@
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main (int argc, char **argv)
+{
+ Display *d;
+ Window w;
+ const char *w_str;
+ char *end;
+
+ if (argc != 2)
+ {
+ fprintf (stderr, "Usage: focus-window WINDOWID\n");
+ exit (1);
+ }
+
+ d = XOpenDisplay (NULL);
+
+ w_str = argv[1];
+ end = NULL;
+
+ w = strtoul (w_str, &end, 16);
+ if (end == w_str)
+ {
+ fprintf (stderr, "Usage: focus-window WINDOWID\n");
+ exit (1);
+ }
+
+ printf ("Setting input focus to 0x%lx\n", w);
+ XSetInputFocus (d, w, RevertToPointerRoot, CurrentTime);
+ XFlush (d);
+
+ return 0;
+}
+