[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: Plugin: Fix crash with slider on 32bit systems (Bug 11076)

noreply at xfce.org noreply at xfce.org
Mon Aug 11 18:46:31 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfce4-power-manager.

commit 53c6780fe4cb37659b9db618cc033b74214a871c
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Aug 11 19:38:56 2014 +0300

    Plugin: Fix crash with slider on 32bit systems (Bug 11076)
    
    Patch provided by Simon P.
    
    Clicking on, or dragging, the slider of the display brightness
    slider of the plugin menu causes the plugin to crash. This
    behaviour has been present since this feature was introduced.
    
    I've tracked down the cause to the way the "value-changed"
    signal on the scale_menu_item object is handled. The signal
    is defined with a gdouble data item for the range value (but
    isn't used anywhere?) while the callback function
    range_value_changed_cb isn't expecting this data.
    
    By changing to g_signal_connect_swapped for this signal in
    function battery_button_show_menu & swapping the parameters
    in the callback function, the range slider is now working for
    me.
---
 panel-plugins/battery/battery-button.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugins/battery/battery-button.c b/panel-plugins/battery/battery-button.c
index 2d1bf99..a600bc6 100644
--- a/panel-plugins/battery/battery-button.c
+++ b/panel-plugins/battery/battery-button.c
@@ -833,7 +833,7 @@ brightness_set_level_with_timeout (BatteryButton *button)
 }
 
 static void
-range_value_changed_cb (GtkWidget *widget, BatteryButton *button)
+range_value_changed_cb (BatteryButton *button, GtkWidget *widget)
 {
     TRACE("entering");
 
@@ -957,7 +957,7 @@ battery_button_show_menu (BatteryButton *button)
         xfpm_brightness_get_level (button->priv->brightness, &current_level);
         gtk_range_set_value (GTK_RANGE(button->priv->range), current_level);
 
-        g_signal_connect (mi, "value-changed", G_CALLBACK (range_value_changed_cb), button);
+        g_signal_connect_swapped (mi, "value-changed", G_CALLBACK (range_value_changed_cb), button);
         g_signal_connect (mi, "scroll-event", G_CALLBACK (range_scroll_cb), button);
         g_signal_connect (menu, "show", G_CALLBACK (range_show_cb), button);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list