? libwnck/.window-action-menu.c.swp
Index: libwnck/window-action-menu.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window-action-menu.c,v
retrieving revision 1.16
diff -u -r1.16 window-action-menu.c
--- libwnck/window-action-menu.c	31 Jan 2005 20:45:24 -0000	1.16
+++ libwnck/window-action-menu.c	11 Feb 2005 12:35:09 -0000
@@ -30,7 +30,7 @@
   CLOSE,
   MINIMIZE,
   MAXIMIZE,
-  SHADE,
+  ABOVE,
   MOVE,
   RESIZE,
   PIN,
@@ -45,7 +45,7 @@
   GtkWidget *menu;
   GtkWidget *minimize_item;
   GtkWidget *maximize_item;
-  GtkWidget *shade_item;
+  GtkWidget *above_item;
   GtkWidget *move_item;
   GtkWidget *resize_item;
   GtkWidget *close_item;
@@ -126,11 +126,11 @@
       else
         wnck_window_maximize (amd->window);
       break;
-    case SHADE:
-      if (wnck_window_is_shaded (amd->window))
-        wnck_window_unshade (amd->window);
+    case ABOVE:
+      if (wnck_window_is_above (amd->window))
+        wnck_window_unmake_above (amd->window);
       else
-        wnck_window_shade (amd->window);
+        wnck_window_make_above (amd->window);
       break;
     case MOVE:
       wnck_window_keyboard_move (amd->window);
@@ -234,20 +234,18 @@
                                 (actions & WNCK_WINDOW_ACTION_MAXIMIZE) != 0);
     }
 
-  if (wnck_window_is_shaded (amd->window))
-    {
-      set_item_text (amd->shade_item, _("_Unroll"));
-      set_item_stock (amd->shade_item, NULL);
-      gtk_widget_set_sensitive (amd->shade_item,
-                                (actions & WNCK_WINDOW_ACTION_UNSHADE) != 0);
-    }
-  else
-    {
-      set_item_text (amd->shade_item, _("Roll _Up"));
-      set_item_stock (amd->shade_item, NULL);
-      gtk_widget_set_sensitive (amd->shade_item,
-                                (actions & WNCK_WINDOW_ACTION_SHADE) != 0);
-    }
+
+  g_signal_handlers_block_by_func (G_OBJECT (amd->above_item),
+		  		   item_activated_callback,
+				   GINT_TO_POINTER (ABOVE));
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (amd->above_item),
+				  wnck_window_is_above (amd->window));
+  g_signal_handlers_unblock_by_func (G_OBJECT (amd->above_item),
+		  		     item_activated_callback,
+				     GINT_TO_POINTER (ABOVE));
+
+  gtk_widget_set_sensitive (amd->above_item,
+                            (actions & WNCK_WINDOW_ACTION_ABOVE) != 0);
 
   if (wnck_window_is_pinned (amd->window))
     {
@@ -263,7 +261,7 @@
       gtk_widget_set_sensitive (amd->pin_item,
                                 (actions & WNCK_WINDOW_ACTION_CHANGE_WORKSPACE) != 0);
     }
-  
+
   gtk_widget_set_sensitive (amd->close_item,
                             (actions & WNCK_WINDOW_ACTION_CLOSE) != 0);
   
@@ -332,8 +330,11 @@
                 WindowAction    action)
 {
   GtkWidget *mi;
-  
-  mi = gtk_image_menu_item_new_with_label ("");
+
+  if (action == ABOVE)
+    mi = gtk_check_menu_item_new_with_label ("On _Top");
+  else
+    mi = gtk_image_menu_item_new_with_label ("");
   
   set_data (G_OBJECT (mi), amd);
   
@@ -471,10 +472,10 @@
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
                          amd->maximize_item);
 
-  amd->shade_item = make_menu_item (amd, SHADE);
-  
+  amd->above_item = make_menu_item (amd, ABOVE);
+
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
-                         amd->shade_item);
+                         amd->above_item);
 
   amd->move_item = make_menu_item (amd, MOVE);
   gtk_menu_shell_append (GTK_MENU_SHELL (menu),
Index: libwnck/window.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.c,v
retrieving revision 1.50
diff -u -r1.50 window.c
--- libwnck/window.c	22 Jan 2005 21:06:19 -0000	1.50
+++ libwnck/window.c	11 Feb 2005 12:35:16 -0000
@@ -47,7 +47,8 @@
     ((window)->priv->is_sticky           << 6) |        \
     ((window)->priv->is_hidden           << 7) |        \
     ((window)->priv->is_fullscreen       << 8) |        \
-    ((window)->priv->demands_attention   << 9) )
+    ((window)->priv->demands_attention   << 9) |	\
+    ((window)->priv->is_above            << 10))
 
 struct _WnckWindowPrivate
 {
@@ -94,6 +95,7 @@
   guint is_maximized_horz : 1;
   guint is_maximized_vert : 1;
   guint is_shaded : 1;
+  guint is_above : 1;
   guint skip_pager : 1;
   guint skip_taskbar : 1;
   guint is_sticky : 1;
@@ -708,6 +710,14 @@
 }
 
 gboolean
