From 8cdcc3bcda4b1f6485fa2280e1e3ced38ef043b7 Mon Sep 17 00:00:00 2001 From: "pinkerton%aol.net" Date: Fri, 23 Jun 2006 17:27:04 +0000 Subject: [PATCH] fix missed selectors and problem where loading tabs in background would mess up jumpback (bugs 342538 and 342526) --- camino/src/application/MainController.mm | 4 ++-- camino/src/browser/BrowserTabView.mm | 3 ++- camino/src/browser/BrowserWindowController.mm | 5 +++-- camino/src/browser/GoMenu.mm | 2 +- camino/src/history/HistoryOutlineViewDelegate.mm | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/camino/src/application/MainController.mm b/camino/src/application/MainController.mm index 91d1c4b6de25..e59ab6e6d245 100644 --- a/camino/src/application/MainController.mm +++ b/camino/src/application/MainController.mm @@ -556,7 +556,7 @@ const int kReuseWindowOnAE = 2; if (openInNewWindow) [self openBrowserWindowWithURL:[(Bookmark *)item url] andReferrer:nil behind:behindWindow allowPopups:YES]; else if (openInNewTab) - [browserWindowController openNewTabWithURL:[(Bookmark *)item url] referrer:nil loadInBackground:newTabInBackground allowPopups:YES]; + [browserWindowController openNewTabWithURL:[(Bookmark *)item url] referrer:nil loadInBackground:newTabInBackground allowPopups:YES setJumpback:NO]; else [browserWindowController loadURL:[(Bookmark *)item url] referrer:nil activate:YES allowPopups:YES]; } @@ -1107,7 +1107,7 @@ Otherwise, we return the URL we originally got. Right now this supports .url, if (tabOrWindowIsAvailable || reuseWindow == kReuseWindowOnAE) [controller loadURL:inURLString referrer:nil activate:YES allowPopups:NO]; else if (reuseWindow == kOpenNewTabOnAE) - [controller openNewTabWithURL:inURLString referrer:aReferrer loadInBackground:loadInBackground allowPopups:NO]; + [controller openNewTabWithURL:inURLString referrer:aReferrer loadInBackground:loadInBackground allowPopups:NO setJumpback:NO]; else { // note that we're opening a new window here diff --git a/camino/src/browser/BrowserTabView.mm b/camino/src/browser/BrowserTabView.mm index 1c1b83960851..b7b3509c810a 100644 --- a/camino/src/browser/BrowserTabView.mm +++ b/camino/src/browser/BrowserTabView.mm @@ -471,7 +471,7 @@ NSString* const kTabBarBackgroundDoubleClickedNotification = @"kTabBarBackground -(void)addTabForURL:(NSString*)aURL referrer:(NSString*)aReferrer { - [[[self window] windowController] openNewTabWithURL:aURL referrer:aReferrer loadInBackground:YES allowPopups:NO]; + [[[self window] windowController] openNewTabWithURL:aURL referrer:aReferrer loadInBackground:YES allowPopups:NO setJumpback:NO]; } #pragma mark - @@ -492,6 +492,7 @@ NSString* const kTabBarBackgroundDoubleClickedNotification = @"kTabBarBackground - (void)setJumpbackTab:(BrowserTabViewItem*)inTab { +NSLog(@"setting jumpback to %d", inTab); mJumpbackTab = inTab; } diff --git a/camino/src/browser/BrowserWindowController.mm b/camino/src/browser/BrowserWindowController.mm index 73f29aa3f305..6a342323cd3f 100644 --- a/camino/src/browser/BrowserWindowController.mm +++ b/camino/src/browser/BrowserWindowController.mm @@ -2992,7 +2992,7 @@ enum BWCOpenDest { // jump back to if this new one is closed w/out switching to any other tabs. // This must come after the call to |openNewTab:| which clears the jumpback // tab and changes the selected tab to the new tab. - if (inSetJumpback) + if (inSetJumpback && !aLoadInBG) [mTabBrowser setJumpbackTab:previouslySelected]; [[newTab view] loadURI:aURLSpec referrer:aReferrer flags:NSLoadFlagsNone activate:!aLoadInBG allowPopups:inAllowPopups]; @@ -3014,7 +3014,8 @@ enum BWCOpenDest { // jump back to if this new one is closed w/out switching to any other tabs. // This must come after the call to |openNewTab:| which clears the jumpback // tab and changes the selected tab to the new tab. - [mTabBrowser setJumpbackTab:previouslySelected]; + if (!inLoadInBG) + [mTabBrowser setJumpbackTab:previouslySelected]; return [[newTab view] getBrowserView]; } diff --git a/camino/src/browser/GoMenu.mm b/camino/src/browser/GoMenu.mm index 062d030b9c06..31618c98b3c3 100644 --- a/camino/src/browser/GoMenu.mm +++ b/camino/src/browser/GoMenu.mm @@ -432,7 +432,7 @@ static const unsigned int kMaxTitleLength = 50; { BOOL backgroundLoad = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadInBackground" withSuccess:NULL]; if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL]) - [bwc openNewTabWithURL:itemURL referrer:nil loadInBackground:backgroundLoad allowPopups:NO]; + [bwc openNewTabWithURL:itemURL referrer:nil loadInBackground:backgroundLoad allowPopups:NO setJumpback:NO]; else [bwc openNewWindowWithURL:itemURL referrer: nil loadInBackground:backgroundLoad allowPopups:NO]; } diff --git a/camino/src/history/HistoryOutlineViewDelegate.mm b/camino/src/history/HistoryOutlineViewDelegate.mm index c64eeb8cc48b..ceeb6b3e900b 100644 --- a/camino/src/history/HistoryOutlineViewDelegate.mm +++ b/camino/src/history/HistoryOutlineViewDelegate.mm @@ -204,7 +204,7 @@ static NSString* const kExpandedHistoryStatesDefaultsKey = @"history_expand_stat if (cmdKeyDown) { if (openInTabs) - [mBrowserWindowController openNewTabWithURL:url referrer:nil loadInBackground:loadInBackground allowPopups:NO]; + [mBrowserWindowController openNewTabWithURL:url referrer:nil loadInBackground:loadInBackground allowPopups:NO setJumpback:YES]; else [mBrowserWindowController openNewWindowWithURL:url referrer: nil loadInBackground:loadInBackground allowPopups:NO]; } @@ -273,7 +273,7 @@ static NSString* const kExpandedHistoryStatesDefaultsKey = @"history_expand_stat while ((curItem = [itemsEnum nextObject])) { if ([curItem isKindOfClass:[HistorySiteItem class]]) - [mBrowserWindowController openNewTabWithURL:[curItem url] referrer:nil loadInBackground:backgroundLoad allowPopups:NO]; + [mBrowserWindowController openNewTabWithURL:[curItem url] referrer:nil loadInBackground:backgroundLoad allowPopups:NO setJumpback:YES]; } }