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 100274 - using gdk_window_scroll with guffaw scrolling and an overlapping window fails to paint area damaged by overlapping window
using gdk_window_scroll with guffaw scrolling and an overlapping window fails...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: Owen Taylor
Owen Taylor
Depends on:
Blocks:
 
 
Reported: 2002-12-03 21:45 UTC by Christopher Blizzard
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
(289 line) test case (8.03 KB, text/plain)
2002-12-03 22:43 UTC, Owen Taylor
  Details
Patch fixing problem (1.72 KB, patch)
2002-12-03 22:52 UTC, Owen Taylor
none Details | Review

Description Christopher Blizzard 2002-12-03 21:45:53 UTC
If you are using gdk_window_scroll() to scroll a window and that window
happens to have child windows gdk will use guffaw scrolling instead of
copyarea scrolling.  If there's an overlapping window, areas of the window
being scrolled will also be damaged and should be repainted.  Right now
they aren't repainted and the expose_event generated has the incorrect
source coordinates set in it.

Here's what owen says:

[15:55:08] <owen> OK, I see that the gdk_window_guffaw_scroll is pretty
clearly broken
[15:55:23] <owen> If you compare it to windodw gdk_window_copy_area_scroll()
[15:55:45] <owen> copy_area_scroll() has:
[15:55:57] <owen>       gdk_window_queue_translation (window, dx, dy);
[15:56:14] <owen> But guffaw_scroll_has:
[15:56:16] <owen>   gint d_xoffset = -dx;
[15:56:16] <owen>   gint d_yoffset = -dy;
[15:56:29] <owen>   if (d_xoffset < 0 || d_yoffset < 0)
[15:56:29] <owen>     gdk_window_queue_translation (window, MIN (d_xoffset,
0), MIN (d_yoffset, 0));
[15:56:31] <owen> [...]
[15:56:42] <owen>   if (d_xoffset > 0 || d_yoffset > 0)
[15:56:42] <owen>     gdk_window_queue_translation (window, MAX (d_xoffset,
0), MAX (d_yoffset, 0));
[15:57:25] <owen> So, the signs are opposite in the two cases ... but they
should be the same

[16:24:45] <owen> If you want to open the bug, that will help me remember;
I want to write a 20-line test case though before I commit a fix

Owen, it's all up to you.
Comment 1 Owen Taylor 2002-12-03 22:43:33 UTC
Created attachment 12725 [details]
(289 line) test case
Comment 2 Owen Taylor 2002-12-03 22:44:46 UTC
Attached a test case; if things were working properly, you'd
get a red trail when hitting the buttons in any direction,
but currently, there is no trail for negative offsets.
Comment 3 Owen Taylor 2002-12-03 22:52:58 UTC
Created attachment 12726 [details] [review]
Patch fixing problem
Comment 4 Owen Taylor 2002-12-03 22:56:17 UTC
Tue Dec  3 17:47:24 2002  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong
        sign for queued translation. (Found by Chris Blizzard,
        #100274)