Detaching tab doesn't re-wire its relation to the window

Bug #905759 reported by mahmoud
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Midori Web Browser
Fix Released
Undecided
Unassigned

Bug Description

I use Midori 0.4.2 on openSUSE 12.1 Gnome 3
When i drag a tab to make it in a separate window then click on a link from that window to open in new tab the new tab open in the original window not in the new window

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

I'm interested in fixing this, but it'll take a little work because of how things are currently done.

_midori_browser_add_tab is the main culprit here: it connects numerous signals on the midoriview with the browser in which the view was originally created as a data argument. This means we need to disconnect all these signals when we add the view to a new browser. In addition, the function adds the view to the browser's set of items, so we'll have to undo that. I'd probably put these operations into a function, _midori_browser_remove_tab (with the current function of that name becoming perhaps _midori_browser_destroy_tab), which is more or less the inverse of the portion of _midori_browser_add_tab that attaches the midoriview to the midoribrowser.

These changes seem like they'd be sufficient to fix the problem of tabs not knowing that they no longer "belong" to their old owner when they get dragged into a new window. If there are no concerns I'll get to writing a patch along these lines soonish.

gue5t gue5t (gue5t)
tags: added: multiwindow tabs
Revision history for this message
Cris Dywan (kalikiana) wrote :

The _midori_browser_remove_tab → _midori_browser_destroy_tab proposal sounds like the right approach to me. One snack for thought here is to double-check how extensions behave and if they have a similar flaw.

Changed in midori:
status: New → Confirmed
summary: - ditacheing a tab is not a real cetache
+ Detaching tab doesn't re-wire its relation to the window
Revision history for this message
gue5t gue5t (gue5t) wrote :

The attached patch renames MidoriBrowser's public API for closing tabs to midori_browser_close_tab from midori_browser_remove_tab, and allows tabs to be moved between windows. This works under GTK2 and GTK3, and works under Granite without bugs *except* for those caused by the lack of any signal for tabs being dragged between different preexisting notebooks under granite; see the bug report at <https://bugs.launchpad.net/granite/+bug/1066578>.

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

I ran the patch for testing for a bit and tweaked it a little (style, now-redundant if's). I'm liking the distinction between connection and closing.

Changed in midori:
status: Confirmed → Fix Committed
Changed in midori:
status: Fix Committed → Fix Released
Cris Dywan (kalikiana)
Changed in midori:
status: Fix Released → Fix Committed
Cris Dywan (kalikiana)
Changed in midori:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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