! 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 !
Panel double-exposes child widgets resulting in ugly text.
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description bearoso+xfce.bugzilla 2010-11-25 14:53:46 CET
Created attachment 3207 
Patch to panel to prevent double exposure

The panel expose handler is sending the expose event to child widgets twice--someone added code to do this, but it's already handled automatically through its 'FALSE' return value. Gtk+ only clears or buffer-swaps once, so this results in text being drawn over itself a second time (and everything else is drawn twice, too). You can fix this by simply getting rid of the extra code. (attached patch)
Comment 1 Nick Schermer editbugs 2010-11-25 18:17:39 CET
Patch applied in 5db5434. If you use git-format-patch next time, you can get the credits too.
Comment 2 bearoso+xfce.bugzilla 2011-01-23 09:38:49 CET
This is obviously back (since the commit was reverted due to side-effects with custom-color panels). Need to find out why certain widgets are getting exposed twice in the panel's normal-background mode.
Comment 3 bearoso+xfce.bugzilla 2011-01-23 10:39:22 CET
It seems if I remove the expose call at panel/panel-base-window.c:454 and the subsequent if statement, then the problem disappears. Doing this, it looks like there are no ill effects on the color-panel mode or any missing applets. Of course, I don't know whether or not that was put there to work around some other bug.
Comment 4 Nick Schermer editbugs 2011-01-23 12:03:01 CET
We need to chain up events to if gtkwindow has anything to draw it can do that too. Why is this exactly a problem?
Comment 5 bearoso+xfce.bugzilla 2011-01-23 13:46:00 CET
(In reply to comment #4)
> We need to chain up events to if gtkwindow has anything to draw it can do that
> too. Why is this exactly a problem?
It's sending another signal that automatically propagates back down to the panel applets again and they draw twice. This wouldn't normally be a problem aside from the extra cpu time. With the normal panel style, however, any text that is drawn directly onto the panel background (like the clock applet or the flat window-list buttons) doubles up. And when you alpha blend the text over itself the contrast goes out of whack and the text looks weird. 

I don't understand why it's calling the expose on the parent window. If the child widgets are receiving the expose then it's because they occlude the parent window and are the only window that update that region anyways. The parent's expose handler should trigger for anything that isn't covered by a child window and it can handle things then. It doesn't look like there's a custom handler for the GtkWindow, so I don't know what you need it to do that it wouldn't do automatically.
Comment 6 Nick Schermer editbugs 2011-01-23 14:07:01 CET
Created attachment 3400 
Drop chain expose

Yeah, looked though the gtk code, but the GtkContainer also exposes the child, so it get triggered twice. With the attached patch, as you suggested, I see no problems, could you give it a shot?
Comment 7 bearoso+xfce.bugzilla 2011-01-23 21:46:48 CET
Created attachment 3408 
Drop chain expose 2

Yeah, that works great. You missed removing the result var from one of the returns inside an assertion, though. The attached patch adds that.
Comment 8 Nick Schermer editbugs 2011-01-23 22:30:13 CET
Ok thanks for the searching, applied in 23fa1ae.
Comment 9 Jean-François Wauthy editbugs 2011-01-26 09:07:25 CET
*** Bug 7186 has been marked as a duplicate of this bug. ***

Bug #6872

Reported by:
bearoso+xfce.bugzilla
Reported on: 2010-11-25
Last modified on: 2011-01-26
Duplicates (1):
  • 7186 Hinting is applied on the panel texts

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
4.7 (master)

Attachments

Patch to panel to prevent double exposure (820 bytes, patch)
2010-11-25 14:53 CET , bearoso+xfce.bugzilla
no flags
Drop chain expose (1012 bytes, patch)
2011-01-23 14:07 CET , Nick Schermer
no flags
Drop chain expose 2 (1.22 KB, patch)
2011-01-23 21:46 CET , bearoso+xfce.bugzilla
no flags

Additional information