Closed
Bug 186591
Opened 22 years ago
Closed 19 years ago
View Image in New Tab/Window (use Tabbed Browsing preference semantics)
Categories
(Camino Graveyard :: Tabbed Browsing, enhancement)
Tracking
(Not tracked)
VERIFIED
FIXED
Camino1.5
People
(Reporter: tfo, Assigned: bugzilla-graveyard)
References
Details
(Keywords: fixed1.8.1)
Attachments
(1 file, 2 obsolete files)
|
1.93 KB,
patch
|
stuart.morgan+bugzilla
:
review+
mark
:
superreview+
|
Details | Diff | Splinter Review |
rather than re-using the existing window, View Image should follow whatever
semantics are set in the Tabbed Browsing preference.
or, the function should have its own preference specifying an appropriate
behavior for it. View Image is a great new feature, but it's frustrating to have
it overwrite the page on which the image appeared.
Updated•22 years ago
|
Severity: minor → enhancement
Comment 1•22 years ago
|
||
smfr? thoughts?
Comment 2•22 years ago
|
||
There is no Tabbed Browsing options which View Image can use.
The closest one is "Loading a page requested by another application:".
Either by adding a similar group for View Image or by extending the current one:
"Loading a page requested by another application or by View Image:"
I prefer the last one, extending.
Another solution to have an almost uniform behavior like for Links in the
Contextual menu is:
1.View Image
2.View Image in a New Window
3.View Image in a New Tab
1. would be the equivalent to Cmd-Clicking a link as you can not Cmd-Click a
simple picture because it's in a Contextual menu and that some image might
contains a link.
Updated•22 years ago
|
Target Milestone: --- → Camino1.1
*** Bug 247110 has been marked as a duplicate of this bug. ***
Based on the duplicate I just marked, and Stephane's comment 2 which is what I'm
guessing is the approved implementation, I'm going to slightly modify the summary.
Was: View Image should use Tabbed Browsing preference semantics
Now: View Image in New Tab/Window (use Tabbed Browsing preference semantics)
Summary: View Image should use Tabbed Browsing preference semantics → View Image in New Tab/Window (use Tabbed Browsing preference semantics)
Instead of polluting the context menu or prefs with another option, we should use the Cmd shortcut like we do everywhere else for "open in new". Anything other/more than that seems like a WONTFIX.
| Assignee | ||
Comment 6•19 years ago
|
||
What Smokey said.
I can probably take a look at this sometime soon-ish.
cl
| Assignee | ||
Comment 7•19 years ago
|
||
If cmd is held down, we kick the image view to a new tab/window, respecting loadInBG preference.
If shift is ALSO held down, we toggle the loadInBG preference when opening the new tab/window.
If shift is held down by itself, we do nothing, since toggling that pref has no meaning for the frontmost tab/window.
cl
Assignee: mikepinkerton → bugzilla
Status: NEW → ASSIGNED
Attachment #216545 -
Flags: superreview?(mark)
Attachment #216545 -
Flags: review?(stuart.morgan)
Comment 8•19 years ago
|
||
Comment on attachment 216545 [details] [diff] [review]
kicks to a new window with cmd, toggles bg/fg with shift
Note the problems you had during testing with your crummy third-party mouse software: events for button 2 were all coming through as though control was held down and no other modifiers were down, regardless of the actual state of the modifiers.
>+ BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
>+ BOOL loadInBG = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadInBackground" withSuccess:NULL];
You can move these down into the NSCommandKeyMask block.
>+ if ([[NSApp currentEvent] modifierFlags] & NSCommandKeyMask) {
>+ if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) {
Don't do [[NSApp currentEvent] modifierFlags] twice, get it once and store the result in a variable.
Add a comment about shift flipping the default behavior.
The extra logic for the shift-flip looks like bloat. How about this:
BOOL shiftIsDown = modifiers & NSShiftKeyMask;
if (loadInTab) {
[self openNewTabWithURL:urlStr
referrer:referrer
loadInBackground:(shiftIsDown ? !loadInBG : loadInBG) // shift key toggles
allowPopups:NO];
}
else {
[self openNewWindowWithURL:urlStr
referrer:referrer
loadInBackground:(shiftIsDown ? !loadInBG : loadInBG) // shift key toggles
allowPopups:NO];
}
Attachment #216545 -
Flags: superreview?(mark)
Attachment #216545 -
Flags: superreview-
Attachment #216545 -
Flags: review?(stuart.morgan)
Comment 9•19 years ago
|
||
Or, even better:
if (modifiers & NSShiftKeyMask)
loadInBG = !loadInBG;
then just use loadInBG normally without testing for the shift in openNewWhatever.
| Assignee | ||
Comment 10•19 years ago
|
||
For the record:
Kensington's MouseWorks software eats the modifierFlags on NSEvents when a key combination (like control-click) is assigned to a specific mouse button. A bug has been filed with Kensington's tech support on this problem. They're in beta testing for version 3.0, so there's an outside chance this could get fixed by the time it goes final.
Other third-party mouse drivers may or may not have the same problem, but that should probably be our first question if anyone complains this doesn't work.
cl
Attachment #216545 -
Attachment is obsolete: true
Attachment #216547 -
Flags: superreview?(mark)
Attachment #216547 -
Flags: review?
Comment 11•19 years ago
|
||
Comment on attachment 216547 [details] [diff] [review]
addresses mento's comments
>+ if (modifiers & NSCommandKeyMask) {
>+ BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
>+ BOOL loadInBG = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadInBackground" withSuccess:NULL];
>+ if (modifiers & NSShiftKeyMask) {
>+ loadInBG = !loadInBG; // shift key should toggle the foreground/background pref as it does elsewhere
This should be the ONLY thing in the enclosing conditional, because this:
>+ if (loadInTab)
>+ [self openNewTabWithURL:urlStr referrer:referrer loadInBackground:loadInBG allowPopups:NO];
>+ else
>+ [self openNewWindowWithURL:urlStr referrer:referrer loadInBackground:loadInBG allowPopups:NO];
>+ }
and this:
>+ else {
>+ if (loadInTab)
>+ [self openNewTabWithURL:urlStr referrer:referrer loadInBackground:loadInBG allowPopups:NO];
>+ else
>+ [self openNewWindowWithURL:urlStr referrer:referrer loadInBackground:loadInBG allowPopups:NO];
>+ }
>+ }
are identical.
Attachment #216547 -
Flags: superreview?(mark)
Attachment #216547 -
Flags: superreview-
Attachment #216547 -
Flags: review?
| Assignee | ||
Comment 12•19 years ago
|
||
Heh. Oops. Guess I shoulda seen that, huh? This one's fixed.
cl
Attachment #216547 -
Attachment is obsolete: true
Attachment #216590 -
Flags: superreview?(mark)
Attachment #216590 -
Flags: review?
Comment 13•19 years ago
|
||
Comment on attachment 216590 [details] [diff] [review]
third time's a charm?
OK, good. I don't "View Image" often, but I agree that it should respect the pref.
>+ unsigned int modifiers = [[NSApp currentEvent] modifierFlags];
>+
>+ if (modifiers & NSCommandKeyMask) {
Checkin person, please check the blank line above in without the eight (why eight?) spaces.
>+ loadInBG = !loadInBG; // shift key should toggle the foreground/background pref as it does elsewhere
And change the comment to read "shift key toggles the foreground/background pref".
Setting r? target to where you seem to have wanted it.
Attachment #216590 -
Flags: superreview?(mark)
Attachment #216590 -
Flags: superreview+
Attachment #216590 -
Flags: review?(smorgan)
Attachment #216590 -
Flags: review?
Updated•19 years ago
|
Attachment #216590 -
Flags: review?(smorgan) → review?(stuart.morgan)
Comment 14•19 years ago
|
||
Comment on attachment 216590 [details] [diff] [review]
third time's a charm?
r=me, although it seems odd that I have to be holding the key(s) down when I bring up the context menu, not just when I select the menu item. If I'm not the only one seeing that, perhaps a follow-up bug is in order.
Attachment #216590 -
Flags: review?(stuart.morgan) → review+
Yeah, I confirm Stuart's issue. We don't make you do that in normal menus (i.e., I can pull down the menu w/o any modifiers and then hold down the modifier right before selecting the item), so we shouldn't make you do that here (nor, for that matter, in any of the CM cases where it makes sense to support the tabbed browsing sematics) in order to be consistent.
Since this is the first CM item we're making obey the semantics, I'd prefer it was fixed now (rather than filed, perhaps another CM item fixed ad interim, and then have to go back and fix multiple cases), but I don't know how hairy that code/coding might be.
| Assignee | ||
Comment 16•19 years ago
|
||
(In reply to comment #14)
> (From update of attachment 216590 [details] [diff] [review] [edit])
> r=me, although it seems odd that I have to be holding the key(s) down when I
> bring up the context menu, not just when I select the menu item. If I'm not
> the only one seeing that, perhaps a follow-up bug is in order.
I see that too. No idea why...
cl
The reason for the odd behavior Stuart saw in comment 14 may well be that Chris's patch was already using the [NSApp currentEvent] stuff that was later added Camino-wide (and which caused bug 333765).
If that's the case, and since we're now broken a la comment 14 everywhere, maybe we should go ahead and land this now to prevent bitrot (if it's not already bitrotted) with the understanding that the fix for bug 333765 will fix this, too, as part of fixing the comment 14-type issues "everywhere"?
Depends on: 333765
QA Contact: bugzilla → tabbed.browsing
Whiteboard: [needs checkin]
Comment 18•19 years ago
|
||
Checked in with a screwed up checkin comment (thanks cross-commit!)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: [needs checkin]
You need to log in
before you can comment on or make changes to this bug.
Description
•