! 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 !
XfceArrowButton doesn't respect flat relief when blinking
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Libxfce4panel

Comments

Description Viktor Odintsev editbugs 2017-05-28 17:09:16 CEST
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.
Comment 1 Simon Steinbeiss editbugs 2017-05-28 23:45:41 CEST
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).
Comment 2 Viktor Odintsev editbugs 2017-05-28 23:48:26 CEST
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.
Comment 3 Simon Steinbeiss editbugs 2017-05-28 23:50:43 CEST
OK, that's the general context, but how can I reproduce it? :)
Comment 4 Viktor Odintsev editbugs 2017-05-28 23:53:54 CEST
Hmm, for example, some messengers make button blink when receive a message being minimized. Hexchat and Gajim works so.
Comment 5 Simon Steinbeiss editbugs 2017-05-30 00:03:12 CEST
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.
Comment 6 Viktor Odintsev editbugs 2017-05-30 00:12:13 CEST
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.
Comment 7 Simon Steinbeiss editbugs 2017-05-30 08:36:24 CEST
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.
Comment 8 Simon Steinbeiss editbugs 2017-05-30 23:39:46 CEST
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.
Comment 9 Simon Steinbeiss editbugs 2017-05-30 23:40:11 CEST
(Note: the animation is far from final, only there to show it works.)
Comment 10 Git Bot editbugs 2017-06-11 13:46:53 CEST
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
Comment 11 Simon Steinbeiss editbugs 2017-06-11 13:48:17 CEST
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.

Bug #13599

Reported by:
Viktor Odintsev
Reported on: 2017-05-28
Last modified on: 2017-06-11

People

Assignee:
Simon Steinbeiss
CC List:
2 users

Version

Version:
4.13.0

Attachments

Additional information