From 199ab405c50acb5a1219c9ff18fb4f2e7344fc32 Mon Sep 17 00:00:00 2001 From: rbuj Date: Tue, 4 Jan 2022 11:15:46 +0100 Subject: notification_area: fix build warning -Wbad-function-cast --- applets/notification_area/testtray.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/applets/notification_area/testtray.c b/applets/notification_area/testtray.c index b7d884f4..15252b71 100644 --- a/applets/notification_area/testtray.c +++ b/applets/notification_area/testtray.c @@ -86,12 +86,16 @@ tray_removed_cb (GtkContainer *box, GtkWidget *icon, TrayData *data) static void orientation_changed_cb (GtkComboBox *combo, TrayData *data) { - GtkOrientation orientation = (GtkOrientation) gtk_combo_box_get_active (combo); - - g_print ("[Screen %u tray %p] Setting orientation to \"%s\"\n", - data->screen_num, data->traybox, orientation == 0 ? "horizontal" : "vertical"); - - gtk_orientable_set_orientation (GTK_ORIENTABLE (data->traybox), orientation); + gint active; + + if ((active = gtk_combo_box_get_active (combo)) != -1) { + GtkOrientation orientation = (GtkOrientation) active; + g_print ("[Screen %u tray %p] Setting orientation to \"%s\"\n", + data->screen_num, + data->traybox, + orientation == GTK_ORIENTATION_HORIZONTAL ? "horizontal" : "vertical"); + gtk_orientable_set_orientation (GTK_ORIENTABLE (data->traybox), orientation); + } } static void -- cgit v1.2.1