[mutter] prefs: Add draggable_border_width preference



commit 6f5882302f9e884eefb9e82276007c191247562c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jul 20 02:14:58 2011 -0400

    prefs: Add draggable_border_width preference
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644930

 src/core/main.c       |    1 +
 src/core/prefs.c      |   16 ++++++++++++++++
 src/meta/prefs.h      |    5 ++++-
 src/mutter.schemas.in |   17 +++++++++++++++++
 4 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index b5c8e09..2c00e8b 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -594,6 +594,7 @@ prefs_changed_callback (MetaPreference pref,
   switch (pref)
     {
     case META_PREF_THEME:
+    case META_PREF_DRAGGABLE_BORDER_WIDTH:
       meta_ui_set_current_theme (meta_prefs_get_theme (), FALSE);
       meta_display_retheme_all ();
       break;
diff --git a/src/core/prefs.c b/src/core/prefs.c
index 2faf130..328c17d 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -68,6 +68,7 @@
 
 #define KEY_LIVE_HIDDEN_WINDOWS "/apps/mutter/general/live_hidden_windows"
 #define KEY_WORKSPACES_ONLY_ON_PRIMARY "/apps/mutter/general/workspaces_only_on_primary"
+#define KEY_DRAGGABLE_BORDER_WIDTH "/apps/mutter/general/draggable_border_width"
 
 #define KEY_NO_TAB_POPUP "/apps/metacity/general/no_tab_popup"
 
@@ -100,6 +101,7 @@ static gboolean gnome_accessibility = FALSE;
 static gboolean gnome_animations = TRUE;
 static char *cursor_theme = NULL;
 static int   cursor_size = 24;
+static int   draggable_border_width = 10;
 static gboolean resize_with_right_button = FALSE;
 static gboolean edge_tiling = FALSE;
 static gboolean force_fullscreen = TRUE;
@@ -493,6 +495,11 @@ static MetaIntPreference preferences_int[] =
       &cursor_size,
       1, 128, 24,
     },
+    { "/apps/mutter/general/draggable_border_width",
+      META_PREF_DRAGGABLE_BORDER_WIDTH,
+      &draggable_border_width,
+      0, 64, 10,
+    },
     { NULL, 0, NULL, 0, 0, 0, },
   };
 
@@ -1987,6 +1994,9 @@ meta_preference_to_string (MetaPreference pref)
 
     case META_PREF_NO_TAB_POPUP:
       return "NO_TAB_POPUP";
+
+    case META_PREF_DRAGGABLE_BORDER_WIDTH:
+      return "DRAGGABLE_BORDER_WIDTH";
     }
 
   return "(unknown)";
@@ -3040,6 +3050,12 @@ meta_prefs_set_no_tab_popup (gboolean whether)
 #endif
 }
 
+int
+meta_prefs_get_draggable_border_width (void)
+{
+  return draggable_border_width;
+}
+
 #ifndef HAVE_GCONF
 static void
 init_button_layout(void)
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index 8be7dcf..31256d4 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -63,7 +63,8 @@ typedef enum
   META_PREF_FORCE_FULLSCREEN,
   META_PREF_LIVE_HIDDEN_WINDOWS,
   META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
-  META_PREF_NO_TAB_POPUP
+  META_PREF_NO_TAB_POPUP,
+  META_PREF_DRAGGABLE_BORDER_WIDTH
 } MetaPreference;
 
 typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -142,6 +143,8 @@ gboolean meta_prefs_get_workspaces_only_on_primary (void);
 gboolean meta_prefs_get_no_tab_popup (void);
 void     meta_prefs_set_no_tab_popup (gboolean whether);
 
+int      meta_prefs_get_draggable_border_width (void);
+
 /* XXX FIXME This should be x-macroed, but isn't yet because it would be
  * difficult (or perhaps impossible) to add the suffixes using the current
  * system.  It needs some more thought, perhaps after the current system
diff --git a/src/mutter.schemas.in b/src/mutter.schemas.in
index 40973e0..46acc52 100644
--- a/src/mutter.schemas.in
+++ b/src/mutter.schemas.in
@@ -68,5 +68,22 @@
         </long>
       </locale>
     </schema>
+
+    <schema>
+      <key>/schemas/apps/mutter/general/draggable_border_width</key>
+      <applyto>/apps/mutter/general/draggable_border_width</applyto>
+      <owner>mutter</owner>
+      <type>int</type>
+      <default>10</default>
+      <locale name="C">
+        <short>Draggable border width</short>
+        <long>
+          The amount of total draggable borders. If the theme's visible
+          borders are not enough, invisible borders will be added to meet
+          this value.
+        </long>
+      </locale>
+    </schema>
+
     </schemalist>
 </gconfschemafile>



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