Middle clicking empty space just above open tab opens new tab instead of closing it

Bug #1032477 reported by whiplash
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Midori Web Browser
Invalid
Undecided
Unassigned

Bug Description

There is a small 1-2 pixel space above every tab that if middle clicked, won't close the tab but will instead open a new one. I've surprised myself by how often I hit that empty space when moving to close a tab!

Command line midori https://bugs.launchpad.net/midori/+filebug/52995d66-dd26-11e1-af55-68b5996a96c8?
Midori 0.4.6 (de.twotoasts.midori_9213f3b7ac21c2c719c20a6e4311126b__0)
GTK+ 2.24.10 (2.24.10) Glib 2.32.3 (2.32.3)
WebKitGTK+ 1.8.1 (1.8.0) libsoup 2.38.1
cairo 1.10.2 (1.10.2)
gcr No
granite No
libnotify 0.7.5
single instance libunique 1.1.6
Platform X11; Linux i686

Related branches

Revision history for this message
whiplash (whiplash000) wrote :
Revision history for this message
gue5t gue5t (gue5t) wrote :

This has the same underlying cause as <https://bugs.launchpad.net/midori/+bug/1027442>. That said I do appreciate the annoyance of this behavior for the UI; it's gotten me multiple times.

To clarify upon the symptoms of this bug report a bit, there's also some area below and to the left and right of individual tabs where a middle-click results in a new tab. This is all caused by the fact that GTK gives regions to tabs that don't completely fill the tab bar, which is basically non-negotiable. A workaround would involve determining which pixel regions 'belong' to individual tabs, which is doable but might be a little hairy. I'll see if I can get something working.

tags: added: negative-space tabs
removed: apport-bug i386 precise third-party-packages
Revision history for this message
gue5t gue5t (gue5t) wrote :

Here's some pseudocode-ish pygtk code for how this would work; I'll have to come back to it later.

def notebook_middle_clicked(notebook, point):
 foreach(tab in notebook.get_children()):
  eventbox=notebook.get_tab_label(tab)
  if eventbox.get_mapped():
   compare to eventbox.get_allocation()
   return
 #if none matched:
 notebook.add_new_tab_at_end()

Revision history for this message
gue5t gue5t (gue5t) wrote :

See attached patch, which is a little hairy but fixes the bug.

Revision history for this message
Cris Dywan (kalikiana) wrote :

To me this looks like a bug in Gtk.Notebook and I'd prefer to see this discussed upstream first. This is quite a huge hack into the notebook innards for a small detail.

Changed in midori:
status: New → Confirmed
description: updated
Revision history for this message
Danielle Foré (danrabbit) wrote :

Marking as invalid since this is dependent on your stylesheet and gtk.notebook and really isn't a Midori-specific problem.

Changed in midori:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.