Bug 997645

Summary: gtk colored buttons
Product: [Fedora] Fedora Reporter: Adam Benjamin <adam>
Component: gnome-themes-standardAssignee: Cosimo Cecchi <ccecchi>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: ccecchi, perl-devel, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-02 02:55:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Benjamin 2013-08-15 21:05:41 UTC
Description of problem:  perl-gtk2 applications that set the background color for buttons aren't producing colored output.


Version-Release number of selected component (if applicable):  
perl-Gtk2-1.247-1.fc18.x86_64

How reproducible:

Create a trivial perl-gtk application with a coloured button.


Steps to Reproduce:
1. see below for code example to run

Actual results:

Button is created, but no colour.

Expected results:

Coloured button.  (Red.)

Additional info:

Note: this worked as expected in Fedora 17.  (perl-Gtk2-1.241-2.fc17.i686)

Sample colored button code:


#!/bin/perl

use Gtk2 qw/-init/;

my $window = Gtk2::Window->new;
$window->set_title("Window!");

my $button = Gtk2::Button->new("Coloured _button");
# does not affect text
$button->modify_bg(normal => Gtk2::Gdk::Color->new(0xffff, 0, 0));

$window->add($button);
$window->show_all;

Gtk2->main;

Comment 1 Fedora End Of Life 2013-12-21 14:28:53 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Adam Benjamin 2014-01-17 21:32:57 UTC
Definitely still a problem with Fedora 19

Comment 3 Tom "spot" Callaway 2014-02-11 20:29:13 UTC
If you're trying to set the text color in the button, this code works:

($button->get_children)[0]->modify_fg(normal => Gtk2::Gdk::Color->new(0xffff, 0, 0));

If you're trying to set the background color in the button, man... I don't know if that's ever worked right. I think Gtk3 uses CSS to do that reliably.

You might try opening this bug with the perl-Gtk2 upstream.

Comment 4 Adam Benjamin 2014-02-11 20:51:22 UTC
I believe, technically, it was the button background color that I was changing.  ie. the above code fragment is given as an example by others and definitely used to work for me in Gtk2.  As noted, it used to be working in Fedora 17 and earlier.  Something changed on upgrade - no idea what.  I was running the same code on both versions and getting different results, visually.

If the right path is to open up a ticket upstream, please point me in the right direction.  (Though I've never tried this with a different distro - so I've no idea if it's perl-Gtk2 in general.)

Thanks for your assistance, and let me know if I can provide more information.

Comment 5 Tom "spot" Callaway 2014-06-25 14:19:09 UTC
Revisiting this... I tested the perl-GTK2 that was in Fedora 17 (1.241) and it doesn't make a colored button in Fedora 20 and your test code.

So... this is either a behavior that changed in GTK2 between Fedora 17 (2.24.13) and now (2.24.22) or.... something else. Either way, I think the perl-Gtk2 upstream is the place to open this bug.

Comment 6 Adam Benjamin 2014-07-02 14:45:04 UTC
Opened as Bug 732628.  (https://bugzilla.gnome.org/show_bug.cgi?id=732628)

Comment 7 Adam Benjamin 2014-08-11 18:10:54 UTC
According to the upstream folks, this is a problem with the Adwaita theme as changing to a HighContrast theme (for example) fixes the problem. So, perhaps this isn't a perl-gtk2 bug, but it sounds like it's a Fedora-specific (or, at least, theme specific) bug.  Thoughts?

Comment 8 Tom "spot" Callaway 2014-09-19 16:05:09 UTC
Bet you thought I forgot about this one. ;)

I found a hacky way to "fix" the Adwaita theme to respect the button coloring, add this line to /usr/share/themes/Adwaita/gtk-2.0/gtkrc

     class "GtkButton" style "button"

A patch would look like this:

--- /usr/share/themes/Adwaita/gtk-2.0/gtkrc.ORIG	2014-09-19 11:29:39.196388897 -0400
+++ /usr/share/themes/Adwaita/gtk-2.0/gtkrc	2014-09-19 11:55:25.608067462 -0400
@@ -5,6 +5,8 @@
 gtk-auto-mnemonics              = 1
 gtk-primary-button-warps-slider = 1
 
+class "GtkButton" style "button"
+
 style "default"
 {
 	xthickness	= 1

*****

I say that it is a hack, because it seems to change a lot of the other visual behavior of gtk2 apps as well. I suspect strongly that there is a more nuanced, specific change that can be made to the gtkrc to permit GtkButton buttons to be recolorable, but I don't know what it is.

Reassigning this bug to gnome-theme-standard in the hopes that the maintainer there will know a more precise change to make to the Adwaita theme.

Comment 9 Fedora End Of Life 2015-01-09 19:28:05 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Adam Benjamin 2015-01-19 16:16:39 UTC
Still a problem in Fedora 20.

Comment 11 Fedora End Of Life 2015-05-29 09:19:29 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Adam Benjamin 2015-06-05 19:44:12 UTC
Still a problem in Fedora 21.  And a frustrating one, if low priority.  :/

Comment 13 Tom "spot" Callaway 2015-06-05 20:09:33 UTC
You may have better luck filing this bug in upstream GNOME. :/

Comment 14 Adam Benjamin 2015-06-12 15:11:19 UTC
Forgive me, but I'm not sure I understand.  By upstream, you mean non-Fedora specific?  Is the adwaita theme generic GNOME rather than Fedora specific?

Comment 15 Tom "spot" Callaway 2015-06-13 20:40:10 UTC
Yes. The adwaita theme is part of upstream gtk3 now.

Comment 16 Fedora End Of Life 2015-11-04 11:27:42 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 17 Fedora End Of Life 2015-12-02 02:55:41 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.