Collections mouse hover
authorColin Clark <cclark@mcb.net>
Mon, 23 May 2016 08:49:25 +0000 (09:49 +0100)
committerColin Clark <cclark@mcb.net>
Mon, 23 May 2016 08:49:25 +0000 (09:49 +0100)
Partial solution to #396
https://github.com/BestImageViewer/geeqie/issues/396

When the mouse is hovered over a thumbnail in a collections window, the
tooltip (the filename and path) is in the correct position.

Not a good solution, but there will be more problems with GTK 3.20

src/collect-table.c

index c48c7ea..a46274e 100644 (file)
@@ -519,6 +519,7 @@ static void tip_show(CollectTable *ct)
 {
        GtkWidget *label;
        gint x, y;
+       gint x_win = 0, y_win = 0;
 
        if (ct->tip_window) return;
 
@@ -537,10 +538,14 @@ static void tip_show(CollectTable *ct)
        gtk_container_add(GTK_CONTAINER(ct->tip_window), label);
        gtk_widget_show(label);
 
+#if GTK_CHECK_VERSION(3,0,0)
+       gdk_window_get_origin(gtk_widget_get_window(ct->listview), &x_win, &y_win);
+#else
        gdk_window_get_pointer(NULL, &x, &y, NULL);
+#endif
 
        if (!gtk_widget_get_realized(ct->tip_window)) gtk_widget_realize(ct->tip_window);
-       gtk_window_move(GTK_WINDOW(ct->tip_window), x + 16, y + 16);
+       gtk_window_move(GTK_WINDOW(ct->tip_window), x_win + x + 16, y_win + y + 16);
        gtk_widget_show(ct->tip_window);
 }