--- main.c.old	2008-03-18 09:19:07.000000000 +0100
+++ main.c	2008-03-17 16:21:24.000000000 +0100
@@ -62,6 +62,8 @@
 "                       possible for example to make the window maximized,\n" \
 "                       minimized or fullscreen. The format of the <STARG>\n" \
 "                       argument and list of possible states is given below.\n" \
+"  -r <WIN> -q  	Hide the windows Decorations\n" \
+"  -r <WIN> -s  	Show the windows Decorations\n" \
 "  -r <WIN> -N <STR>    Set the name (long title) of the window.\n" \
 "  -r <WIN> -I <STR>    Set the icon name (short title) of the window.\n" \
 "  -r <WIN> -T <STR>    Set both the name and the icon name of the window.\n" \
@@ -264,7 +266,7 @@
         }
     }
    
-    while ((opt = getopt(argc, argv, "FGVvhlupidmxa:r:s:c:t:w:k:o:n:g:e:b:N:I:T:R:")) != -1) {
+    while ((opt = getopt(argc, argv, "FGVvhlquzpidmxa:r:s:c:t:w:k:o:n:g:e:b:N:I:T:R:")) != -1) {
         missing_option = 0;
         switch (opt) {
             case 'F':
@@ -296,7 +298,7 @@
             case 'r':
                 options.param_window = optarg;
                 break; 
-            case 't': case 'e': case 'b': case 'N': case 'I': case 'T':
+	    case 't': case 'e': case 'q': case 'z': case 'b': case 'N': case 'I': case 'T':
                 options.param = optarg;
                 action = opt;
                 break;
@@ -356,7 +358,7 @@
             ret = wm_info(disp);
             break;
         case 'a': case 'c': case 'R': 
-        case 't': case 'e': case 'b': case 'N': case 'I': case 'T':
+	case 't': case 'e': case 'q': case 'z':  case 'b': case 'N': case 'I': case 'T':
             if (! options.param_window) {
                 fputs("No window was specified.\n", stderr);
                 return EXIT_FAILURE;
@@ -827,6 +829,49 @@
     return FALSE;
 }/*}}}*/
 
+/**
+ * Add the window manager decorations from the current window.
+ */
+static int window_show_decoration(Display *disp, Window win) {
+#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
+#define MWM_HINTS_DECORATIONS (1L << 1)
+  struct {
+    unsigned long flags;
+    unsigned long functions;
+    unsigned long decorations;
+    long inputMode;
+    unsigned long status;
+  } hints = {0,};
+
+  hints.flags = MWM_HINTS_DECORATIONS;
+  hints.decorations = 1;
+
+  XChangeProperty(disp, win, XInternAtom(disp,"_MOTIF_WM_HINTS", False), XInternAtom(disp, "_MOTIF_WM_HINTS", False), 32, PropModeReplace, (unsigned char *)&hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
+ return 1;
+}
+
+/**
+ * Remove the window manager decorations from the current window.
+ */
+static int window_hide_decoration(Display *disp, Window win) {
+#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
+#define MWM_HINTS_DECORATIONS (1L << 1)
+  struct {
+    unsigned long flags;
+    unsigned long functions;
+    unsigned long decorations;
+    long inputMode;
+    unsigned long status;
+  } hints = {0,};
+
+  hints.flags = MWM_HINTS_DECORATIONS;
+  hints.decorations = 0;
+
+  XChangeProperty(disp, win, XInternAtom(disp,"_MOTIF_WM_HINTS", False), XInternAtom(disp, "_MOTIF_WM_HINTS", False), 32, PropModeReplace, (unsigned char *)&hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
+ return 1;
+}
+
+
 static int window_move_resize (Display *disp, Window win, char *arg) {/*{{{*/
     signed long grav, x, y, w, h;
     unsigned long grflags;
@@ -886,6 +931,12 @@
         case 'e':
             /* resize/move the window around the desktop => -r -e */
             return window_move_resize(disp, win, options.param);
+        case 'q':
+            /* hide the window managers decoration */ 
+            return window_hide_decoration(disp, win);
+        case 'z':
+            /* show the window managers decoration */ 
+            return window_show_decoration(disp, win);
 
         case 'b':
             /* change state of a window => -r -b */
