Created attachment 7651 Patch that solves the problem. In GTK version 3 default state for CSS context style is GTK_STATE_FLAG_DIR_LTR [1]. This causes every call to gtk_style_context_get_color with GTK_STATE_NORMAL change its state internally and queue redraw. This call in panel_window_draw [2] makes it queue redraw on each redraw. This makes panel window get redrawn on every frame. This consumes about 40% of my CPU. The solution is to call gtk_style_context_get_color with actual node style. Patch is attached. [1] https://github.com/GNOME/gtk/blob/e6d104bfa06c82630215d8ecba6d644976d99ac5/gtk/gtkstylecontext.c#L469 [2] https://git.xfce.org/xfce/xfce4-panel/tree/panel/panel-window.c?id=72be2b1ef798bcb5673ed45c5368955fb94974d4#n847
Viktor Semykin referenced this bugreport in commit c5e59cb2e28568629d62d5485ce97e9711b3ad84 Get the actual widget state flags to avoid constant redraws (Bug #14307) https://git.xfce.org/xfce/xfce4-panel/commit?id=c5e59cb2e28568629d62d5485ce97e9711b3ad84
Thanks for the patch, that makes a lot of sense!