diff options
author | rbuj <[email protected]> | 2022-01-04 11:15:46 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-01-18 01:55:13 +0000 |
commit | 199ab405c50acb5a1219c9ff18fb4f2e7344fc32 (patch) | |
tree | 07f74f786e4336a57eeab854a13f8186c00f92ed | |
parent | a3807f46f81745f4125460bb7e92b4c417573bb8 (diff) | |
download | mate-panel-199ab405c50acb5a1219c9ff18fb4f2e7344fc32.tar.bz2 mate-panel-199ab405c50acb5a1219c9ff18fb4f2e7344fc32.tar.xz |
notification_area: fix build warning -Wbad-function-cast
-rw-r--r-- | applets/notification_area/testtray.c | 16 |
1 files 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 |