mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Put more recently focused tabs in a window at the beginning of the named item search order. Bug 407421, r+sr=jst, a=schrep
This commit is contained in:
parent
b3acc391de
commit
964f9412f2
@ -1632,8 +1632,23 @@ nsresult nsXULWindow::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_ENSURE_TRUE(mTargetableShells.AppendObject(contentShellWeak),
|
||||
NS_ERROR_OUT_OF_MEMORY);
|
||||
// put the new shell at the start of the targetable shells list if either
|
||||
// it's the new primary shell or there is no existing primary shell (which
|
||||
// means that chances are this one just stopped being primary). If we
|
||||
// really cared, we could keep track of the "last no longer primary shell"
|
||||
// explicitly, but it probably doesn't matter enough: the difference would
|
||||
// only be felt in a situation where all shells were non-primary, which
|
||||
// doesn't happen much. In a situation where there is one and only one
|
||||
// primary shell, and in which shells get unmarked as primary before some
|
||||
// other shell gets marked as primary, this effectively stores the list of
|
||||
// targetable shells in "most recently primary first" order.
|
||||
PRBool inserted;
|
||||
if (aPrimary || !mPrimaryContentShell) {
|
||||
inserted = mTargetableShells.InsertObjectAt(contentShellWeak, 0);
|
||||
} else {
|
||||
inserted = mTargetableShells.AppendObject(contentShellWeak);
|
||||
}
|
||||
NS_ENSURE_TRUE(inserted, NS_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user