+wnck_window_is_above                  (WnckWindow *window)
+{
+  g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE);
+
+  return window->priv->is_above;
+}
+
+gboolean
 wnck_window_is_skip_pager             (WnckWindow *window)
 {
   g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE);
@@ -910,6 +920,31 @@
 }
 
 void
+wnck_window_make_above              (WnckWindow *window)
+{
+  g_return_if_fail (WNCK_IS_WINDOW (window));
+
+  _wnck_change_state (WNCK_SCREEN_XSCREEN (window->priv->screen),
+		      window->priv->xwindow,
+                      TRUE,
+                      _wnck_atom_get ("_NET_WM_STATE_ABOVE"),
+                      0);
+}
+
+void
+wnck_window_unmake_above            (WnckWindow *window)
+{
+  g_return_if_fail (WNCK_IS_WINDOW (window));
+
+  _wnck_change_state (WNCK_SCREEN_XSCREEN (window->priv->screen),
+		      window->priv->xwindow,
+                      FALSE,
+                      _wnck_atom_get ("_NET_WM_STATE_ABOVE"),
+                      0);
+}
+
+
+void
 wnck_window_stick                   (WnckWindow *window)
 {
   g_return_if_fail (WNCK_IS_WINDOW (window));
@@ -1650,6 +1685,7 @@
       window->priv->is_maximized_vert = FALSE;
       window->priv->is_sticky = FALSE;
       window->priv->is_shaded = FALSE;
+      window->priv->is_above = FALSE;
       window->priv->skip_taskbar = FALSE;
       window->priv->skip_pager = FALSE;
       window->priv->net_wm_state_hidden = FALSE;
@@ -1674,6 +1710,8 @@
             window->priv->is_sticky = TRUE;
           else if (atoms[i] == _wnck_atom_get ("_NET_WM_STATE_SHADED"))
             window->priv->is_shaded = TRUE;
+          else if (atoms[i] == _wnck_atom_get ("_NET_WM_STATE_ABOVE"))
+            window->priv->is_above = TRUE;
           else if (atoms[i] == _wnck_atom_get ("_NET_WM_STATE_FULLSCREEN"))
             window->priv->is_fullscreen = TRUE;
           else if (atoms[i] == _wnck_atom_get ("_NET_WM_STATE_SKIP_TASKBAR"))
@@ -1842,6 +1880,7 @@
                 WNCK_WINDOW_ACTION_MOVE                    |
                 WNCK_WINDOW_ACTION_RESIZE                  |
                 WNCK_WINDOW_ACTION_SHADE                   |
+                WNCK_WINDOW_ACTION_ABOVE                   |
                 WNCK_WINDOW_ACTION_STICK                   |
                 WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY   |
                 WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY     |
Index: libwnck/window.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.h,v
retrieving revision 1.29
diff -u -r1.29 window.h
--- libwnck/window.h	22 Jan 2005 21:06:19 -0000	1.29
+++ libwnck/window.h	11 Feb 2005 12:35:18 -0000
@@ -43,7 +43,8 @@
   WNCK_WINDOW_STATE_STICKY                 = 1 << 6,
   WNCK_WINDOW_STATE_HIDDEN                 = 1 << 7,
   WNCK_WINDOW_STATE_FULLSCREEN             = 1 << 8,
-  WNCK_WINDOW_STATE_DEMANDS_ATTENTION      = 1 << 9
+  WNCK_WINDOW_STATE_DEMANDS_ATTENTION      = 1 << 9,
+  WNCK_WINDOW_STATE_ABOVE                  = 1 << 10
 } WnckWindowState;
 
 typedef enum
@@ -64,7 +65,8 @@
   WNCK_WINDOW_ACTION_UNMINIMIZE              = 1 << 13,
   WNCK_WINDOW_ACTION_MAXIMIZE                = 1 << 14,
   WNCK_WINDOW_ACTION_UNMAXIMIZE              = 1 << 15,
-  WNCK_WINDOW_ACTION_FULLSCREEN              = 1 << 16
+  WNCK_WINDOW_ACTION_FULLSCREEN              = 1 << 16,
+  WNCK_WINDOW_ACTION_ABOVE                   = 1 << 17
 } WnckWindowActions;
 
 typedef enum
@@ -153,6 +155,7 @@
 gboolean wnck_window_is_maximized_vertically   (WnckWindow *window);
 gboolean wnck_window_is_maximized              (WnckWindow *window);
 gboolean wnck_window_is_shaded                 (WnckWindow *window);
+gboolean wnck_window_is_above                  (WnckWindow *window);
 gboolean wnck_window_is_skip_pager             (WnckWindow *window);
 gboolean wnck_window_is_skip_tasklist          (WnckWindow *window);
 gboolean wnck_window_is_fullscreen                 (WnckWindow *window);
@@ -178,6 +181,8 @@
 void wnck_window_unmaximize_vertically   (WnckWindow *window);
 void wnck_window_shade                   (WnckWindow *window);
 void wnck_window_unshade                 (WnckWindow *window);
+void wnck_window_make_above              (WnckWindow *window);
+void wnck_window_unmake_above            (WnckWindow *window);
 void wnck_window_stick                   (WnckWindow *window);
 void wnck_window_unstick                 (WnckWindow *window);
 void wnck_window_keyboard_move           (WnckWindow *window);
