? minimize.patch
Index: libwnck/window.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.c,v
retrieving revision 1.42
diff -u -r1.42 window.c
--- libwnck/window.c	2 Jan 2004 13:05:51 -0000	1.42
+++ libwnck/window.c	14 Jun 2004 02:33:55 -0000
@@ -759,7 +759,11 @@
 {
   g_return_if_fail (WNCK_IS_WINDOW (window));
 
-  _wnck_iconify (window->priv->xwindow);
+  _wnck_change_state (WNCK_SCREEN_XSCREEN (window->priv->screen),
+		      window->priv->xwindow,
+                      TRUE,
+                      _wnck_atom_get ("_NET_WM_STATE_MINIMIZED"),
+                      0);
 }
 
 void
@@ -767,7 +771,11 @@
 {
   g_return_if_fail (WNCK_IS_WINDOW (window));
 
-  _wnck_deiconify (window->priv->xwindow);
+  _wnck_change_state (WNCK_SCREEN_XSCREEN (window->priv->screen),
+		      window->priv->xwindow,
+                      FALSE,
+                      _wnck_atom_get ("_NET_WM_STATE_MINIMIZED"),
+                      0);
 }
 
 void
@@ -1540,6 +1548,7 @@
       window->priv->skip_taskbar = FALSE;
       window->priv->skip_pager = FALSE;
       window->priv->net_wm_state_hidden = FALSE;
+      window->priv->is_minimized = FALSE;
       
       atoms = NULL;
       n_atoms = 0;
@@ -1566,6 +1575,8 @@
             window->priv->skip_taskbar = TRUE;
           else if (atoms[i] == _wnck_atom_get ("_NET_WM_STATE_SKIP_PAGER"))
             window->priv->skip_pager = TRUE;
+          else if (atoms[i] == _wnck_atom_get ("_NET_WM_STATE_MINIMIZED"))
+            window->priv->is_minimized = TRUE;
 
           ++i;
         }
@@ -1620,17 +1631,9 @@
                                    "_NET_WM_STATE_HIDDEN"))
     {
       window->priv->is_hidden = window->priv->net_wm_state_hidden;
-
-      /* FIXME this is really broken; need to bring it up on
-       * wm-spec-list. It results in showing an "Unminimize" menu
-       * item on task list, for shaded windows.
-       */
-      window->priv->is_minimized = window->priv->is_hidden;
     }
   else
     {
-      window->priv->is_minimized = window->priv->wm_state_iconic;
-      
       window->priv->is_hidden = window->priv->is_minimized || window->priv->is_shaded;
     }
 }
Index: libwnck/xutils.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/xutils.c,v
retrieving revision 1.44
diff -u -r1.44 xutils.c
--- libwnck/xutils.c	19 Apr 2004 14:49:58 -0000	1.44
+++ libwnck/xutils.c	14 Jun 2004 02:34:04 -0000
@@ -801,33 +801,6 @@
 }
 
 void
-_wnck_iconify (Window xwindow)
-{
-  _wnck_error_trap_push ();
-  XIconifyWindow (gdk_display, xwindow, DefaultScreen (gdk_display));
-  _wnck_error_trap_pop ();
-}
-
-void
-_wnck_deiconify (Window xwindow)
-{
-  /* We need special precautions, because GDK doesn't like
-   * XMapWindow() called on its windows, need to use the
-   * GDK functions
-   */
-  GdkWindow *gdkwindow;
-
-  gdkwindow = gdk_xid_table_lookup (xwindow);
-
-  _wnck_error_trap_push ();
-  if (gdkwindow)
-    gdk_window_show (gdkwindow);
-  else
-    XMapRaised (gdk_display, xwindow);
-  _wnck_error_trap_pop ();
-}
-
-void
 _wnck_close (Screen *screen,
 	     Window  xwindow)
 {
Index: libwnck/xutils.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/xutils.h,v
retrieving revision 1.23
diff -u -r1.23 xutils.h
--- libwnck/xutils.h	4 Apr 2003 06:50:10 -0000	1.23
+++ libwnck/xutils.h	14 Jun 2004 02:34:05 -0000
@@ -84,9 +84,6 @@
                        gconstpointer v2);
 guint _wnck_xid_hash  (gconstpointer v);
 
-void _wnck_iconify   (Window xwindow);
-void _wnck_deiconify (Window xwindow);
-
 void _wnck_close     (Screen *screen,
 		      Window  xwindow);
 
