Open Bug 1476888 Opened 8 years ago Updated 4 years ago

Shortcut such as Paste does not work in shared menu from page action menu.

Categories

(Firefox :: Menus, defect, P2)

61 Branch
defect

Tracking

()

People

(Reporter: apple.macintosh.farm, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0 Build ID: 20180704003137 Steps to reproduce: User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0 Build ID: 20180704003137 Using Mac o/s macOS Sierra 10.12.6 ( on a MacBook Air) 1)Open the shared menu from the action menu of the URL bar. 2)For example, choose Twitter. 3)Twitter's common screen opens, TEXT can be added additionally. Actual results: But operation such as pasting of shortcut operation is impossible. (Menu bar shortcuts are not Grayed out) Expected results: Shortcut such as copy paste cutting is effective
I could not reproduce the issue on Mac OS, Nightly 63.0a1 (2018-07-22). I will set Firefox:Menus component. If it fits better for another component, please change it.
Component: General → Menus
I'm able to reproduce this when sharing to the Reminders app (I don't have Twitter configured). I'm running 63.0a1 (2018-07-23). Dale, do other apps have similar issues with Share?
Flags: needinfo?(dharvey)
Status: UNCONFIRMED → NEW
Ever confirmed: true
This worksforme when using Share from the Maps app.
Yeh both chrome and safari let paste work, will take a look into whats happening
Assignee: nobody → dharvey
Flags: needinfo?(dharvey)
Setting as P1 since Dale is looking in to this.
Priority: -- → P1
This is weird, I cant find any code in chrome that makes sure this works, including any indication that the paste functionality needs to be aware of this in any way
Stephen, are you able to help out here?
Flags: needinfo?(spohl.mozilla.bugs)
Just to mentioned where I am currently at, when the share window is open and I press Cmd+v the Edit menu gets highlighted for me but no text is pasted, I can see nsClipboardProxy::GetData doesnt get called at all so trying to work back to where the paste command gets first handled in gecko and see where it gets cut off (but having trouble with lldb not wanting to break on nsclipboardproxy) I expected to find commits / code relating to this in the chrome implementation @ https://chromium.googlesource.com/chromium/src/+log/master/chrome/browser/ui/cocoa/share_menu_controller.mm however it seems to just work there
(In reply to Jared Wein [:jaws] (please needinfo? me) from comment #7) > Stephen, are you able to help out here? I have added this bug to my backlog, but given the current priorities in cocoa/widget it isn't likely that I will be able to get to this very soon.
Flags: needinfo?(spohl.mozilla.bugs)
ok so some debug notes This hits |nsMenuBarX:performKeyEquivalent| where it completes without seeing a keyWindow, however it is never received by |nsChildView:keyDown| which performKeyEquivalent hints that it should be. Also I am not sire this is related, but when I invoke a share I see: 2018-08-28 12:34:13.545 firefox[66191:9310827] warning: illegal subclass SHKRemoteView instantiating; client should use only NSRemoteView ( 0 ViewBridge 0x00007fff73065bff -[NSRemoteView _preSuperInit] + 195 1 ViewBridge 0x00007fff73065f83 -[NSRemoteView initWithFrame:] + 25 2 ShareKit 0x00007fff6f345aa5 -[SHKRemoteView initWithOptionsDictionary:] + 161 3 ShareKit 0x00007fff6f324fbd __38-[SHKSharingService performWithItems:]_block_invoke_4 + 1347 4 libdispatch.dylib 0x00007fff763aa5fa _dispatch_call_block_and_release + 12 .... 22 firefox 0x0000000108074f34 main + 548 23 libdyld.dylib 0x00007fff763dc015 start + 1 ) Googling that error gives me a bunch of people seeing the same problem when they use the API, but no solutions that I have found yet. Not sure its related to the paste problem but it seems possible.
Probably worth mentioning after ^ that |SHKRemoteView| isnt used at all in Gecko
That line, nor |SendEventToNativeMenuSystem| get called at all, neither does either of its callers, |keyDown| or |nsChildView::PostHandleKeyEvent|
|_wantsKeyDownForEvent| is also not called, whose comments indicate that it should be called after our return NO in performKeyEquivalent (can confirm we definitely return NO for that) [https://dxr.mozilla.org/mozilla-central/source/widget/cocoa/nsChildView.mm#5572]
Ok, could you print the full stack in comment 10, including frames 5-21?
Okay, I just took a quick look and I'm able to reproduce the issue. I'm not familiar with this "share" window. Where is this triggered? It would help speed things up if I didn't have to look this up myself.
Sorry missed this, the share window I am referring to comes up when you click the url overflow (...) button and Share -> Reminders, the error reproduces for any share item but Reminders doesnt need a sign up or anything
Hey Stephen, just wondering since you were able to reproduce if you knoew where I should start here, thanks
Flags: needinfo?(spohl.mozilla.bugs)
I haven't had time to look at this in more depth yet. My question in comment 17 was about where *in the code* we were triggering this window. Once we know where the code lives, we can backtrack from there and investigate.
Flags: needinfo?(spohl.mozilla.bugs)
Hey Stephen Was wondering given the code to show the window if there was an idea where to look. I cant quite figure how to work back from the share window since I can see the paste being handled but I dont know how its supposed to be forwarded to the share window Many thanks Dale
Flags: needinfo?(spohl.mozilla.bugs)

(In reply to Dale Harvey (:daleharvey) from comment #22)

Hey Stephen

Was wondering given the code to show the window if there was an idea where
to look. I cant quite figure how to work back from the share window since I
can see the paste being handled but I dont know how its supposed to be
forwarded to the share window

Many thanks
Dale

Just a quick heads up that I have finally started looking into this and I have a theory that I'm testing out. Keeping n-i set for now.

Unfortunately, my attempts at fixing this were fruitless so far.

A few observations: A regular paste into a text field or URL bar will execute nsCocoaWindow's performKeyEquivalent:, then nsMenuBarX's performKeyEquivalent: and finally nsChildView's keyDown:. A paste in the share window will only execute nsMenuBarX's performKeyEquivalent:, which is used to provide the visual feedback of the paste command in the menu bar by highlighting "Edit".

My theory was that this might be misbehaving because we were not returning a pointer to a nsCocoaWindow in NSSharingServiceDelegate's sharingService:sourceWindowForShareItems:sharingContentScope:. However, this did not turn out to be the case.

The share window appears to be from a separate ShareKit process and it seems like we are intercepting and/or not properly forwarding the keyboard events when this window is open. Note that Cmd-W or Cmd-Q also do not work and don't close a tab or quit the application when the share window is displayed.

Flags: needinfo?(spohl.mozilla.bugs)
Priority: P1 → P2

deassigning until I have time to work on this

Assignee: dharvey → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.