From: Colin Clark Date: Mon, 23 May 2016 08:49:25 +0000 (+0100) Subject: Collections mouse hover X-Git-Tag: v1.3~8 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=1bfcecb1cb06ab7968385737ddccd910025dd1fe Collections mouse hover 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 --- diff --git a/src/collect-table.c b/src/collect-table.c index c48c7ea1..a46274e3 100644 --- a/src/collect-table.c +++ b/src/collect-table.c @@ -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); }