summaryrefslogtreecommitdiff
path: root/src/wm-tester/test-gravity.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2003-03-29 20:04:19 +0000
committerHavoc Pennington <hp@src.gnome.org>2003-03-29 20:04:19 +0000
commit0fee2ac49921804c375df643eab28cb6777f50f4 (patch)
tree953df4c69cc2d574d06c28889adc67cd29c426cb /src/wm-tester/test-gravity.c
parent708a86cfee7af6a7cbbcd0fb3d7f7a4494525a1f (diff)
downloadmetacity-0fee2ac49921804c375df643eab28cb6777f50f4.tar.gz
metacity-0fee2ac49921804c375df643eab28cb6777f50f4.tar.bz2
add --noframes option for testing, showing how broken we currently are.
2003-03-29 Havoc Pennington <hp@pobox.com> * src/wm-tester/test-gravity.c (main): add --noframes option for testing, showing how broken we currently are.
Diffstat (limited to 'src/wm-tester/test-gravity.c')
-rw-r--r--src/wm-tester/test-gravity.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/wm-tester/test-gravity.c b/src/wm-tester/test-gravity.c
index d74a7c3..1b6f441 100644
--- a/src/wm-tester/test-gravity.c
+++ b/src/wm-tester/test-gravity.c
@@ -112,6 +112,19 @@ find_window (Window window)
return -1;
}
+typedef struct {
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
+} MotifWmHints, MwmHints;
+
+#define MWM_HINTS_FUNCTIONS (1L << 0)
+#define MWM_HINTS_DECORATIONS (1L << 1)
+#define MWM_HINTS_INPUT_MODE (1L << 2)
+#define MWM_HINTS_STATUS (1L << 3)
+
int main (int argc, char **argv)
{
Display *d;
@@ -120,6 +133,12 @@ int main (int argc, char **argv)
int i;
int screen;
XEvent ev;
+ int noframes;
+
+ if (argc > 1 && strcmp (argv[1], "--noframes") == 0)
+ noframes = 1;
+ else
+ noframes = 0;
d = XOpenDisplay (NULL);
@@ -166,6 +185,22 @@ int main (int argc, char **argv)
XSetWMNormalHints (d, w, &hints);
XStoreName (d, w, window_gravity_to_string (hints.win_gravity));
+
+ if (noframes)
+ {
+ MotifWmHints mwm;
+ Atom mwm_atom;
+
+ mwm.decorations = 0;
+ mwm.flags = MWM_HINTS_DECORATIONS;
+
+ mwm_atom = XInternAtom (d, "_MOTIF_WM_HINTS", False);
+
+ XChangeProperty (d, w, mwm_atom, mwm_atom,
+ 32, PropModeReplace,
+ (unsigned char *)&mwm,
+ sizeof (MotifWmHints)/sizeof (long));
+ }
XMapWindow (d, w);
}