Freeze break approval for a simple patch



So, I feel kind of dumb about this, because the patch was written with
plenty of time before feature freeze and I had intended to get this
committed before then, but I dropped the ball.

Anyway, I'd like to extend the double-click-on-titlebar options to
include minimize (the default on Mac OS X, I hear, so something that
will make Mac fans happier) and no-op (for those of us that don't like
to be punched in the face when we accidentally double click).  The
default will remain maximize because of the large number of former
Windows addicts and the desire to ease their withdrawal symptoms.  ;-)

The patch to do this is dirt simple -- two extra cases for reading the
gconf variable, and two extra cases when checking what action to
perform when the titlebar is clicked on.  Patch attached.
Index: src/common.h
===================================================================
RCS file: /cvs/gnome/metacity/src/common.h,v
retrieving revision 1.35
diff -p -u -r1.35 common.h
--- src/common.h	19 Nov 2005 14:58:50 -0000	1.35
+++ src/common.h	10 Jan 2006 02:22:33 -0000
@@ -155,6 +155,8 @@ typedef enum
 {
   META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE,
   META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE,
+  META_ACTION_DOUBLE_CLICK_TITLEBAR_MINIMIZE,
+  META_ACTION_DOUBLE_CLICK_TITLEBAR_NONE,
   META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST
 } MetaActionDoubleClickTitlebar;
 
Index: src/frames.c
===================================================================
RCS file: /cvs/gnome/metacity/src/frames.c,v
retrieving revision 1.84
diff -p -u -r1.84 frames.c
--- src/frames.c	19 Nov 2005 14:58:50 -0000	1.84
+++ src/frames.c	10 Jan 2006 02:22:33 -0000
@@ -1320,6 +1320,16 @@ meta_frames_button_press_event (GtkWidge
           }
           break;
 
+        case META_ACTION_DOUBLE_CLICK_TITLEBAR_MINIMIZE:
+          {
+            meta_core_minimize (gdk_display, frame->xwindow);
+            break;
+          }
+
+        case META_ACTION_DOUBLE_CLICK_TITLEBAR_NONE:
+          /* Yaay, a sane user that doesn't use that other weird crap! */
+          break;
+
         case META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST:
           break;
         }
Index: src/prefs.c
===================================================================
RCS file: /cvs/gnome/metacity/src/prefs.c,v
retrieving revision 1.52
diff -p -u -r1.52 prefs.c
--- src/prefs.c	25 Oct 2005 16:43:01 -0000	1.52
+++ src/prefs.c	10 Jan 2006 02:22:33 -0000
@@ -1409,6 +1409,10 @@ action_double_click_titlebar_from_string
     return META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE;
   else if (strcmp (str, "toggle_maximize") == 0)
     return META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE;
+  else if (strcmp (str, "minimize") == 0)
+    return META_ACTION_DOUBLE_CLICK_TITLEBAR_MINIMIZE;
+  else if (strcmp (str, "none") == 0)
+    return META_ACTION_DOUBLE_CLICK_TITLEBAR_NONE;
   else
     return META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST;
 }


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