summaryrefslogtreecommitdiff
path: root/applets/notification_area/testtray.c
diff options
context:
space:
mode:
Diffstat (limited to 'applets/notification_area/testtray.c')
-rw-r--r--applets/notification_area/testtray.c16
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