Closed Bug 320660 Opened 20 years ago Closed 20 years ago

When opening multiple tabs, we always focus the first new one, ignoring the pref

Categories

(Camino Graveyard :: Tabbed Browsing, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.0

People

(Reporter: hwaara, Assigned: hwaara)

References

Details

(Keywords: fixed1.8.0.2, fixed1.8.1, regression, Whiteboard: [camino-1.0])

Attachments

(1 file, 3 obsolete files)

3.19 KB, patch
stuart.morgan+bugzilla
: review+
sfraser_bugs
: superreview+
Details | Diff | Splinter Review
from bug 228840: "Currently, when command-clicking a tab group and prefs set to open in new tabs, the new tabs are *always* focused, no matter what the background pref." Investigating, it's a regression from bug 294019. When opening multiple URLs in openURLs:, we always select the first of those URLs, even if the user cmd-clicked or middle-clicked (to append new tabs)
Summary: When opening multiple tabs, we always focus the first new one, ignoring the oref → When opening multiple tabs, we always focus the first new one, ignoring the pref
Attached patch Proposed fix (obsolete) — Splinter Review
Ok, so if I've understood the earlier bug correctly we need to focus the first new tab if we replace all tabs. However, if we just append them, we ought to follow the pref, so in that case the code shouldn't apply. This patch just makes us check whether we're replacing all tabs, or appending them - and then focusing only in the first case.
Attachment #206185 - Flags: superreview?(sfraser_bugs)
Attachment #206185 - Flags: review?(nick.kreeger)
*** Bug 318626 has been marked as a duplicate of this bug. ***
I don't know if the reviewers I chose for this patch are OK, so if anyone feels like it feel free to have a look.
Comment on attachment 206185 [details] [diff] [review] Proposed fix > This patch just makes us check whether we're replacing all tabs, or appending > them - and then focusing only in the first case. That's not the correct behavior. There is a pref for whether or not tabs are loaded in the background or the foreground, which needs to be respected. It's probably also a bit more complicated than that; you'll have to look at who calls into this function, and what the expected behavior would be, since some might reasonably override the pref (the open panel, for example).
Attachment #206185 - Flags: superreview?(sfraser_bugs)
Attachment #206185 - Flags: review?(nick.kreeger)
Attachment #206185 - Flags: review-
Ew. This is a tangent, but eAppendFromCurrentTab is horribly named; while you are touching this function it would be great if you could rename it to eReplaceFromCurrentTab, since that's what it actually does.
Maybe I was unclear, but this patch fixes the bug that prevents that very pref from working.
Attached patch Patch 2 (obsolete) — Splinter Review
Actually, you were right. My previous patch fixed a regression (that we were _always_ focusing new tabs, no matter if they were only appended). This new patch also makes us respect the focus-pref.
Attachment #206185 - Attachment is obsolete: true
Attachment #206433 - Flags: superreview?
Attachment #206433 - Flags: review?
Isn't that patch missing a header change?
Comment on attachment 206433 [details] [diff] [review] Patch 2 Yes, I was just in the midst of reviewing/testing, and it's missing the enum declaration change in BrowserWindowController.h. Also: + if ((tabPolicy == eReplaceTabs) || !loadInBackground) should be if (!((tabPolicy == eAppendTabs) && loadInBackground)) so it only affects eAppendTabs. I'm about to test with those changes though
Attachment #206433 - Flags: superreview?
Attachment #206433 - Flags: review?
Attachment #206433 - Flags: review-
Looks good other than that, so r=me with the two changes above.
Attached patch Patch v3 (obsolete) — Splinter Review
Been testing this patch in lots of cases and it works well. Made the changes suggested by Stuart Morgan.
Attachment #206433 - Attachment is obsolete: true
Attachment #206873 - Flags: superreview?(sfraser_bugs)
Attachment #206873 - Flags: review+
Comment on attachment 206873 [details] [diff] [review] Patch v3 Lets have Stuart actually set the flags please !
Attachment #206873 - Flags: review+ → review?(stuart.morgan)
(In reply to comment #12) > (From update of attachment 206873 [details] [diff] [review] [edit]) > Lets have Stuart actually set the flags please ! > I made the changes he proposed, and he wrote "r=me with the two changes above."?
Comment on attachment 206873 [details] [diff] [review] Patch v3 Now you've left this change out: - [browserController openURLArray:urlStringsArray tabOpenPolicy:eAppendFromCurrentTab allowPopups:YES]; + [browserController openURLArray:urlStringsArray tabOpenPolicy:eReplaceFromCurrentTab allowPopups:YES]; so once again the patch won't compile. You need to make sure you are generating patches from BrowserWindowController.mm, BrowserWindowController.h, and MainController.mm. Also, don't add the whitespace at the end of the BWC changes. (This is why it's best not to do an r+ in someone else's name, by the way--patchs don't always get spun the way one intends.)
Attachment #206873 - Flags: superreview?(sfraser_bugs)
Attachment #206873 - Flags: review?(stuart.morgan)
Attachment #206873 - Flags: review-
Attached patch Patch againSplinter Review
Sorry, I have so many changes in my tree it's hard to keep track of them when diffing.
Attachment #206873 - Attachment is obsolete: true
Attachment #206909 - Flags: superreview?(sfraser_bugs)
Attachment #206909 - Flags: review?(stuart.morgan)
Comment on attachment 206909 [details] [diff] [review] Patch again I'll also remove that stale whitespace.
Comment on attachment 206909 [details] [diff] [review] Patch again r=me
Attachment #206909 - Flags: review?(stuart.morgan) → review+
Since this is a regression and has an r+ patch, putting on the 1.0 list.
Flags: camino1.0?
Keywords: regression
Target Milestone: --- → Camino1.0
Smfr, wanna have a look at this patch? It's got r+, and fixes a regression. Maybe we could even get it into 1.0 ?
This has a reasonable-looking patch and is a regression. 1.0?
Attachment #206909 - Flags: superreview?(sfraser_bugs) → superreview+
Checked in everywhere, sans the bogus and obsolete NSLocalizedString diff. Thanks, Håkan!
Status: NEW → RESOLVED
Closed: 20 years ago
Flags: camino1.0? → camino1.0+
Resolution: --- → FIXED
Whiteboard: [camino-1.0]
Thanks for checking in for me - I'm currently busy with non-Mozilla projects :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: