[metacity/wip/gtk-theme: 40/41] prefs: add draggable-border-width preference
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/wip/gtk-theme: 40/41] prefs: add draggable-border-width preference
- Date: Wed, 7 Jan 2015 12:39:29 +0000 (UTC)
commit 0f2db4cbbfe1920b148dca6978951cb60925cb9c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Wed Jan 7 14:18:47 2015 +0200
prefs: add draggable-border-width preference
This is based on following commits (from mutter):
1) https://git.gnome.org/browse/mutter/commit/?id=6f5882302f9e884eefb9e82276007c191247562c
2) https://git.gnome.org/browse/mutter/commit/?id=d0910da036cfe7e9c86e19ccb3e765953b5dc045
src/core/main.c | 1 +
src/core/prefs.c | 17 +++++++++++++++++
src/include/prefs.h | 3 +++
src/org.gnome.metacity.gschema.xml.in | 10 ++++++++++
src/ui/theme.c | 4 +---
5 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 43f7318..1794c1a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -649,6 +649,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 0a556cb..af1acca 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -87,6 +87,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 compositing_manager = FALSE;
static gboolean resize_with_right_button = FALSE;
static gboolean edge_tiling = FALSE;
@@ -438,6 +439,13 @@ static MetaIntPreference preferences_int[] =
&auto_raise_delay
},
{
+ { "draggable-border-width",
+ SCHEMA_METACITY,
+ META_PREF_DRAGGABLE_BORDER_WIDTH,
+ },
+ &draggable_border_width
+ },
+ {
{ KEY_GNOME_CURSOR_SIZE,
SCHEMA_INTERFACE,
META_PREF_CURSOR_SIZE,
@@ -1455,6 +1463,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_USE_METACITY_THEME:
return "USE_METACITY_THEME";
+
+ case META_PREF_DRAGGABLE_BORDER_WIDTH:
+ return "DRAGGABLE_BORDER_WIDTH";
}
return "(unknown)";
@@ -1883,6 +1894,12 @@ meta_prefs_get_use_metacity_theme (void)
return use_metacity_theme;
}
+int
+meta_prefs_get_draggable_border_width (void)
+{
+ return draggable_border_width;
+}
+
void
meta_prefs_set_compositing_manager (gboolean whether)
{
diff --git a/src/include/prefs.h b/src/include/prefs.h
index 25e97e5..1be0772 100644
--- a/src/include/prefs.h
+++ b/src/include/prefs.h
@@ -63,6 +63,7 @@ typedef enum
META_PREF_FORCE_FULLSCREEN,
META_PREF_PLACEMENT_MODE,
META_PREF_USE_METACITY_THEME,
+ META_PREF_DRAGGABLE_BORDER_WIDTH,
} MetaPreference;
typedef enum
@@ -133,6 +134,8 @@ MetaPlacementMode meta_prefs_get_placement_mode (void);
gboolean meta_prefs_get_use_metacity_theme (void);
+int meta_prefs_get_draggable_border_width (void);
+
/**
* Sets whether the compositor is turned on.
*
diff --git a/src/org.gnome.metacity.gschema.xml.in b/src/org.gnome.metacity.gschema.xml.in
index 248c06e..37a8600 100644
--- a/src/org.gnome.metacity.gschema.xml.in
+++ b/src/org.gnome.metacity.gschema.xml.in
@@ -17,6 +17,16 @@
Determines whether Metacity is a compositing manager.
</_description>
</key>
+ <key name="draggable-border-width" type="i">
+ <default>10</default>
+ <range min="0" max="64"/>
+ <_summary>Draggable border width</_summary>
+ <_description>
+ The amount of total draggable borders. If the theme's visible
+ borders are not enough, invisible borders will be added to meet
+ this value.
+ </_description>
+ </key>
<key name="reduced-resources" type="b">
<default>false</default>
<_summary>If true, trade off usability for less resource usage</_summary>
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 7fe9a53..646cff8 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -434,9 +434,7 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
borders->visible.right = layout->right_width;
borders->visible.bottom = layout->bottom_height;
- /* FIXME: ... */
- /* draggable_borders = meta_prefs_get_draggable_border_width (); */
- draggable_borders = 0;
+ draggable_borders = meta_prefs_get_draggable_border_width ();
if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]