Created attachment 7128 Example: fix XfceArrowButton blinking XfceArrowButton sets the GTK_RELIEF_NORMAL relief to the blinking button which makes the button look different if the previous relief was GTK_RELIEF_NONE. > gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL); Consider replacing relief handling with state flags handling (e.g. set and clear the GTK_STATE_FLAG_ACTIVE flag). As example I'm attaching a small patch which I use to fix this problem for Arc GTK theme. I don't know what way is right to fix this problem.
The approach looks sensible to me, to be honest I haven't paid too much attention to arrow buttons so far. There are potentially still a few more things to fix there... However, how can I most easily reproduce the behavior you describe in the report (I currently have zero arrowbuttons in my panel).
Arrow button is used by tasklist plugin for which you can enable flat icons in settings. I use Arc theme and there is a difference between normal and flat buttons with this configuration.
OK, that's the general context, but how can I reproduce it? :)
Hmm, for example, some messengers make button blink when receive a message being minimized. Hexchat and Gajim works so.
Created attachment 7133 Use flat class instead of messing with state flags Your patch works for me and makes the button blink with the themes I tested (Adwaita and Greybird). However messing with GtkStateFlags directly may not be the best approach, hence I attach a patch which uses the flat class. Should work with Adwaita for both the "flat button" and the "non-flat button" setting of the tasklist plugin.
Yes, it works for Adwaita but that's just because Adwaita's normal and flat reliefs differs only in inactive state (flat style is transparent). But on Arc theme different styles used for flat and normal buttons for all reliefs. That means that applying and removing flat style will almost work like changing the relief so in Arc theme I still see the difference.
Alright. I think I finally have an idea of how to solve this properly. We can stick to adding/removing classes but just define what that class should then do style-wise (like I did with the marching ants). I'll try to come up with an improved patch.
Created attachment 7135 Uses gtk CSS animation to make the button blink (proof of concept) So here goes a proof of concept of the idea I had yesterday after playing with the flat class.
(Note: the animation is far from final, only there to show it works.)
Viktor Odintsev referenced this bugreport in commit 746d2a74e6f2e2ef09db7adb7f0c88ed1f308532 Fix Gtk3 XfceArrowButtons not blinking (Bug #13599) https://git.xfce.org/xfce/xfce4-panel/commit?id=746d2a74e6f2e2ef09db7adb7f0c88ed1f308532
Decided to push your initial patch as it's fairly straight-forward and should work with all themes. Injecting custom CSS is nicer but also more error-prone and doesn't allow themers to customize. If we want people to be able to customize even more, we can additionally add a "blinking" class (as done in my patch) without theming it in the panel directly, so themes can use it.