summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Thurman <thomas@thurman.org.uk>2007-02-22 02:40:31 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2007-02-22 02:40:31 +0000
commit1fed2822e5b35377b09495423adf9073922f75be (patch)
treedd1e769c44399c8349a8b11594c2c88535313bea
parent56b59faf873b92b732133fc031da2a6af3a161a8 (diff)
downloadmetacity-1fed2822e5b35377b09495423adf9073922f75be.tar.gz
back out last patch from Linus because it belongs in trunk and not the
2007-02-21 Thomas Thurman <thomas@thurman.org.uk> * src/common.h, src/frames.c, src/prefs.c: back out last patch from Linus because it belongs in trunk and not the 2.18 branch. (My fault for applying it in the wrong place.) svn path=/branches/gnome-2-18/; revision=3068
-rw-r--r--ChangeLog7
-rw-r--r--src/common.h14
-rw-r--r--src/frames.c38
-rw-r--r--src/prefs.c29
4 files changed, 42 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index eedc031a..c5391e3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-21 Thomas Thurman <thomas@thurman.org.uk>
+
+ * src/common.h, src/frames.c, src/prefs.c: back out
+ last patch from Linus because it belongs in trunk and
+ not the 2.18 branch. (My fault for applying it in the
+ wrong place.)
+
2007-02-20 Kjartan Maraas <kmaraas@gnome.org>
* Makefile.am: Add MAINTAINERS to EXTRA_DIST so others
diff --git a/src/common.h b/src/common.h
index 087798e0..b5817993 100644
--- a/src/common.h
+++ b/src/common.h
@@ -171,14 +171,12 @@ typedef enum
typedef enum
{
- META_ACTION_TITLEBAR_TOGGLE_SHADE,
- META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE,
- META_ACTION_TITLEBAR_MINIMIZE,
- META_ACTION_TITLEBAR_NONE,
- META_ACTION_TITLEBAR_LOWER,
- META_ACTION_TITLEBAR_MENU,
- META_ACTION_TITLEBAR_LAST
-} MetaActionTitlebar;
+ 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;
typedef enum
{
diff --git a/src/frames.c b/src/frames.c
index 35d94caf..d6e953b8 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -1196,7 +1196,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
switch (action)
{
- case META_ACTION_TITLEBAR_TOGGLE_SHADE:
+ case META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE:
{
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
@@ -1214,7 +1214,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
}
break;
- case META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE:
+ case META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE:
{
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
@@ -1225,7 +1225,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
}
break;
- case META_ACTION_TITLEBAR_MINIMIZE:
+ case META_ACTION_DOUBLE_CLICK_TITLEBAR_MINIMIZE:
{
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
@@ -1236,26 +1236,11 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
}
break;
- case META_ACTION_TITLEBAR_NONE:
+ case META_ACTION_DOUBLE_CLICK_TITLEBAR_NONE:
/* Yaay, a sane user that doesn't use that other weird crap! */
break;
-
- case META_ACTION_TITLEBAR_LOWER:
- meta_core_user_lower_and_unfocus (gdk_display,
- frame->xwindow,
- event->time);
- break;
-
- case META_ACTION_TITLEBAR_MENU:
- meta_core_show_window_menu (gdk_display,
- frame->xwindow,
- event->x_root,
- event->y_root,
- event->button,
- event->time);
- break;
- case META_ACTION_TITLEBAR_LAST:
+ case META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST:
break;
}
@@ -1275,14 +1260,23 @@ static gboolean
meta_frame_middle_click_event (MetaUIFrame *frame,
GdkEventButton *event)
{
- return meta_frame_titlebar_event (frame, event, META_ACTION_TITLEBAR_LOWER);
+ meta_core_user_lower_and_unfocus (gdk_display,
+ frame->xwindow,
+ event->time);
+ return TRUE;
}
static gboolean
meta_frame_right_click_event(MetaUIFrame *frame,
GdkEventButton *event)
{
- return meta_frame_titlebar_event (frame, event, META_ACTION_TITLEBAR_MENU);
+ meta_core_show_window_menu (gdk_display,
+ frame->xwindow,
+ event->x_root,
+ event->y_root,
+ event->button,
+ event->time);
+ return TRUE;
}
static gboolean
diff --git a/src/prefs.c b/src/prefs.c
index 008b111e..3313bd38 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -91,7 +91,8 @@ static MetaFocusNewWindows focus_new_windows = META_FOCUS_NEW_WINDOWS_SMART;
static gboolean raise_on_click = TRUE;
static char* current_theme = NULL;
static int num_workspaces = 4;
-static MetaActionTitlebar action_double_click_titlebar = META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE;
+static MetaActionDoubleClickTitlebar action_double_click_titlebar =
+ META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE;
static gboolean application_based = FALSE;
static gboolean disable_workarounds = FALSE;
static gboolean auto_raise = FALSE;
@@ -1629,35 +1630,31 @@ meta_prefs_get_disable_workarounds (void)
}
#ifdef HAVE_GCONF
-static MetaActionTitlebar
-action_titlebar_from_string (const char *str)
+static MetaActionDoubleClickTitlebar
+action_double_click_titlebar_from_string (const char *str)
{
if (strcmp (str, "toggle_shade") == 0)
- return META_ACTION_TITLEBAR_TOGGLE_SHADE;
+ return META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE;
else if (strcmp (str, "toggle_maximize") == 0)
- return META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE;
+ return META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE;
else if (strcmp (str, "minimize") == 0)
- return META_ACTION_TITLEBAR_MINIMIZE;
+ return META_ACTION_DOUBLE_CLICK_TITLEBAR_MINIMIZE;
else if (strcmp (str, "none") == 0)
- return META_ACTION_TITLEBAR_NONE;
- else if (strcmp (str, "lower") == 0)
- return META_ACTION_TITLEBAR_LOWER;
- else if (strcmp (str, "menu") == 0)
- return META_ACTION_TITLEBAR_MENU;
+ return META_ACTION_DOUBLE_CLICK_TITLEBAR_NONE;
else
- return META_ACTION_TITLEBAR_LAST;
+ return META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST;
}
static gboolean
update_action_double_click_titlebar (const char *value)
{
- MetaActionTitlebar old_action = action_double_click_titlebar;
+ MetaActionDoubleClickTitlebar old_action = action_double_click_titlebar;
if (value != NULL)
{
- action_double_click_titlebar = action_titlebar_from_string (value);
+ action_double_click_titlebar = action_double_click_titlebar_from_string (value);
- if (action_double_click_titlebar == META_ACTION_TITLEBAR_LAST)
+ if (action_double_click_titlebar == META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST)
{
action_double_click_titlebar = old_action;
meta_warning (_("GConf key '%s' is set to an invalid value\n"),
@@ -2876,7 +2873,7 @@ meta_prefs_get_window_bindings (const MetaKeyPref **bindings,
*n_bindings = (int) G_N_ELEMENTS (window_bindings) - 1;
}
-MetaActionTitlebar
+MetaActionDoubleClickTitlebar
meta_prefs_get_action_double_click_titlebar (void)
{
return action_double_click_titlebar;