! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Fix transparency issues with GTK3 plugins
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description Eric Koegel editbugs 2013-12-22 10:25:04 CET
Created attachment 5273 
Fix transparency issues with GTK3 plugins

When using the panel from git master (last commit 964741f5b67e5f4fa97bab338d980c5eea0fa09b) the panel has transparency issues with GTK3 plugins and doesn't apply custom colors or images for the panel background. 

This patch uses some GTK3 CSS magic written by Simon Steinbeiß to
make the GtkPlug button in the panel transparent. This patch also
removes the wrapper_plug_draw code and instead updates the panel's
background when the respective set function is called for gtk3
plugins.
Comment 1 Andrzej editbugs 2013-12-22 17:47:23 CET
Hi Eric,

Works pretty well but I have spotted one problem (below). It is quite a big change from how it worked before. Do we have to switch from draw method to gdk_window_set_background_pattern and gdk_window_set_background_rgba? Also, if you are no longer using draw method it can be removed completely, rather than forwarding rendering to a parent class.

The problem I have noticed that external gtk3 plugins draw a background image from offset (0,0) rather than blend into the rest of the panel (tested with xfce4-indicator-plugin in deskbar-mode, plugin placed near the bottom of the panel).
Comment 2 Andrzej editbugs 2013-12-22 23:03:25 CET
Correction. This happens with all external plugins (including Gtk2 notification area and action buttons).
Comment 3 Eric Koegel editbugs 2013-12-23 09:59:03 CET
Created attachment 5274 
Fix transparency issues with GTK3 plugins

So I think I have it working using the stuff that was in the draw code and I added a call to hopefully transform the drawing back to window coordinates. Let me know if I missed anything.
Comment 4 Andrzej editbugs 2013-12-23 14:05:21 CET
Thank you for putting this in the draw method. Not sure which approach is better but this seems closer to was was in the code before - so it should be less risky.

I still get the same behaviour, though - all external plugins have their background images offset. That is: there are several background images visible, one at the origin of the panel window, others at origins of external plugins.

I have noticed another (smaller) issue: when I select a background image, after a small delay (~0.5s) it shifts by a couple of pixels down/right.
Comment 5 Andrzej editbugs 2013-12-23 14:25:44 CET
A question, was it also a problem in older (4.10) versions of the panel?

You have only modified the draw method (gtk3) but gtk2 external plugins (systray, action buttons) that use an unmodified expose_event method have the same problem here.
Comment 6 Andrzej editbugs 2013-12-23 15:27:04 CET
Patch from Comment #3 pushed to master:

cdc3737 Fix transparency issues with GTK3 plugins

Both issues (background image offset, background image jump) are also present in 4.10 (were they always present or is it a regression?)

Also, branch nick/gtk3 is using gtk3 panel and plugins. The plugins (even internal ones) had transparent background issue, which were "fixed" but the workaround in libxfce4-panel.
Comment 7 Steve Dodier-Lazaro editbugs 2015-02-16 20:18:00 CET
I'm assuming from the last comment that this issue is fixed for 4.12 onwards. If it is not, please reopen it! If you want to reopen the report to track a backport of the patch on 4.10, please remember to update the milestone.

Bug #10561

Reported by:
Eric Koegel
Reported on: 2013-12-22
Last modified on: 2015-02-16

People

Assignee:
Nick Schermer
CC List:
3 users

Version

Version:
Unspecified

Attachments

Additional information