[Xfce4-commits] <xfwm4:master> Fix bug 6989

Olivier Fourdan noreply at xfce.org
Wed Dec 15 19:04:04 CET 2010


Updating branch refs/heads/master
         to d4007b56100503fcc341e98fa5cb75c5d73cdd5e (commit)
       from ca19b741c68ce7d0cde68e77d8c4fddcd67b9a13 (commit)

commit d4007b56100503fcc341e98fa5cb75c5d73cdd5e
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Dec 14 08:55:47 2010 +0100

    Fix bug 6989
    
    Add an xfconf key to enable/disable rollup with mouse wheel.

 defaults/defaults |    1 +
 src/events.c      |   10 ++++++++--
 src/settings.c    |   45 ++++++++++++++++++++++++++-------------------
 src/settings.h    |    1 +
 4 files changed, 36 insertions(+), 21 deletions(-)

diff --git a/defaults/defaults b/defaults/defaults
index bb428c7..1d7c97d 100644
--- a/defaults/defaults
+++ b/defaults/defaults
@@ -26,6 +26,7 @@ move_opacity=100
 placement_mode=center
 placement_ratio=20
 popup_opacity=100
+mousewheel_rollup=true
 prevent_focus_stealing=false
 raise_delay=250
 raise_on_click=true
diff --git a/src/events.c b/src/events.c
index e620949..8fdd867 100644
--- a/src/events.c
+++ b/src/events.c
@@ -789,7 +789,10 @@ titleButton (Client * c, guint state, XButtonEvent * ev)
         }
         else if (!FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
         {
-            clientShade (c);
+            if (screen_info->params->mousewheel_rollup)
+            {
+                clientShade (c);
+            }
         }
     }
     else if (ev->button == Button5)
@@ -801,7 +804,10 @@ titleButton (Client * c, guint state, XButtonEvent * ev)
         }
         else if (FLAG_TEST (c->flags, CLIENT_FLAG_SHADED))
         {
-            clientUnshade (c);
+            if (screen_info->params->mousewheel_rollup)
+            {
+                clientUnshade (c);
+            }
         }
     }
     else if (ev->button == Button6)
diff --git a/src/settings.c b/src/settings.c
index b9d57bf..5438592 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -697,6 +697,7 @@ loadSettings (ScreenInfo *screen_info)
         {"placement_ratio", NULL, G_TYPE_INT, TRUE},
         {"placement_mode", NULL, G_TYPE_STRING, TRUE},
         {"popup_opacity", NULL, G_TYPE_INT, TRUE},
+        {"mousewheel_rollup", NULL, G_TYPE_BOOLEAN, TRUE},
         {"prevent_focus_stealing", NULL, G_TYPE_BOOLEAN, TRUE},
         {"raise_delay", NULL, G_TYPE_INT, TRUE},
         {"raise_on_click", NULL, G_TYPE_BOOLEAN, TRUE},
@@ -771,12 +772,14 @@ loadSettings (ScreenInfo *screen_info)
         getBoolValue ("focus_hint", rc);
     screen_info->params->focus_new =
         getBoolValue ("focus_new", rc);
-    screen_info->params->raise_on_focus =
-        getBoolValue ("raise_on_focus", rc);
+    screen_info->params->mousewheel_rollup =
+        getBoolValue ("mousewheel_rollup", rc);
     screen_info->params->prevent_focus_stealing =
         getBoolValue ("prevent_focus_stealing", rc);
     screen_info->params->raise_delay =
         getIntValue ("raise_delay", rc);
+    screen_info->params->raise_on_focus =
+        getBoolValue ("raise_on_focus", rc);
     screen_info->params->focus_delay =
         getIntValue ("focus_delay", rc);
     screen_info->params->raise_on_click =
@@ -1285,24 +1288,9 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_
                 {
                     screen_info->params->focus_hint = g_value_get_boolean (value);
                 }
-                else if (!strcmp (name, "show_dock_shadow"))
-                {
-                    screen_info->params->show_dock_shadow = g_value_get_boolean (value);
-                    reloadScreenSettings (screen_info, UPDATE_FRAME);
-                }
-                else if (!strcmp (name, "show_frame_shadow"))
-                {
-                    screen_info->params->show_frame_shadow = g_value_get_boolean (value);
-                    reloadScreenSettings (screen_info, UPDATE_FRAME);
-                }
-                else if (!strcmp (name, "show_popup_shadow"))
-                {
-                    screen_info->params->show_popup_shadow = g_value_get_boolean (value);
-                    reloadScreenSettings (screen_info, UPDATE_FRAME);
-                }
-                else if (!strcmp (name, "snap_resist"))
+                else if (!strcmp (name, "mousewheel_rollup"))
                 {
-                    screen_info->params->snap_resist = g_value_get_boolean (value);
+                    screen_info->params->mousewheel_rollup = g_value_get_boolean (value);
                 }
                 else if (!strcmp (name, "prevent_focus_stealing"))
                 {
@@ -1321,6 +1309,25 @@ cb_xfwm4_channel_property_changed(XfconfChannel *channel, const gchar *property_
                 {
                     screen_info->params->scroll_workspaces = g_value_get_boolean (value);
                 }
+                else if (!strcmp (name, "show_dock_shadow"))
+                {
+                    screen_info->params->show_dock_shadow = g_value_get_boolean (value);
+                    reloadScreenSettings (screen_info, UPDATE_FRAME);
+                }
+                else if (!strcmp (name, "show_frame_shadow"))
+                {
+                    screen_info->params->show_frame_shadow = g_value_get_boolean (value);
+                    reloadScreenSettings (screen_info, UPDATE_FRAME);
+                }
+                else if (!strcmp (name, "show_popup_shadow"))
+                {
+                    screen_info->params->show_popup_shadow = g_value_get_boolean (value);
+                    reloadScreenSettings (screen_info, UPDATE_FRAME);
+                }
+                else if (!strcmp (name, "snap_resist"))
+                {
+                    screen_info->params->snap_resist = g_value_get_boolean (value);
+                }
                 else if (!strcmp (name, "toggle_workspaces"))
                 {
                     screen_info->params->toggle_workspaces = g_value_get_boolean (value);
diff --git a/src/settings.h b/src/settings.h
index b66c60d..8de4029 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -204,6 +204,7 @@ struct _XfwmParams
     gboolean focus_hint;
     gboolean focus_new;
     gboolean full_width_title;
+    gboolean mousewheel_rollup;
     gboolean prevent_focus_stealing;
     gboolean raise_on_click;
     gboolean raise_on_focus;



More information about the Xfce4-commits mailing list