GNOME Bugzilla – Bug 100274
using gdk_window_scroll with guffaw scrolling and an overlapping window fails to paint area damaged by overlapping window
Last modified: 2004-12-22 21:47:04 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.
Created attachment 12725 [details] (289 line) test case
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.
Created attachment 12726 [details] [review] Patch fixing problem
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)