Bug 308533

Summary: Use the provided cairo context when drawing the composite child
Product: [Plasma] Oxygen Reporter: Cosimo Cecchi <cosimo.cecchi>
Component: gtk3-engineAssignee: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Status: RESOLVED FIXED    
Severity: normal CC: b7.10110111, hugo.pereira.da.costa, rdieter, web
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: patch
patch v2

Description Cosimo Cecchi 2012-10-17 05:32:00 UTC
When drawing the composite child of a GtkScrolledWindow, use the provided cairo context instead of calling gdk_cairo_create() manually.
The following patch can be applied in any case, but when used together with the patch at [1], it fixes issues like those explained here [2].

Thanks

[1] https://bugzilla.gnome.org/show_bug.cgi?id=686265
[2] https://bugzilla.redhat.com/show_bug.cgi?id=864058

Reproducible: Always
Comment 1 Cosimo Cecchi 2012-10-17 05:32:49 UTC
Created attachment 74592 [details]
patch
Comment 2 Hugo Pereira Da Costa 2012-10-17 08:05:31 UTC
Applying the patch on the current gtk3 branch, I get the following for oxygen-gtk3-demo.

http://wstaw.org/m/2012/10/17/plasma-desktopmN3871.png

Can you reproduce ? 
There must be some offset calculation wrong in the path and I'll investigate (since I believe your patch makes sense).

Will also see if backport is possible/needed on the master branch.
Will keep you posted.

Hugo
Comment 3 Cosimo Cecchi 2012-10-17 13:31:30 UTC
(In reply to comment #2)
> Applying the patch on the current gtk3 branch, I get the following for
> oxygen-gtk3-demo.
> 
> http://wstaw.org/m/2012/10/17/plasma-desktopmN3871.png
> 
> Can you reproduce ? 
> There must be some offset calculation wrong in the path and I'll investigate
> (since I believe your patch makes sense).

Yeah, I can see this (it doesn't happen with all applications). I have an updated patch that fixes this too.
Comment 4 Cosimo Cecchi 2012-10-17 13:34:27 UTC
Created attachment 74600 [details]
patch v2
Comment 5 Hugo Pereira Da Costa 2012-10-17 13:36:04 UTC
Awesome.
I'll test asap and push.
Thanks for looking into this ! 

Hugo
Comment 6 Hugo Pereira Da Costa 2012-10-18 08:01:27 UTC
Git commit f4c75ee3001f859f57f749b1c4dfcd2c23e4e755 by Hugo Pereira Da Costa.
Committed on 18/10/2012 at 09:59.
Pushed by hpereiradacosta into branch 'gtk3'.

Fixed rendering of composited child. Use cairo_t* context directly, rather than having (incorectly) an event structure passed to the arguments.

M  +7    -10   src/animations/oxygeninnershadowdata.cpp
M  +1    -1    src/animations/oxygeninnershadowdata.h

http://commits.kde.org/oxygen-gtk/f4c75ee3001f859f57f749b1c4dfcd2c23e4e755
Comment 7 Hugo Pereira Da Costa 2012-10-18 08:01:27 UTC
Git commit e0c7c927d5f4cac084b9eb1bb98d81a2a0d8bd86 by Hugo Pereira Da Costa.
Committed on 18/10/2012 at 09:59.
Pushed by hpereiradacosta into branch 'gtk3-1.1'.

Fixed rendering of composited child. Use cairo_t* context directly, rather than having (incorectly) an event structure passed to the arguments.

M  +7    -10   src/animations/oxygeninnershadowdata.cpp
M  +1    -1    src/animations/oxygeninnershadowdata.h

http://commits.kde.org/oxygen-gtk/e0c7c927d5f4cac084b9eb1bb98d81a2a0d8bd86
Comment 8 Hugo Pereira Da Costa 2012-10-18 08:03:30 UTC
Ok. pushed.
in fact your patch uncovered a bug. It was incorrect to expect a GdkEventExpose* event passed as arguments to the callback, since it was connected to the "draw" signal. I guess it was an incorrect porting from the master (gtk2) branch. 
I checked that this cannot be backported to gtk2, since there is no "draw" signal there (but "expose", to which we properly connect).

Cheers,

Hugo