mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 356581: focus the location bar after closing the tab so that Ctrl+W doesn't cause it to loose focus, patch by Simon Bünzli <zeniko@gmail.com>, r=me
This commit is contained in:
parent
924d989283
commit
c731b721e3
@ -1658,21 +1658,15 @@ function BrowserCloseTabOrWindow()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gBrowser.tabContainer.childNodes.length > 1) {
|
||||
// Just close up a tab.
|
||||
if (gBrowser.tabContainer.childNodes.length > 1 ||
|
||||
window.toolbar.visible && !gPrefService.getBoolPref("browser.tabs.autoHide")) {
|
||||
// Just close the tab (and focus the address bar if it was the last one).
|
||||
var isLastTab = gBrowser.tabContainer.childNodes.length == 1;
|
||||
gBrowser.removeCurrentTab();
|
||||
return;
|
||||
}
|
||||
#ifndef XP_MACOSX
|
||||
if (window.toolbar.visible &&
|
||||
!gPrefService.getBoolPref("browser.tabs.autoHide")) {
|
||||
// Replace the remaining tab with a blank one and focus the address bar
|
||||
gBrowser.removeCurrentTab();
|
||||
if (gURLBar)
|
||||
if (isLastTab && gURLBar)
|
||||
setTimeout(function() { gURLBar.focus(); }, 0);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
closeWindow(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user