[metacity/remove-unused-or-broken-buttons: 7/7] libmetacity: remove shade, stick and above buttons



commit fbe4ece42047932e8a16c2eb3dbc12e615775b11
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Mar 19 03:24:47 2020 +0200

    libmetacity: remove shade, stick and above buttons
    
    1) These buttons are broken with default GTK theme. As nobody has
    reported bug I assume these buttons are unused. GTK is default
    theme type since 3.2.0.
    
    2) These buttons are not supported by client side decorated
    windows.
    
    3) Few Metacity themes I checked had no icons for these buttons.
    They had empty draw_ops...
    
    4) These buttons has been removed also from Mutter.
    
    Functionality itself is not removed! Still available using window
    menu and/or keybindings.

 libmetacity/meta-button-layout.c  |  57 +----------
 libmetacity/meta-button.h         |   6 --
 libmetacity/meta-theme-gtk.c      |   6 --
 libmetacity/meta-theme-impl.c     |  36 -------
 libmetacity/meta-theme-metacity.c |  55 -----------
 src/core/display.c                |  48 ---------
 src/core/keybindings.c            |  12 ---
 src/core/window.c                 |  18 ----
 src/include/common.h              |   8 +-
 src/ui/frames.c                   | 200 +-------------------------------------
 src/ui/frames.h                   |   6 --
 11 files changed, 3 insertions(+), 449 deletions(-)
---
diff --git a/libmetacity/meta-button-layout.c b/libmetacity/meta-button-layout.c
index 6aded451..9fab1014 100644
--- a/libmetacity/meta-button-layout.c
+++ b/libmetacity/meta-button-layout.c
@@ -31,57 +31,12 @@ type_from_string (const gchar *str)
     return META_BUTTON_TYPE_MAXIMIZE;
   else if (g_strcmp0 (str, "close") == 0)
     return META_BUTTON_TYPE_CLOSE;
-  else if (g_strcmp0 (str, "shade") == 0)
-    return META_BUTTON_TYPE_SHADE;
-  else if (g_strcmp0 (str, "unshade") == 0)
-    return META_BUTTON_TYPE_UNSHADE;
-  else if (g_strcmp0 (str, "above") == 0)
-    return META_BUTTON_TYPE_ABOVE;
-  else if (g_strcmp0 (str, "unabove") == 0)
-    return META_BUTTON_TYPE_UNABOVE;
-  else if (g_strcmp0 (str, "stick") == 0)
-    return META_BUTTON_TYPE_STICK;
-  else if (g_strcmp0 (str, "unstick") == 0)
-    return META_BUTTON_TYPE_UNSTICK;
   else if (g_strcmp0 (str, "spacer") == 0)
     return META_BUTTON_TYPE_SPACER;
 
   return META_BUTTON_TYPE_LAST;
 }
 
-static MetaButtonType
-get_opposite_type (MetaButtonType type)
-{
-  switch (type)
-    {
-      case META_BUTTON_TYPE_SHADE:
-        return META_BUTTON_TYPE_UNSHADE;
-      case META_BUTTON_TYPE_UNSHADE:
-        return META_BUTTON_TYPE_SHADE;
-
-      case META_BUTTON_TYPE_ABOVE:
-        return META_BUTTON_TYPE_UNABOVE;
-      case META_BUTTON_TYPE_UNABOVE:
-        return META_BUTTON_TYPE_ABOVE;
-
-      case META_BUTTON_TYPE_STICK:
-        return META_BUTTON_TYPE_UNSTICK;
-      case META_BUTTON_TYPE_UNSTICK:
-        return META_BUTTON_TYPE_STICK;
-
-      case META_BUTTON_TYPE_MENU:
-      case META_BUTTON_TYPE_MINIMIZE:
-      case META_BUTTON_TYPE_MAXIMIZE:
-      case META_BUTTON_TYPE_CLOSE:
-      case META_BUTTON_TYPE_SPACER:
-      case META_BUTTON_TYPE_LAST:
-      default:
-        break;
-    }
-
-  return META_BUTTON_TYPE_LAST;
-}
-
 static MetaButton *
 string_to_buttons (const gchar *str,
                    gint        *n_buttons)
