! 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 !
Changing wnck default icon size leads to an infinite signal loop
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Window Buttons

Comments

Description Alistair Buxton 2018-12-12 18:16:38 CET
This is caused by https://git.xfce.org/xfce/xfce4-panel/commit/plugins/tasklist/tasklist-widget.c?id=fc4efcc991b21d191f0b82412fb33070009780c5

To reproduce this you need to have two panels with tasklists and they must have different sizes, such that they have different icon sizes.

The panel connects to the wnck icon-changed signal for normal and grouped buttons:

https://git.xfce.org/xfce/xfce4-panel/tree/plugins/tasklist/tasklist-widget.c#n3386
https://git.xfce.org/xfce/xfce4-panel/tree/plugins/tasklist/tasklist-widget.c#n3990

Inside the signal handlers for these events, first wnck_set_default_icon_size is called immediately followed by wnck_window_get_icon or wnck_window_get_mini_icon:

https://git.xfce.org/xfce/xfce4-panel/tree/plugins/tasklist/tasklist-widget.c#n2570
https://git.xfce.org/xfce/xfce4-panel/tree/plugins/tasklist/tasklist-widget.c#n3745

Inside wnck there is an icon cache. When you call wnck_set_default_icon_size it changes a global value for all icons. Then when you call wnck_window_get_icon, the cache is invalidated:

https://github.com/GNOME/libwnck/blob/master/libwnck/xutils.c#L2178

When the icon cache is invalidated, wnck emits the icon-changed signal:

https://github.com/GNOME/libwnck/blob/master/libwnck/window.c#L2126

When your *other* panel receives the icon-changed signal it will call the signal handler, which will call wnck_set_default_icon_size to its preferred value, causing the cache to be invalidated again, causing another icon changed signal to be emitted, which causes the first panel to set its preferred default size again. The two panels will keep arguing over the default icon size forever, and the panel can be observed using higher than normal CPU.

One side effect of this is that the setting to show only windows from the current monitor stops working. I am not exactly sure why but this is only a side effect. I think it is because the endless icon-changed signals have higher priority than configure-event which is idle.
Comment 1 Alistair Buxton 2018-12-12 18:22:15 CET
Some further observations.

The ability to change the default icon size has previously been removed from wnck because of this exact issue. See the commit log for window.c here (way back in 2002):

https://github.com/GNOME/libwnck/commit/4b216137230d2fac212b42b42acb8267e604c0a7

It was re-added in 2013 here:

https://github.com/GNOME/libwnck/commit/7b9f3a31edc12fdb8c30711ed2615031bf0b0135
Comment 3 Git Bot editbugs 2019-01-19 03:33:46 CET
Sean Davis referenced this bugreport in commit 3e67fc6c8953cef42cbe7b1beaca6886ad7c0480

Revert "Replace ExoCellRendererIcon with GtkCellRendererPixbuf to improve the icon chooser appearance (bug #14970)"

https://git.xfce.org/xfce/exo/commit?id=3e67fc6c8953cef42cbe7b1beaca6886ad7c0480
Comment 4 Git Bot editbugs 2019-01-19 03:33:49 CET
Sean Davis referenced this bugreport in commit f8de4e34c0432c518e803fc2d16d395f095ca3b7

Fix ExoCellRendererIcon rendering with GTK 3 (bug #14970)

https://git.xfce.org/xfce/exo/commit?id=f8de4e34c0432c518e803fc2d16d395f095ca3b7
Comment 5 Sean Davis editbugs 2019-01-19 03:36:44 CET
Sorry for the bug number spam. Meant for exo, https://bugzilla.xfce.org/show_bug.cgi?id=14971

Bug #14970

Reported by:
Alistair Buxton
Reported on: 2018-12-12
Last modified on: 2019-01-19

People

Assignee:
Nick Schermer
CC List:
2 users

Version

Version:
4.13.3

Attachments

Additional information