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 648116 - Tab close button is too sensitive
Tab close button is too sensitive
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Tabs
3.0.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-18 14:32 UTC by Maciej (Matthew) Piechotka
Modified: 2011-06-07 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example when pointer points outside cross (6.27 KB, image/png)
2011-04-18 14:32 UTC, Maciej (Matthew) Piechotka
  Details
Example when whole pointer is outside area (6.73 KB, image/png)
2011-04-18 14:32 UTC, Maciej (Matthew) Piechotka
  Details
Comparation between gnome-terminal (lower tab) and epiphany (upper tab) (4.29 KB, image/png)
2011-04-29 10:01 UTC, Maciej (Matthew) Piechotka
  Details
Path proposal (1.17 KB, patch)
2011-06-06 11:46 UTC, Mario Sánchez Prada
committed Details | Review
Comparison between current state and the result of applying the patch (10.86 KB, image/png)
2011-06-06 11:47 UTC, Mario Sánchez Prada
  Details

Description Maciej (Matthew) Piechotka 2011-04-18 14:32:17 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.
Comment 1 Maciej (Matthew) Piechotka 2011-04-18 14:32:53 UTC
Created attachment 186204 [details]
Example when whole pointer is outside area
Comment 2 Xan Lopez 2011-04-20 21:09:10 UTC
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?
Comment 3 Maciej (Matthew) Piechotka 2011-04-20 21:29:18 UTC
(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.
Comment 4 Xan Lopez 2011-04-20 21:50:08 UTC
(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?
Comment 5 Maciej (Matthew) Piechotka 2011-04-21 08:12:45 UTC
(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?
Comment 6 Maciej (Matthew) Piechotka 2011-04-29 10:01:54 UTC
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).
Comment 7 Mario Sánchez Prada 2011-06-06 10:40:01 UTC
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.
Comment 8 Mario Sánchez Prada 2011-06-06 11:06:53 UTC
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.
Comment 9 Mario Sánchez Prada 2011-06-06 11:46:28 UTC
Created attachment 189312 [details] [review]
Path proposal

Patch proposal
Comment 10 Mario Sánchez Prada 2011-06-06 11:47:44 UTC
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
Comment 11 Xan Lopez 2011-06-07 14:17:46 UTC
Review of attachment 189312 [details] [review]:

Looks good. Some day we should share all this stuff :)
Comment 12 Mario Sánchez Prada 2011-06-07 15:08:35 UTC
(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 :-)