@@ -106,10 +61,7 @@ string_to_buttons (const gchar *str,
 
       if (type != META_BUTTON_TYPE_LAST)
         {
-          if (get_opposite_type (type) != META_BUTTON_TYPE_LAST)
-            *n_buttons += 2;
-          else
-            *n_buttons += 1;
+          *n_buttons += 1;
         }
       else
         {
@@ -143,13 +95,6 @@ string_to_buttons (const gchar *str,
           tmp.visible = TRUE;
 
           retval[index++] = tmp;
-
-          type = get_opposite_type (type);
-          if (type != META_BUTTON_TYPE_LAST)
-            {
-              tmp.type = type;
-              retval[index++] = tmp;
-            }
         }
     }
 
diff --git a/libmetacity/meta-button.h b/libmetacity/meta-button.h
index c591719c..f1d631b3 100644
--- a/libmetacity/meta-button.h
+++ b/libmetacity/meta-button.h
@@ -29,12 +29,6 @@ typedef enum
   META_BUTTON_TYPE_MINIMIZE,
   META_BUTTON_TYPE_MAXIMIZE,
   META_BUTTON_TYPE_CLOSE,
-  META_BUTTON_TYPE_SHADE,
-  META_BUTTON_TYPE_UNSHADE,
-  META_BUTTON_TYPE_ABOVE,
-  META_BUTTON_TYPE_UNABOVE,
-  META_BUTTON_TYPE_STICK,
-  META_BUTTON_TYPE_UNSTICK,
   META_BUTTON_TYPE_SPACER,
   META_BUTTON_TYPE_LAST
 } MetaButtonType;
