After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 109213 - GtkNotebook buttons in labels get highlighted on tab switch
GtkNotebook buttons in labels get highlighted on tab switch
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 112722 112963 114700 120802 131204 (view as bug list)
Depends on: 98207
Blocks:
 
 
Reported: 2003-03-26 00:42 UTC by Benjamin Otte (Company)
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a bug :) (24.32 KB, image/png)
2003-03-26 00:43 UTC, Benjamin Otte (Company)
  Details
Python example of workaround for this problem (1.12 KB, text/plain)
2003-07-25 14:15 UTC, Dave Cook
  Details
Patch to fix the bug with buttons in notebook tab labels (538 bytes, patch)
2003-11-13 22:21 UTC, Rodney Dawes
none Details | Review
Revised patch to fix buttons in GtkNotebook tab labels (679 bytes, patch)
2003-11-13 23:34 UTC, Rodney Dawes
none Details | Review

Description Benjamin Otte (Company) 2003-03-26 00:42:30 UTC
Open Galeon.
Open a second tab.
Switch from one tab to another (either via mouse or Ctrl-PgUp/PgDown)

The close button in the inactive labels will be highlighted. The
highlighting  will disappear when moving the mouse over the button and away
again.

I'm posting this here and not on Galeon because I believe this bug only
appeared after updating from 2.2 to 2.2.1, though I'm not sure about this.

I'll attach a screenshot showing the bahaviour.
Comment 1 Benjamin Otte (Company) 2003-03-26 00:43:52 UTC
Created attachment 15205 [details]
a bug :)
Comment 2 Owen Taylor 2003-05-14 15:51:04 UTC
*** Bug 112963 has been marked as a duplicate of this bug. ***
Comment 3 Xan Lopez 2003-05-17 10:33:30 UTC
*** Bug 112722 has been marked as a duplicate of this bug. ***
Comment 4 Owen Taylor 2003-05-20 01:58:34 UTC
The problem here is the change from bug 93389 which propagates
state to child widgets. We probably need some way for
GtkButton to avoid picking up the state from it's parent.
Comment 5 Marco Pesenti Gritti 2003-06-08 18:43:47 UTC
*** Bug 114700 has been marked as a duplicate of this bug. ***
Comment 6 Dave Cook 2003-07-25 14:15:22 UTC
Created attachment 18602 [details]
Python example of workaround for this problem
Comment 7 Kristian Rietveld 2003-08-20 22:12:48 UTC
We want to add a widget flag "does not inherit state". Because this
adds API, this has to be done in private for the 2.2 series. Though,
we feel that it's better to do this correctly at once, in public, in
the 2.4 series.

Punting to 2.4 API Freeze.
Comment 8 Christian Persch 2003-08-27 06:50:48 UTC
*** Bug 120802 has been marked as a duplicate of this bug. ***
Comment 9 Rodney Dawes 2003-11-13 22:20:04 UTC
I made a patch which fixes this problem. It doesn't break the API or
ABI (afaik), and fixes the issue for all cases in 2.2. I'm sure this
patch would be easily ported to HEAD as well.
Comment 10 Rodney Dawes 2003-11-13 22:21:08 UTC
Created attachment 21424 [details] [review]
Patch to fix the bug with buttons in notebook tab labels
Comment 11 Soren Sandmann Pedersen 2003-11-13 23:12:24 UTC
This patch makes sense to me. An active, RELIEF_NONE button that isn't
depressed should probably not have a bevel drawn.

The test in the patch is logically equivalent to

     if (relief != none || 
         (active && depressed) || prelighted || selected)
            paint_box();

which makes me wonder if it shouldn't simply be

    if (relief != none || depressed || prelighted)
           paint_box ();
Comment 12 Rodney Dawes 2003-11-13 23:34:20 UTC
Created attachment 21429 [details] [review]
Revised patch to fix buttons in GtkNotebook tab labels
Comment 13 Rodney Dawes 2003-11-13 23:35:00 UTC
Attached new patch that changes the logic to ssp's suggested conditional.
Comment 14 Rodney Dawes 2003-12-22 19:01:35 UTC
Can I commit this patch?
Comment 15 Christian Persch 2004-01-12 10:55:55 UTC
*** Bug 131204 has been marked as a duplicate of this bug. ***
Comment 16 Matthias Clasen 2004-02-05 11:14:44 UTC
Moving to 2.4.0 as the proposed fix doesn't involve API changes.
Comment 17 Owen Taylor 2004-02-12 23:37:42 UTC
The patch looks fine (I seem to remember that button->depressed
is a GTK+-2.0 era addition, which is probably why it isn't
used currently.)

It's not really a complete solution to the problem (try 
entering and leaving a non-active tab) but without fixing
bug 93389 it's probably about as good as you can do.
After applying this patch, I'd mark this as depending
on bug 93389 and move it to a later milestone.
Comment 18 Matthias Clasen 2004-02-13 00:21:59 UTC
I guess you mean bug 98207, as the one you mentioned is already fixed.
Comment 19 Federico Mena Quintero 2004-03-03 20:10:06 UTC
For reference, the patch was applied to 2.3.x on 2003-02-13.

Should I leave the bug open?
Comment 20 Rodney Dawes 2004-03-03 20:19:24 UTC
It would be nice if I could commit the patch to the 2.2 branch also,
since it doesn't break API, and fixes a rather annoying bug that was
introduced in the 2.2 cycle by a fix for another bug in GtkContainer
(I believe). I don't know why the target milestone got set to 2.6 api
freeze though, since it has apparently been accepted into 2.3.
Comment 21 Owen Taylor 2004-03-03 20:29:40 UTC
No new backports to 2.2.x are being done currently. The chance
that we'll get to a 2.2.5 before 2.4.0 next Monday is minimal.

Fri Feb 13 01:31:44 2004  Matthias Clasen  <maclas@gmx.de>
                                                                     
          
        * gtk/gtkbutton.c (_gtk_button_paint): Don't draw bevels around
        active, RELIEF_NONE buttons that aren't depressed. This improves
        the appearance of buttons in notebook tabs.  (#109213, reported
        by Benjamin Otte, patch by Rodney Dawes)

I think the reason that this is kept open maybe the dependency
on bug 98207 for a real fix, but probably simpler to just
close this and do a comprehensive review when we fix 98207.
Comment 22 Rodney Dawes 2004-03-03 20:47:31 UTC
I don't know if I would call it a "new backport" since the patch was
made against 2.2 and only applied to 2.3. I've been using the patch
with 2.2, on several systems, since 2003-11-13 when I created the
original patch. Whether or not a 2.2.5 comes out by 2.4 seems
irrelevant to whether or not the patch should at least go into the branch.