Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(950)

Unified Diff: chrome/browser/gtk/tabs/tab_gtk.cc

Issue 159158: Make middle-clicking on GTK tabs not count for closing if you release off of ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_gtk.cc (revision 21184)
+++ chrome/browser/gtk/tabs/tab_gtk.cc (working copy)
@@ -175,7 +175,12 @@
// static
gboolean TabGtk::OnMouseRelease(GtkWidget* widget, GdkEventButton* event,
TabGtk* tab) {
- if (event->button == 2) {
+ // Middle mouse up means close the tab, but only if the mouse is over it
+ // (like a button).
+ if (event->button == 2 &&
+ event->x >= 0 && event->y >= 0 &&
+ event->x < widget->allocation.width &&
+ event->y < widget.allocation.height) {
tab->delegate_->CloseTab(tab);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698