diff --git a/libmetacity/meta-theme-gtk.c b/libmetacity/meta-theme-gtk.c
index 4ee117c5..80939a19 100644
--- a/libmetacity/meta-theme-gtk.c
+++ b/libmetacity/meta-theme-gtk.c
@@ -849,12 +849,6 @@ meta_theme_gtk_draw_frame (MetaThemeImpl           *impl,
               case META_BUTTON_TYPE_MENU:
                 icon_name = "open-menu-symbolic";
                 break;
-              case META_BUTTON_TYPE_SHADE:
-              case META_BUTTON_TYPE_ABOVE:
-              case META_BUTTON_TYPE_STICK:
-              case META_BUTTON_TYPE_UNSHADE:
-              case META_BUTTON_TYPE_UNABOVE:
-              case META_BUTTON_TYPE_UNSTICK:
               case META_BUTTON_TYPE_SPACER:
               case META_BUTTON_TYPE_LAST:
               default:
diff --git a/libmetacity/meta-theme-impl.c b/libmetacity/meta-theme-impl.c
index 68a98985..cb8418ad 100644
--- a/libmetacity/meta-theme-impl.c
+++ b/libmetacity/meta-theme-impl.c
@@ -137,36 +137,6 @@ is_button_visible (MetaButton     *button,
           visible = TRUE;
         break;
 
-      case META_BUTTON_TYPE_SHADE:
-        if ((flags & META_FRAME_ALLOWS_SHADE) && !(flags & META_FRAME_SHADED))
-          visible = TRUE;
-        break;
-
-      case META_BUTTON_TYPE_ABOVE:
-        if (!(flags & META_FRAME_ABOVE))
-          visible = TRUE;
-        break;
-
-      case META_BUTTON_TYPE_STICK:
-        if (!(flags & META_FRAME_STUCK))
-          visible = TRUE;
-        break;
-
-      case META_BUTTON_TYPE_UNSHADE:
-        if ((flags & META_FRAME_ALLOWS_SHADE) && (flags & META_FRAME_SHADED))
-          visible = TRUE;
-        break;
-
-      case META_BUTTON_TYPE_UNABOVE:
-        if (flags & META_FRAME_ABOVE)
-          visible = TRUE;
-        break;
-
-      case META_BUTTON_TYPE_UNSTICK:
-        if (flags & META_FRAME_STUCK)
-          visible = TRUE;
-        break;
-
       case META_BUTTON_TYPE_SPACER:
         visible = TRUE;
         break;
@@ -208,12 +178,6 @@ strip_buttons (MetaButtonLayout *layout,
   gint i;
 
   count = 0;
-  types[count++] = META_BUTTON_TYPE_ABOVE;
-  types[count++] = META_BUTTON_TYPE_UNABOVE;
-  types[count++] = META_BUTTON_TYPE_STICK;
-  types[count++] = META_BUTTON_TYPE_UNSTICK;
-  types[count++] = META_BUTTON_TYPE_SHADE;
-  types[count++] = META_BUTTON_TYPE_UNSHADE;
   types[count++] = META_BUTTON_TYPE_MINIMIZE;
   types[count++] = META_BUTTON_TYPE_MAXIMIZE;
   types[count++] = META_BUTTON_TYPE_CLOSE;
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index a9df246d..831086c6 100644
--- a/libmetacity/meta-theme-metacity.c
+++ b/libmetacity/meta-theme-metacity.c
@@ -4799,30 +4799,6 @@ static gboolean
 is_button_allowed (MetaThemeMetacity *metacity,
                    MetaButtonType     type)
 {
-  if (theme_allows (metacity, META_THEME_SHADE_STICK_ABOVE_BUTTONS))
-    {
-      switch (type)
-        {
-          case META_BUTTON_TYPE_SHADE:
-          case META_BUTTON_TYPE_ABOVE:
-          case META_BUTTON_TYPE_STICK:
-          case META_BUTTON_TYPE_UNSHADE:
-          case META_BUTTON_TYPE_UNABOVE:
-          case META_BUTTON_TYPE_UNSTICK:
-            return TRUE;
-
-          case META_BUTTON_TYPE_MENU:
-          case META_BUTTON_TYPE_MINIMIZE:
-          case META_BUTTON_TYPE_MAXIMIZE:
-          case META_BUTTON_TYPE_CLOSE:
-          case META_BUTTON_TYPE_SPACER:
-          case META_BUTTON_TYPE_LAST:
-          default:
-            break;
-        }
-    }
-
-  /* now consider the buttons which exist in all versions */
   switch (type)
     {
       case META_BUTTON_TYPE_MENU:
@@ -4832,19 +4808,6 @@ is_button_allowed (MetaThemeMetacity *metacity,
       case META_BUTTON_TYPE_SPACER:
         return TRUE;
 
-      case META_BUTTON_TYPE_STICK:
-      case META_BUTTON_TYPE_SHADE:
-      case META_BUTTON_TYPE_ABOVE:
-      case META_BUTTON_TYPE_UNSTICK:
-      case META_BUTTON_TYPE_UNSHADE:
-      case META_BUTTON_TYPE_UNABOVE:
-        /* we are being asked for a >v1 button which hasn't been handled yet,
-         * so obviously we're not in a theme which supports that version.
-         * therefore, we don't show the button. return NULL and all will
-         * be well.
-         */
-        break;
-
       case META_BUTTON_TYPE_LAST:
       default:
         break;
@@ -5319,24 +5282,6 @@ get_button_function (MetaButtonType type,
     {
       switch (type)
         {
-          case META_BUTTON_TYPE_SHADE:
-            return META_BUTTON_FUNCTION_SHADE;
-
-          case META_BUTTON_TYPE_UNSHADE:
-            return META_BUTTON_FUNCTION_UNSHADE;
-
-          case META_BUTTON_TYPE_ABOVE:
-            return META_BUTTON_FUNCTION_ABOVE;
-
-          case META_BUTTON_TYPE_UNABOVE:
-            return META_BUTTON_FUNCTION_UNABOVE;
-
-          case META_BUTTON_TYPE_STICK:
-            return META_BUTTON_FUNCTION_STICK;
-
-          case META_BUTTON_TYPE_UNSTICK:
-            return META_BUTTON_FUNCTION_UNSTICK;
-
           case META_BUTTON_TYPE_MENU:
             return META_BUTTON_FUNCTION_MENU;
 
diff --git a/src/core/display.c b/src/core/display.c
index abf22b60..196d7c87 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1082,12 +1082,6 @@ grab_op_is_mouse_only (MetaGrabOp op)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       return FALSE;
 
     default:
@@ -1134,12 +1128,6 @@ meta_grab_op_is_mouse (MetaGrabOp op)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       return FALSE;
 
     default:
@@ -1186,12 +1174,6 @@ grab_op_is_keyboard (MetaGrabOp op)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       return FALSE;
 
     default:
@@ -1238,12 +1220,6 @@ meta_grab_op_is_resizing (MetaGrabOp op)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       return FALSE;
 
     default:
@@ -1290,12 +1266,6 @@ meta_grab_op_is_moving (MetaGrabOp op)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       return FALSE;
 
     default:
@@ -3462,12 +3432,6 @@ xcursor_for_op (MetaDisplay *display,
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       break;
 
     default:
@@ -3788,12 +3752,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       break;
 
     default:
@@ -4821,12 +4779,6 @@ meta_resize_gravity_from_grab_op (MetaGrabOp op)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       break;
     default:
       break;
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index b46a4c27..63766e19 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1351,12 +1351,6 @@ meta_display_process_key_event (MetaDisplay *display,
             case META_GRAB_OP_CLICKING_UNMAXIMIZE:
             case META_GRAB_OP_CLICKING_DELETE:
             case META_GRAB_OP_CLICKING_MENU:
-            case META_GRAB_OP_CLICKING_SHADE:
-            case META_GRAB_OP_CLICKING_UNSHADE:
-            case META_GRAB_OP_CLICKING_ABOVE:
-            case META_GRAB_OP_CLICKING_UNABOVE:
-            case META_GRAB_OP_CLICKING_STICK:
-            case META_GRAB_OP_CLICKING_UNSTICK:
               break;
 
             default:
@@ -1689,12 +1683,6 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       g_assert_not_reached ();
       break;
 
diff --git a/src/core/window.c b/src/core/window.c
index fefbbd67..1e9ab98e 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4853,12 +4853,6 @@ meta_window_move_resize_request (MetaWindow *window,
         case META_GRAB_OP_CLICKING_UNMAXIMIZE:
         case META_GRAB_OP_CLICKING_DELETE:
         case META_GRAB_OP_CLICKING_MENU:
-        case META_GRAB_OP_CLICKING_SHADE:
-        case META_GRAB_OP_CLICKING_UNSHADE:
-        case META_GRAB_OP_CLICKING_ABOVE:
-        case META_GRAB_OP_CLICKING_UNABOVE:
-        case META_GRAB_OP_CLICKING_STICK:
-        case META_GRAB_OP_CLICKING_UNSTICK:
           break;
         default:
           break;
@@ -7983,12 +7977,6 @@ meta_window_update_sync_request_counter (MetaWindow *window,
         case META_GRAB_OP_CLICKING_UNMAXIMIZE:
         case META_GRAB_OP_CLICKING_DELETE:
         case META_GRAB_OP_CLICKING_MENU:
-        case META_GRAB_OP_CLICKING_SHADE:
-        case META_GRAB_OP_CLICKING_UNSHADE:
-        case META_GRAB_OP_CLICKING_ABOVE:
-        case META_GRAB_OP_CLICKING_UNABOVE:
-        case META_GRAB_OP_CLICKING_STICK:
-        case META_GRAB_OP_CLICKING_UNSTICK:
           break;
 
         default:
@@ -8283,12 +8271,6 @@ meta_window_refresh_resize_popup (MetaWindow *window)
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
     case META_GRAB_OP_CLICKING_DELETE:
     case META_GRAB_OP_CLICKING_MENU:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       /* Not resizing */
       return;
 
diff --git a/src/include/common.h b/src/include/common.h
index 3399b2ea..3027c106 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -116,13 +116,7 @@ typedef enum
   META_GRAB_OP_CLICKING_MAXIMIZE,
   META_GRAB_OP_CLICKING_UNMAXIMIZE,
   META_GRAB_OP_CLICKING_DELETE,
-  META_GRAB_OP_CLICKING_MENU,
-  META_GRAB_OP_CLICKING_SHADE,
-  META_GRAB_OP_CLICKING_UNSHADE,
-  META_GRAB_OP_CLICKING_ABOVE,
-  META_GRAB_OP_CLICKING_UNABOVE,
-  META_GRAB_OP_CLICKING_STICK,
-  META_GRAB_OP_CLICKING_UNSTICK
+  META_GRAB_OP_CLICKING_MENU
 } MetaGrabOp;
 
 typedef enum
diff --git a/src/ui/frames.c b/src/ui/frames.c
index 5af197a6..35237cd4 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -172,24 +172,6 @@ get_control (MetaFrames  *frames,
             else
               return META_FRAME_CONTROL_MAXIMIZE;
 
-          case META_BUTTON_TYPE_SHADE:
-            return META_FRAME_CONTROL_SHADE;
-
-          case META_BUTTON_TYPE_UNSHADE:
-            return META_FRAME_CONTROL_UNSHADE;
-
-          case META_BUTTON_TYPE_ABOVE:
-            return META_FRAME_CONTROL_ABOVE;
-
-          case META_BUTTON_TYPE_UNABOVE:
-            return META_FRAME_CONTROL_UNABOVE;
-
-          case META_BUTTON_TYPE_STICK:
-            return META_FRAME_CONTROL_STICK;
-
-          case META_BUTTON_TYPE_UNSTICK:
-            return META_FRAME_CONTROL_UNSTICK;
-
           case META_BUTTON_TYPE_SPACER:
           case META_BUTTON_TYPE_LAST:
           default:
@@ -315,30 +297,6 @@ get_control_rect (MetaFrames        *frames,
         type = META_BUTTON_TYPE_MAXIMIZE;
         break;
 
-      case META_FRAME_CONTROL_SHADE:
-        type = META_BUTTON_TYPE_SHADE;
-        break;
-
-      case META_FRAME_CONTROL_UNSHADE:
-        type = META_BUTTON_TYPE_UNSHADE;
-        break;
-
-      case META_FRAME_CONTROL_ABOVE:
-        type = META_BUTTON_TYPE_ABOVE;
-        break;
-
-      case META_FRAME_CONTROL_UNABOVE:
-        type = META_BUTTON_TYPE_UNABOVE;
-        break;
-
-      case META_FRAME_CONTROL_STICK:
-        type = META_BUTTON_TYPE_STICK;
-        break;
-
-      case META_FRAME_CONTROL_UNSTICK:
-        type = META_BUTTON_TYPE_UNSTICK;
-        break;
-
       case META_FRAME_CONTROL_CLIENT_AREA:
       case META_FRAME_CONTROL_RESIZE_SE:
       case META_FRAME_CONTROL_RESIZE_S:
@@ -1308,24 +1266,6 @@ show_tip_now (MetaFrames *frames)
     case META_FRAME_CONTROL_UNMAXIMIZE:
       tiptext = _("Restore Window");
       break;
-    case META_FRAME_CONTROL_SHADE:
-      tiptext = _("Roll Up Window");
-      break;
-    case META_FRAME_CONTROL_UNSHADE:
-      tiptext = _("Unroll Window");
-      break;
-    case META_FRAME_CONTROL_ABOVE:
-      tiptext = _("Keep Window On Top");
-      break;
-    case META_FRAME_CONTROL_UNABOVE:
-      tiptext = _("Remove Window From Top");
-      break;
-    case META_FRAME_CONTROL_STICK:
-      tiptext = _("Always On Visible Workspace");
-      break;
-    case META_FRAME_CONTROL_UNSTICK:
-      tiptext = _("Put Window On Only One Workspace");
-      break;
     case META_FRAME_CONTROL_RESIZE_SE:
       break;
     case META_FRAME_CONTROL_RESIZE_S:
@@ -1487,12 +1427,6 @@ update_prelit_control (MetaFrames       *frames,
       case META_FRAME_CONTROL_MINIMIZE:
       case META_FRAME_CONTROL_MAXIMIZE:
       case META_FRAME_CONTROL_UNMAXIMIZE:
-      case META_FRAME_CONTROL_SHADE:
-      case META_FRAME_CONTROL_UNSHADE:
-      case META_FRAME_CONTROL_ABOVE:
-      case META_FRAME_CONTROL_UNABOVE:
-      case META_FRAME_CONTROL_STICK:
-      case META_FRAME_CONTROL_UNSTICK:
       default:
         cursor = META_CURSOR_DEFAULT;
         break;
@@ -1507,12 +1441,6 @@ update_prelit_control (MetaFrames       *frames,
       case META_FRAME_CONTROL_MINIMIZE:
       case META_FRAME_CONTROL_MAXIMIZE:
       case META_FRAME_CONTROL_DELETE:
-      case META_FRAME_CONTROL_SHADE:
-      case META_FRAME_CONTROL_UNSHADE:
-      case META_FRAME_CONTROL_ABOVE:
-      case META_FRAME_CONTROL_UNABOVE:
-      case META_FRAME_CONTROL_STICK:
-      case META_FRAME_CONTROL_UNSTICK:
       case META_FRAME_CONTROL_UNMAXIMIZE:
         /* leave control set */
         break;
@@ -1744,12 +1672,6 @@ meta_frames_button_press_event (GtkWidget      *widget,
        control == META_FRAME_CONTROL_UNMAXIMIZE ||
        control == META_FRAME_CONTROL_MINIMIZE ||
        control == META_FRAME_CONTROL_DELETE ||
-       control == META_FRAME_CONTROL_SHADE ||
-       control == META_FRAME_CONTROL_UNSHADE ||
-       control == META_FRAME_CONTROL_ABOVE ||
-       control == META_FRAME_CONTROL_UNABOVE ||
-       control == META_FRAME_CONTROL_STICK ||
-       control == META_FRAME_CONTROL_UNSTICK ||
        control == META_FRAME_CONTROL_MENU))
     {
       MetaGrabOp op = META_GRAB_OP_NONE;
@@ -1764,18 +1686,6 @@ meta_frames_button_press_event (GtkWidget      *widget,
         op = META_GRAB_OP_CLICKING_DELETE;
       else if (control == META_FRAME_CONTROL_MENU)
         op = META_GRAB_OP_CLICKING_MENU;
-      else if (control == META_FRAME_CONTROL_SHADE)
-        op = META_GRAB_OP_CLICKING_SHADE;
-      else if (control == META_FRAME_CONTROL_UNSHADE)
-        op = META_GRAB_OP_CLICKING_UNSHADE;
-      else if (control == META_FRAME_CONTROL_ABOVE)
-        op = META_GRAB_OP_CLICKING_ABOVE;
-      else if (control == META_FRAME_CONTROL_UNABOVE)
-        op = META_GRAB_OP_CLICKING_UNABOVE;
-      else if (control == META_FRAME_CONTROL_STICK)
-        op = META_GRAB_OP_CLICKING_STICK;
-      else if (control == META_FRAME_CONTROL_UNSTICK)
-        op = META_GRAB_OP_CLICKING_UNSTICK;
       else
         g_assert_not_reached ();
 
@@ -1993,48 +1903,6 @@ meta_frames_button_release_event    (GtkWidget           *widget,
           meta_core_end_grab_op (frames->xdisplay, event->time);
           break;
 
-        case META_GRAB_OP_CLICKING_SHADE:
-          if (control == META_FRAME_CONTROL_SHADE)
-            meta_core_shade (frames->xdisplay, frame->xwindow, event->time);
-
-          meta_core_end_grab_op (frames->xdisplay, event->time);
-          break;
-
-        case META_GRAB_OP_CLICKING_UNSHADE:
-          if (control == META_FRAME_CONTROL_UNSHADE)
-            meta_core_unshade (frames->xdisplay, frame->xwindow, event->time);
-
-          meta_core_end_grab_op (frames->xdisplay, event->time);
-          break;
-
-        case META_GRAB_OP_CLICKING_ABOVE:
-          if (control == META_FRAME_CONTROL_ABOVE)
-            meta_core_make_above (frames->xdisplay, frame->xwindow);
-
-          meta_core_end_grab_op (frames->xdisplay, event->time);
-          break;
-
-        case META_GRAB_OP_CLICKING_UNABOVE:
-          if (control == META_FRAME_CONTROL_UNABOVE)
-            meta_core_unmake_above (frames->xdisplay, frame->xwindow);
-
-          meta_core_end_grab_op (frames->xdisplay, event->time);
-          break;
-
-        case META_GRAB_OP_CLICKING_STICK:
-          if (control == META_FRAME_CONTROL_STICK)
-            meta_core_stick (frames->xdisplay, frame->xwindow);
-
-          meta_core_end_grab_op (frames->xdisplay, event->time);
-          break;
-
-        case META_GRAB_OP_CLICKING_UNSTICK:
-          if (control == META_FRAME_CONTROL_UNSTICK)
-            meta_core_unstick (frames->xdisplay, frame->xwindow);
-
-          meta_core_end_grab_op (frames->xdisplay, event->time);
-          break;
-
         case META_GRAB_OP_NONE:
         case META_GRAB_OP_MOVING:
         case META_GRAB_OP_RESIZING_SE:
@@ -2106,12 +1974,6 @@ meta_frames_motion_notify_event     (GtkWidget           *widget,
     case META_GRAB_OP_CLICKING_MINIMIZE:
     case META_GRAB_OP_CLICKING_MAXIMIZE:
     case META_GRAB_OP_CLICKING_UNMAXIMIZE:
-    case META_GRAB_OP_CLICKING_SHADE:
-    case META_GRAB_OP_CLICKING_UNSHADE:
-    case META_GRAB_OP_CLICKING_ABOVE:
-    case META_GRAB_OP_CLICKING_UNABOVE:
-    case META_GRAB_OP_CLICKING_STICK:
-    case META_GRAB_OP_CLICKING_UNSTICK:
       {
         MetaFrameControl control;
         int x, y;
@@ -2132,19 +1994,7 @@ meta_frames_motion_notify_event     (GtkWidget           *widget,
                ((control == META_FRAME_CONTROL_MAXIMIZE ||
                  control == META_FRAME_CONTROL_UNMAXIMIZE) &&
                 (grab_op == META_GRAB_OP_CLICKING_MAXIMIZE ||
-                 grab_op == META_GRAB_OP_CLICKING_UNMAXIMIZE)) ||
-               (control == META_FRAME_CONTROL_SHADE &&
-                grab_op == META_GRAB_OP_CLICKING_SHADE) ||
-               (control == META_FRAME_CONTROL_UNSHADE &&
-                grab_op == META_GRAB_OP_CLICKING_UNSHADE) ||
-               (control == META_FRAME_CONTROL_ABOVE &&
-                grab_op == META_GRAB_OP_CLICKING_ABOVE) ||
-               (control == META_FRAME_CONTROL_UNABOVE &&
-                grab_op == META_GRAB_OP_CLICKING_UNABOVE) ||
-               (control == META_FRAME_CONTROL_STICK &&
-                grab_op == META_GRAB_OP_CLICKING_STICK) ||
-               (control == META_FRAME_CONTROL_UNSTICK &&
-                grab_op == META_GRAB_OP_CLICKING_UNSTICK)))
+                 grab_op == META_GRAB_OP_CLICKING_UNMAXIMIZE))))
            control = META_FRAME_CONTROL_NONE;
 
         /* Update prelit control and cursor */
@@ -2527,54 +2377,6 @@ update_button_state (MetaButtonType type,
       else
         state = META_BUTTON_STATE_PRELIGHT;
     }
-  else if (control == META_FRAME_CONTROL_SHADE &&
-           type == META_BUTTON_TYPE_SHADE)
-    {
-      if (grab_op == META_GRAB_OP_CLICKING_SHADE)
-        state = META_BUTTON_STATE_PRESSED;
-      else
-        state = META_BUTTON_STATE_PRELIGHT;
-    }
-  else if (control == META_FRAME_CONTROL_UNSHADE &&
-           type == META_BUTTON_TYPE_UNSHADE)
-    {
-      if (grab_op == META_GRAB_OP_CLICKING_UNSHADE)
-        state = META_BUTTON_STATE_PRESSED;
-      else
-        state = META_BUTTON_STATE_PRELIGHT;
-    }
-  else if (control == META_FRAME_CONTROL_ABOVE &&
-           type == META_BUTTON_TYPE_ABOVE)
-    {
-      if (grab_op == META_GRAB_OP_CLICKING_ABOVE)
-        state = META_BUTTON_STATE_PRESSED;
-      else
-        state = META_BUTTON_STATE_PRELIGHT;
-    }
-  else if (control == META_FRAME_CONTROL_UNABOVE &&
-           type == META_BUTTON_TYPE_UNABOVE)
-    {
-      if (grab_op == META_GRAB_OP_CLICKING_UNABOVE)
-        state = META_BUTTON_STATE_PRESSED;
-      else
-        state = META_BUTTON_STATE_PRELIGHT;
-    }
-  else if (control == META_FRAME_CONTROL_STICK &&
-           type == META_BUTTON_TYPE_STICK)
-    {
-      if (grab_op == META_GRAB_OP_CLICKING_STICK)
-        state = META_BUTTON_STATE_PRESSED;
-      else
-        state = META_BUTTON_STATE_PRELIGHT;
-    }
-  else if (control == META_FRAME_CONTROL_UNSTICK &&
-           type == META_BUTTON_TYPE_UNSTICK)
-    {
-      if (grab_op == META_GRAB_OP_CLICKING_UNSTICK)
-        state = META_BUTTON_STATE_PRESSED;
-      else
-        state = META_BUTTON_STATE_PRELIGHT;
-    }
   else if (control == META_FRAME_CONTROL_DELETE &&
            type == META_BUTTON_TYPE_CLOSE)
     {
diff --git a/src/ui/frames.h b/src/ui/frames.h
index 8775334e..d2979439 100644
--- a/src/ui/frames.h
+++ b/src/ui/frames.h
@@ -37,12 +37,6 @@ typedef enum
   META_FRAME_CONTROL_MINIMIZE,
   META_FRAME_CONTROL_MAXIMIZE,
   META_FRAME_CONTROL_UNMAXIMIZE,
-  META_FRAME_CONTROL_SHADE,
-  META_FRAME_CONTROL_UNSHADE,
-  META_FRAME_CONTROL_ABOVE,
-  META_FRAME_CONTROL_UNABOVE,
-  META_FRAME_CONTROL_STICK,
-  META_FRAME_CONTROL_UNSTICK,
   META_FRAME_CONTROL_RESIZE_SE,
   META_FRAME_CONTROL_RESIZE_S,
   META_FRAME_CONTROL_RESIZE_SW,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]