2004-10-01 Arvind Samptur <
[email protected]>
* metacity.spec: add patch
* patches/metacity-06-raise-on-frame-click.diff :
Forward porting the patch to cinnabar from GNOME 2.0.2
which adds a key window_raise_on_frame_only under sun-extentions.
Bug #4760281
--- a/ChangeLog Fri Oct 01 09:13:42 2004 +0000
+++ b/ChangeLog Fri Oct 01 10:00:23 2004 +0000
@@ -1,3 +1,11 @@
+2004-10-01 Arvind Samptur <[email protected]>
+
+ * metacity.spec: add patch
+ * patches/metacity-06-raise-on-frame-click.diff :
+ Forward porting the patch to cinnabar from GNOME 2.0.2
+ which adds a key window_raise_on_frame_only under sun-extentions.
+ Bug #4760281
+
2004-10-01 Padraig O'Briain <[email protected]>
* gnopernicus-spec: Bump to 0.9.14
--- a/metacity.spec Fri Oct 01 09:13:42 2004 +0000
+++ b/metacity.spec Fri Oct 01 10:00:23 2004 +0000
@@ -2,7 +2,7 @@
License: GPL
Group: System/GUI/GNOME
Version: 2.8.0
-Release: 21
+Release: 22
Distribution: Cinnabar
Vendor: Sun Microsystems, Inc.
Summary: GNOME Window Manager
@@ -15,6 +15,7 @@
Patch3: metacity-03-ctrl-alt-del.diff
Patch4: metacity-04-sunpowerswitch-key.diff
Patch5: metacity-05-bigstruts.diff
+Patch6: metacity-06-raise-on-frame-click.diff
URL: http://www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Docdir: %{_defaultdocdir}/doc
@@ -43,6 +44,7 @@
%patch3 -p0
%patch4 -p1
%patch5 -p1
+%patch6 -p1
bzcat %SOURCE1 | tar xf -
%build
@@ -113,6 +115,9 @@
%{_mandir}/man1/*
%changelog
+* Fri Oct 01 2004 - [email protected]
+- Add the window_raise_on_frame_only key under sun-extenstions
+
* Sat Sep 11 2004 - [email protected]
- Move Solaris specific LDFLAGS to the Solaris spec file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/metacity-06-raise-on-frame-click.diff Fri Oct 01 10:00:23 2004 +0000
@@ -0,0 +1,208 @@
+--- metacity-2.8.0/src/prefs.h 2004-10-01 09:44:26.000000000 +0530
++++ metacity-2.8.0-new/src/prefs.h 2004-10-01 10:05:39.000000000 +0530
+@@ -30,6 +30,7 @@ typedef enum
+ {
+ META_PREF_MOUSE_BUTTON_MODS,
+ META_PREF_FOCUS_MODE,
++ META_PREF_WINDOW_RAISE_ON_FRAME_ONLY,
+ META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR,
+ META_PREF_AUTO_RAISE,
+ META_PREF_AUTO_RAISE_DELAY,
+@@ -68,6 +69,7 @@ const PangoFontDescription* meta_prefs_g
+ int meta_prefs_get_num_workspaces (void);
+ gboolean meta_prefs_get_application_based (void);
+ gboolean meta_prefs_get_disable_workarounds (void);
++gboolean meta_prefs_get_window_raise_on_frame_only (void);
+ gboolean meta_prefs_get_auto_raise (void);
+ int meta_prefs_get_auto_raise_delay (void);
+ gboolean meta_prefs_get_reduced_resources (void);
+--- metacity-2.8.0/src/prefs.c 2004-10-01 09:44:26.000000000 +0530
++++ metacity-2.8.0-new/src/prefs.c 2004-10-01 10:33:07.000000000 +0530
+@@ -43,6 +43,7 @@
+ #define KEY_MOUSE_BUTTON_MODS "/apps/metacity/general/mouse_button_modifier"
+ #define KEY_FOCUS_MODE "/apps/metacity/general/focus_mode"
+ #define KEY_ACTION_DOUBLE_CLICK_TITLEBAR "/apps/metacity/general/action_double_click_titlebar"
++#define KEY_WINDOW_RAISE_ON_FRAME_ONLY "/apps/metacity/sun_extensions/window_raise_on_frame_only"
+ #define KEY_AUTO_RAISE "/apps/metacity/general/auto_raise"
+ #define KEY_AUTO_RAISE_DELAY "/apps/metacity/general/auto_raise_delay"
+ #define KEY_THEME "/apps/metacity/general/theme"
+@@ -81,6 +82,7 @@ static MetaActionDoubleClickTitlebar act
+ META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE;
+ static gboolean application_based = FALSE;
+ static gboolean disable_workarounds = FALSE;
++static gboolean window_raise_on_frame_only = FALSE;
+ static gboolean auto_raise = FALSE;
+ static gboolean auto_raise_delay = 500;
+ static gboolean provide_visual_bell = TRUE;
+@@ -119,6 +121,7 @@ static gboolean update_visual_bell_type
+ static gboolean update_num_workspaces (int value);
+ static gboolean update_application_based (gboolean value);
+ static gboolean update_disable_workarounds (gboolean value);
++static gboolean update_window_raise_on_frame_only (gboolean value);
+ static gboolean update_action_double_click_titlebar (const char *value);
+ static gboolean update_auto_raise (gboolean value);
+ static gboolean update_auto_raise_delay (int value);
+@@ -324,6 +327,13 @@ meta_prefs_init (void)
+ update_action_double_click_titlebar (str_val);
+ g_free (str_val);
+
++ bool_val = gconf_client_get_bool (default_client, KEY_WINDOW_RAISE_ON_FRAME_ONLY,
++ &err);
++
++ cleanup_error (&err);
++
++ update_window_raise_on_frame_only (bool_val);
++
+ bool_val = gconf_client_get_bool (default_client, KEY_AUTO_RAISE,
+ &err);
+ cleanup_error (&err);
+@@ -631,6 +641,22 @@ change_notify (GConfClient *client,
+ if (update_action_double_click_titlebar (str))
+ queue_changed (META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR);
+ }
++ else if (strcmp (key, KEY_WINDOW_RAISE_ON_FRAME_ONLY) == 0)
++ {
++ gboolean b;
++
++ if (value && value->type != GCONF_VALUE_BOOL)
++ {
++ meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
++ KEY_WINDOW_RAISE_ON_FRAME_ONLY);
++ goto out;
++ }
++
++ b = value ? gconf_value_get_bool (value) : window_raise_on_frame_only;
++
++ if (update_window_raise_on_frame_only (b))
++ queue_changed (META_PREF_WINDOW_RAISE_ON_FRAME_ONLY);
++ }
+ else if (strcmp (key, KEY_AUTO_RAISE) == 0)
+ {
+ gboolean b;
+@@ -1237,6 +1263,16 @@ update_action_double_click_titlebar (con
+ }
+
+ static gboolean
++update_window_raise_on_frame_only (gboolean value)
++{
++ gboolean old = window_raise_on_frame_only ;
++
++ window_raise_on_frame_only = value;
++
++ return old != window_raise_on_frame_only;
++}
++
++static gboolean
+ update_auto_raise (gboolean value)
+ {
+ gboolean old = auto_raise;
+@@ -1310,6 +1346,9 @@ meta_preference_to_string (MetaPreferenc
+ case META_PREF_DISABLE_WORKAROUNDS:
+ return "DISABLE_WORKAROUNDS";
+
++ case META_PREF_WINDOW_RAISE_ON_FRAME_ONLY:
++ return "WINDOW_RAISE_ON_FRAME_ONLY";
++
+ case META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR:
+ return "ACTION_DOUBLE_CLICK_TITLEBAR";
+
+@@ -2045,6 +2084,12 @@ meta_prefs_get_action_double_click_title
+ }
+
+ gboolean
++meta_prefs_get_window_raise_on_frame_only ()
++{
++ return window_raise_on_frame_only;
++}
++
++gboolean
+ meta_prefs_get_auto_raise ()
+ {
+ return auto_raise;
+--- metacity-2.8.0/src/window.c 2004-10-01 09:44:26.000000000 +0530
++++ metacity-2.8.0-new/src/window.c 2004-10-01 11:02:28.000000000 +0530
+@@ -169,6 +169,20 @@ maybe_leave_show_desktop_mode (MetaWindo
+ }
+ }
+
++static
++prefs_changed_callback (MetaPreference pref,
++ gpointer data)
++{
++ MetaWindow *window = data;
++
++ if (pref == META_PREF_WINDOW_RAISE_ON_FRAME_ONLY)
++ {
++ if (window == window->display->focus_window)
++ if (!meta_prefs_get_window_raise_on_frame_only ())
++ meta_display_grab_focus_window_button (window->display, window);
++ }
++}
++
+ MetaWindow*
+ meta_window_new (MetaDisplay *display,
+ Window xwindow,
+@@ -713,6 +727,8 @@ meta_window_new_with_attrs (MetaDisplay
+
+ meta_window_queue_calc_showing (window);
+
++ meta_prefs_add_listener (prefs_changed_callback, window);
++
+ meta_error_trap_pop (display, FALSE); /* pop the XSync()-reducing trap */
+ meta_display_ungrab (display);
+
+@@ -895,6 +911,8 @@ meta_window_free (MetaWindow *window)
+ meta_stack_thaw (window->screen->stack);
+ }
+
++ meta_prefs_remove_listener (prefs_changed_callback, window);
++
+ meta_window_shutdown_group (window); /* safe to do this early as
+ * group.c won't re-add to the
+ * group if window->unmanaging
+@@ -4170,8 +4188,10 @@ meta_window_notify_focus (MetaWindow *wi
+ * with some things you might do inside the focused window, by
+ * causing the client to get funky enter/leave events.
+ */
+- if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
+- meta_display_ungrab_focus_window_button (window->display, window);
++
++ if (meta_prefs_get_window_raise_on_frame_only () || meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK )
++ meta_display_ungrab_focus_window_button (window->display, window);
++
+ }
+ }
+ else if (event->type == FocusOut ||
+@@ -4210,7 +4230,7 @@ meta_window_notify_focus (MetaWindow *wi
+ meta_window_update_layer (window);
+
+ /* Re-grab for click to focus, if necessary */
+- if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
++ if (meta_prefs_get_window_raise_on_frame_only () || meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
+ meta_display_grab_focus_window_button (window->display, window);
+ }
+ }
+--- metacity-2.8.0/src/metacity.schemas.in 2004-10-01 09:44:26.000000000 +0530
++++ metacity-2.8.0-new/src/metacity.schemas.in 2004-10-01 10:27:45.000000000 +0530
+@@ -1934,6 +1934,21 @@ you set
+ </locale>
+ </schema>
+
++ <schema>
++ <key>/schemas/apps/metacity/sun_extensions/window_raise_on_frame_only</key>
++ <applyto>/apps/metacity/sun_extensions/window_raise_on_frame_only</applyto>
++ <owner>metacity</owner>
++ <type>bool</type>
++ <default>false</default>
++ <locale name="C">
++ <short>In sloppy focus mode, enable to raise on frame click only </short>
++ <long> If enabled, in sloppy focus mode, the window will be raised to
++ top of stack when clicked on window frame only. Windows will not
++ raise when clicked inside them.
++ </long>
++ </locale>
++ </schema>
++
+
+ </schemalist>
+ </gconfschemafile>