diff options
Diffstat (limited to 'sensors-applet/sensors-applet.c')
-rw-r--r-- | sensors-applet/sensors-applet.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c index 5649fc1..b4f58cc 100644 --- a/sensors-applet/sensors-applet.c +++ b/sensors-applet/sensors-applet.c @@ -217,6 +217,25 @@ static void style_set_cb(GtkWidget *widget, } +static gboolean mouse_enter_cb(GtkWidget *widget, + GdkEventCrossing *event, + gpointer data) +{ + SensorsApplet *sensor_applet = data; + sensor_applet->show_tooltip = TRUE; + sensors_applet_update_active_sensors(sensor_applet); + return TRUE; +} + +static gboolean mouse_leave_cb(GtkWidget *widget, + GdkEventCrossing *event, + gpointer data) +{ + SensorsApplet *sensor_applet = data; + sensor_applet->show_tooltip = FALSE; + return TRUE; +} + static const GtkActionEntry sensors_applet_menu_actions[] = { { "Preferences", GTK_STOCK_PROPERTIES, N_("_Preferences"), NULL, NULL, @@ -1372,6 +1391,13 @@ void sensors_applet_init(SensorsApplet *sensors_applet) { G_CALLBACK(size_allocate_cb), sensors_applet); + g_signal_connect(G_OBJECT(sensors_applet->applet), "leave_notify_event", + G_CALLBACK(mouse_leave_cb), + (gpointer)sensors_applet); + + g_signal_connect(G_OBJECT(sensors_applet->applet), "enter_notify_event", + G_CALLBACK(mouse_enter_cb), + (gpointer)sensors_applet); sensors_applet_update_active_sensors(sensors_applet); |