diff -ru a/wmctrl-1.07/main.c b/wmctrl-1.07/main.c
--- a/wmctrl-1.07/main.c	2005-01-29 04:31:33.000000000 +0100
+++ b/wmctrl-1.07/main.c	2008-08-19 09:42:05.000000000 +0200
@@ -62,6 +62,10 @@
 "                       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" \
+"  -W                   Show the title of the current active window\n"  \
+"  -X                   Print desktopid\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" \
@@ -220,6 +224,8 @@
 static int window_state (Display *disp, Window win, char *arg);
 static Window Select_Window(Display *dpy);
 static Window get_active_window(Display *dpy);
+void disp_name(Display *disp);
+void show_desktop_id(Display *disp);
 
 /*}}}*/
    
@@ -264,7 +270,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, "XFGWVvhlquzpidmxa: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 +302,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;
@@ -355,8 +361,14 @@
         case 'm':
             ret = wm_info(disp);
             break;
+	case 'W':
+	    disp_name(disp);
+	    break;
+	case 'X':
+	    show_desktop_id(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;
@@ -575,6 +587,20 @@
         state, 0, 0, 0, 0);
 }/*}}}*/
 
+void disp_name(Display *disp) {
+	Window win=(Window)0;
+  unsigned long *pid=0;
+	win=get_active_window(disp);
+	gchar *title_utf8 = get_window_title(disp, win);
+  pid = (unsigned long *)get_property(disp, win, XA_CARDINAL, "_NET_WM_PID", NULL);
+  if(options.match_by_id) {
+	  printf("0x%.8lx\n", win);
+  } else {
+	  printf("%s\n", title_utf8);
+  }
+	return;
+}
+
 static int change_viewport (Display *disp) {/*{{{*/
     unsigned long x, y;
     const char *argerr = "The -o option expects two integers separated with a comma.\n";
@@ -677,6 +703,14 @@
     
 }/*}}}*/
 
+void show_desktop_id(Display *disp) {
+  Window root = DefaultRootWindow(disp);
+    unsigned long *cur_desktop = NULL;
+  cur_desktop = (unsigned long *)get_property(disp, root, XA_CARDINAL, "_NET_CURRENT_DESKTOP", NULL);
+  printf("%lu\n", *cur_desktop);
+return;
+}
+
 static int window_to_desktop (Display *disp, Window win, int desktop) {/*{{{*/
     unsigned long *cur_desktop = NULL;
     Window root = DefaultRootWindow(disp);
@@ -827,6 +861,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 +963,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 */
