[gtksourceview] Manage the tooltip position properly.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtksourceview] Manage the tooltip position properly.
- Date: Wed, 27 May 2009 11:40:18 -0400 (EDT)
commit e4216a10cbd67a1a210db945c627bbdfb100f483
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed May 27 17:36:40 2009 +0200
Manage the tooltip position properly.
Call gtk_text_view_window_to_buffer_coords to get the proper line for tooltips.
---
gtksourceview/gtksourceview.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 99e94f1..67878bf 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -3658,11 +3658,19 @@ gtk_source_view_query_tooltip (GtkWidget *widget,
GSList *marks;
GtkSourceBuffer *buffer;
gint line;
+ gint buffer_x, buffer_y;
buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (text_view));
+ gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (widget),
+ GTK_TEXT_WINDOW_LEFT,
+ x,
+ y,
+ &buffer_x,
+ &buffer_y);
+
gtk_text_view_get_line_at_y (GTK_TEXT_VIEW (widget),
&line_iter,
- y,
+ buffer_y,
NULL);
line = gtk_text_iter_get_line (&line_iter);
marks = gtk_source_buffer_get_source_marks_at_line (buffer,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]