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 679232 - Draw event not triggered for custom widget in GtkScrolledWindow
Draw event not triggered for custom widget in GtkScrolledWindow
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 648121
 
 
Reported: 2012-07-01 20:12 UTC by Bertrand Lorentz
Modified: 2013-07-30 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case showing the bug (3.92 KB, text/x-vala)
2012-07-01 20:12 UTC, Bertrand Lorentz
Details

Description Bertrand Lorentz 2012-07-01 20:12:55 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...
Comment 1 olivier dufour 2012-08-10 12:47:41 UTC
have you try to comment line 1493 to 1505 ? It is the only thing introduce in draw part?
Comment 2 Bertrand Lorentz 2012-08-10 14:35:49 UTC
(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!
Comment 3 olivier dufour 2012-10-13 05:09:31 UTC
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.
Comment 4 Cosimo Cecchi 2012-10-23 04:41:10 UTC
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.
Comment 5 Andrés G. Aragoneses (IRC: knocte) 2013-07-30 12:45:47 UTC
(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
Comment 6 Andrés G. Aragoneses (IRC: knocte) 2013-07-30 13:23:30 UTC
(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)