After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586590 - Tooltips are sometimes drawn at the wrong Y position
Tooltips are sometimes drawn at the wrong Y position
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
1.9.x
Other All
: Normal trivial
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2009-06-22 05:09 UTC by Torbjörn Andersson
Modified: 2009-06-23 17:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Torbjörn Andersson 2009-06-22 05:09:48 UTC
Please describe the problem:
I first noticed this when using the "autofill" feature in a document with a few thousand rows: I didn't see any tooltip showing me the value of the last cell to be filled. At first I thought perhaps the feature had been disabled, or only worked for some cases, but then I noticed that it still worked in smaller documents.

It turns out that (for me) up to the 900th row or so, the tooltip is positioned near the selected rectangle, as expected. Somewhere near the 1000th row, the Y position of the tooltip increases rapidly, to the point that before I reach the 1030th row, the tooltip is no longer visible on my screen.

The same thing also happens for tooltips on hyperlinks. I'll use that case when describing how I can reproduce it.

Steps to reproduce:
1. All we need is an empty spreadsheet, so simply start Gnumeric.
2. Scroll down to the around the 1000th row.
3. Create a hyperlink in a cell, and give it a tooltip.
4. Let the mouse hover above the tooltip.


Actual results:
The tooltip appears at the correct X position, but too far down. Possibly outside the screen. If it doesn't work, repeat steps 3-4 further down in the document.

Expected results:
I would expect the tooltip to appear close to the mouse pointer or, in the case of autofill, near where the cursor was when I began autofilling.

Does this happen every time?
Yes. I can't give you the exact row number where it starts to happen, so I guess it might actually depend on how far down I've scrolled the document, rather than the row number.

Other information:
I'm running "unstable" Debian, though the problem happens both with Debian's Gnumeric packages and if I compile it myself. I haven't tried compiling any of the supporting libraries myself, though.

The position of the tooltip is calculated like this:

	GtkWidget *cw = GTK_WIDGET (FOO_CANVAS_ITEM (ic)->canvas);
	GdkWindow *cbw = GTK_LAYOUT (cw)->bin_window;
	int wx, wy;
	gdk_window_get_origin (cbw, &wx, &wy);

This particular snippet is from item_cursor_tip_setlabel(), though it's used in a couple of other places.

I don't know if this is a Gnumeric (1.9.9) problem, a GTK+ (2.16.2) problem, or somewhere in between. I believe this "foo canvas" thing is a part of libgoffice (0.7.8).
Comment 1 Andreas J. Guelzow 2009-06-22 06:18:11 UTC
I can replicate this with current git. Until about the 1000th row, the location of the hyperlink tool tip various, typically a touch too high, then suddenly at about 1000 rows it starts drifting down. Note that this does not happen with the comment tool-tip. 
Comment 2 Morten Welinder 2009-06-22 13:35:38 UTC
Replicated.

Cell comments sort-of work because they still use gdk_window_get_pointer.
That is fundamentally wrong, though.
Comment 3 Morten Welinder 2009-06-23 14:23:47 UTC
I think it's a gdk bug -- filed as bug 586756.  Let's see what they
think.
Comment 4 Morten Welinder 2009-06-23 17:35:30 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.


I worked around this.  When and if gdk gets fixed, we'll need to make the
workaround conditional.  See function gnm_canvas_get_position.