GNOME Bugzilla – Bug 679232
Draw event not triggered for custom widget in GtkScrolledWindow
Last modified: 2013-07-30 13:23:30 UTC
Created attachment 217790 [details] Test case showing the bug If you add a custom widget that does its own drawing in a GtkScrolledWindow, the custom widget is never drawn. It seems the custom widget never sees the draw event. Scrolling seems OK, but nothing is displayed inside the scroll window This bug was apparently introduced by the following commit : http://git.gnome.org/browse/gtk+/commit/?id=f6393199 Going to the commit before that one, the bug is not there. I originally discovered the bug while working on the C# bindings for GTK+ 3. I'll attach a test case in vala, which is a conversion of the original C# test case available here: https://github.com/mono/gtk-sharp/blob/master/sample/CustomScrollableWidget.cs I hope this is good enough, my C is way too rusty...
have you try to comment line 1493 to 1505 ? It is the only thing introduce in draw part?
(In reply to comment #1) > have you try to comment line 1493 to 1505 ? It is the only thing introduce in > draw part? Yes, I've tried commenting out those lines, after a suggestion from Cosimo Cecchi during GUADEC. It doesn't change anything. Those lines change the way the background is drawn, but it doesn't have any impact on the problem: the custom widget does not get the draw signal anyway, so it is not drawn at all. Our theory is that the draw event is somehow mismatched between the overshoot_window and the custom widget, so it gets dropped somewhere. But we couldn't get any further. Any help is welcome!
Any gtk coder to help us on this bug. /me with pus in boots eyes I have few ideas which cause this bug just by reading the code: - gtk_scrolled_window_captured_event which need to handle draw event - gtk_scrolled_window_realize need maybe another event_mask. test with ALL_EVENTS_MASK will show if that is the issue - in gtk_scrolled_window_add: there is a test to set the parent windows maybe test is not valid and the parent window is never set with custom widget... - gtk_scrolled_window_map need to call draw of overshoot after the parent map call. I have no environment to test so I can only guess.
This was finally fixed by http://git.gnome.org/browse/gtk+/commit/?id=4c9db152126c263aa985addb7d8111f4500f9ee3 The event was getting dropped because the overshoot window didn't receive any expose events.
(In reply to comment #4) > This was finally fixed by > http://git.gnome.org/browse/gtk+/commit/?id=4c9db152126c263aa985addb7d8111f4500f9ee3 For the record, the first gtk+ version to include this fix was 3.7.0: https://git.gnome.org/browse/gtk+/commit/?id=b5495cd7da9752a15c9f573770d98f5375c08f4f (And sadly this is not the version included in Ubuntu 13.04*) * In my system: $ dpkg --list | grep libgtk-3 ii libgtk-3-0:amd64 3.6.4-0ubuntu8 amd64 GTK+ graphical user interface library
(In reply to comment #5) > (In reply to comment #4) > > This was finally fixed by > > http://git.gnome.org/browse/gtk+/commit/?id=4c9db152126c263aa985addb7d8111f4500f9ee3 > > For the record, the first gtk+ version to include this fix was 3.7.0: > https://git.gnome.org/browse/gtk+/commit/?id=b5495cd7da9752a15c9f573770d98f5375c08f4f > > (And sadly this is not the version included in Ubuntu 13.04*) Actually, it seems to be backported to the 3-6 branch! (3.6.2 in particular): https://git.gnome.org/browse/gtk+/commit/?id=6312dba24 (Because the fix that covered this bug was a fix for bug 686265 too)