From 27f591660c1e80f750c9785c7cd3cbf50bedcac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Thu, 19 Oct 2006 13:19:58 +0000 Subject: [PATCH] Keep treeview enum values in sync with the notebook page numbers. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@905 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- src/callbacks.c | 10 ++++++---- src/geany.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/callbacks.c b/src/callbacks.c index e55f4eb6..1e866fdd 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -1402,7 +1402,9 @@ on_tree_view_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data) { - if (event->type == GDK_2BUTTON_PRESS && user_data) + // user_data might be NULL, GPOINTER_TO_INT returns 0 if called with NULL + + if (event->type == GDK_2BUTTON_PRESS) { if (GPOINTER_TO_INT(user_data) == MSG_MESSAGE) { // double click in the message treeview (results of 'Find usage') @@ -1414,14 +1416,14 @@ on_tree_view_button_press_event (GtkWidget *widget, } } - if (event->button == 1 && user_data && GPOINTER_TO_INT(user_data) == TREEVIEW_SYMBOL) + if (event->button == 1 && GPOINTER_TO_INT(user_data) == TREEVIEW_SYMBOL) { // allow reclicking of taglist treeview item GtkTreeSelection *select = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); - on_taglist_tree_selection_changed(select, user_data); + on_taglist_tree_selection_changed(select, NULL); } - if (user_data && event->button == 3) + if (event->button == 3) { // popupmenu to hide or clear the active treeview if (GPOINTER_TO_INT(user_data) == MSG_STATUS) gtk_menu_popup(GTK_MENU(msgwindow.popup_status_menu), NULL, NULL, NULL, NULL, event->button, event->time); diff --git a/src/geany.h b/src/geany.h index faa43a33..99117354 100644 --- a/src/geany.h +++ b/src/geany.h @@ -212,7 +212,7 @@ enum { enum { - MSG_STATUS = 1, + MSG_STATUS = 0, // force it to start at 0 to keep in sync with the notebook page numbers MSG_COMPILER, MSG_MESSAGE, MSG_SCRATCH,