X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fui_sensorlist.c;h=3de10f7ddad84cf3bdfc3be4b1ebf1066ea7dd35;hb=781fdffbb2c5e66c10a58b9deef9c909f6b070b4;hp=3a9e988c4b84bec41f8c4a4990f9bff36b2c1153;hpb=4e7224b5c685d700c98c7d2a89cd825de9e9d275;p=psensor.git diff --git a/src/ui_sensorlist.c b/src/ui_sensorlist.c index 3a9e988..3de10f7 100644 --- a/src/ui_sensorlist.c +++ b/src/ui_sensorlist.c @@ -141,13 +141,15 @@ get_sensor_at_pos(GtkTreeView *view, int x, int y, struct ui_psensor *ui) */ static int get_col_index_at_pos(GtkTreeView *view, int x) { - GList *columns = gtk_tree_view_get_columns(view); - GList *node; - int colx = 0; - int coli = 0; - - for (node = columns; node; node = node->next) { - GtkTreeViewColumn *checkcol = (GtkTreeViewColumn *) node->data; + GList *cols, *node; + int colx, coli; + GtkTreeViewColumn *checkcol; + + cols = gtk_tree_view_get_columns(view); + colx = 0; + coli = 0; + for (node = cols; node; node = node->next) { + checkcol = (GtkTreeViewColumn *) node->data; if (x >= colx && x < (colx + gtk_tree_view_column_get_width(checkcol)))