summaryrefslogtreecommitdiff
path: root/src/wm-tester/test-gravity.c
diff options
context:
space:
mode:
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);
}