GNOME Bugzilla – Bug 648116
Tab close button is too sensitive
Last modified: 2011-06-07 15:09:55 UTC
Created attachment 186203 [details] Example when pointer points outside cross Tab close button is sensitive to click on too bigger area which results in accidental closing tabs instead of switching.
Created attachment 186204 [details] Example when whole pointer is outside area
I'd say this is just the theme being broken. The sensitive area is the button, you are simply not getting any feedback for the hover effect?
(In reply to comment #2) > I'd say this is just the theme being broken. Why gedit 'works'? > The sensitive area is the button, > you are simply not getting any feedback for the hover effect? I have but when I switch the tab I don't think if the effect is hover effect is present - I just click.
(In reply to comment #3) > (In reply to comment #2) > > I'd say this is just the theme being broken. > > Why gedit 'works'? We don't use the same code that gedit uses. Since it's custom code (in both cases), I guess one happens to work better with the new theme. There's a patch proposal to share this bit between both apps, we should probably do that. > > > The sensitive area is the button, > > you are simply not getting any feedback for the hover effect? > > I have but when I switch the tab I don't think if the effect is hover effect is > present - I just click. I don't know, I'm testing git HEAD and the sensitive area is basically exactly as big as the close button. If that's the case for you I'm not sure what you are requesting... make the button smaller?
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > The sensitive area is the button, > > > you are simply not getting any feedback for the hover effect? > > > > I have but when I switch the tab I don't think if the effect is hover effect is > > present - I just click. > > I don't know, I'm testing git HEAD and the sensitive area is basically exactly > as big as the close button. If that's the case for you I'm not sure what you > are requesting... make the button smaller? Make the sensitive area smaller so only clicking cross (or rather circumscribed box) would close the button. So in short it is fixed in master?
Created attachment 186862 [details] Comparation between gnome-terminal (lower tab) and epiphany (upper tab) I have the same problem with epiphany 3.0.1. I have this problem neither with gedit nor gnome terminal. The size of X in each case is the same but on epiphany there is much larger in vertical space (larger width).
The same issue seems to happen with nautilus in GNOME 3: the sensitive area seems to be too big, as in the case of epiphany, while in gedit and gnome-terminal it's actually way smaller. So it's definitely not an issue happening in epiphany only.
Ok, it looks gedit and gnome-terminal use both the same trick to workaround this issue: a special kind of GtkButton (Which they call TerminalCloseButton and GEditCloseButton) to set some theme properties depending on them using GNOME 2 or 3. This is what they use in GEdit (See http://git.gnome.org/browse/gedit/tree/gedit/gedit-close-button.c): static void gedit_close_button_class_init (GeditCloseButtonClass *klass) { static const gchar button_style[] = "* {\n" "-GtkButton-default-border : 0;\n" "-GtkButton-default-outside-border : 0;\n" "-GtkButton-inner-border: 0;\n" "-GtkWidget-focus-line-width : 0;\n" "-GtkWidget-focus-padding : 0;\n" "padding: 0;\n" "}"; klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, GEDIT_TYPE_CLOSE_BUTTON, GeditCloseButtonClassPrivate); klass->priv->css = gtk_css_provider_new (); gtk_css_provider_load_from_data (klass->priv->css, button_style, -1, NULL); } ...and this is what they use in GNOME terminal (see http://git.gnome.org/browse/gnome-terminal/tree/src/terminal-close-button.c): static void terminal_close_button_class_init (TerminalCloseButtonClass *klass) { #if GTK_CHECK_VERSION (3, 0, 0) static const gchar button_style[] = "* {\n" "-GtkButton-default-border : 0;\n" "-GtkButton-default-outside-border : 0;\n" "-GtkButton-inner-border: 0;\n" "-GtkWidget-focus-line-width : 0;\n" "-GtkWidget-focus-padding : 0;\n" "padding: 0;\n" "}"; klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, TERMINAL_TYPE_CLOSE_BUTTON, TerminalCloseButtonClassPrivate); klass->priv->css = gtk_css_provider_new (); gtk_css_provider_load_from_data (klass->priv->css, button_style, -1, NULL); #else GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); widget_class->style_set = terminal_close_button_style_set; gtk_rc_parse_string ("style \"gnome-terminal-tab-close-button-style\"\n" "{\n" "GtkWidget::focus-padding = 0\n" "GtkWidget::focus-line-width = 0\n" "xthickness = 0\n" "ythickness = 0\n" "}\n" "widget \"*.gnome-terminal-tab-close-button\" style \"gnome-terminal-tab-close-button-style\""); #endif } This is the commit where they ported it for gnome-terminal: http://git.gnome.org/browse/gnome-terminal/commit/?id=c3a3e0600edbcbb51a5cb7489269e8afb6e48262 So, it seems that if we want the same behaviour in epiphany (and nautilus, and anywhere else...) we would need to so something similar there as well.
Created attachment 189312 [details] [review] Path proposal Patch proposal
Created attachment 189313 [details] Comparison between current state and the result of applying the patch We actually get rid of some pixels around the 'X' with the patch
Review of attachment 189312 [details] [review]: Looks good. Some day we should share all this stuff :)
(In reply to comment #11) > Review of attachment 189312 [details] [review]: > > Looks good. Thanks, committed. The fix will be available in the next major software release. > Some day we should share all this stuff :) Sure we should, but for the time being it's not that bad this way, as we laready had almost everything in place, that is, we did not need to add a EphyCloseButton, or the like :-)