[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 35/64: Bug 31607: App menu items stop working on macOS



This is an automated email from the git hooks/post-receive script.

aguestuser pushed a commit to branch geckoview-99.0b3-11.5-2
in repository tor-browser.

commit 6a19fdf1428587836b6722aaa5ff6235c6262a4c
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
AuthorDate: Thu Oct 3 10:53:43 2019 -0400

    Bug 31607: App menu items stop working on macOS
    
    Avoid re-creating the hidden window, since this causes the nsMenuBarX
    object that is associated with the app menu to be freed (which in
    turn causes all of the app menu items to stop working).
    
    More detail: There should only be one hidden window.
    XREMain::XRE_mainRun() contains an explicit call to create the
    hidden window and that is the normal path by which it is created.
    However, when Tor Launcher's wizard/progress window is opened during
    startup, a hidden window is created earlier as a side effect of
    calls to nsAppShellService::GetHiddenWindow(). Then, when
    XREMain::XRE_mainRun() creates its hidden window, the original one
    is freed which also causes the app menu's nsMenuBarX object which
    is associated with that window to be destroyed. When that happens,
    the menuGroupOwner property within each Cocoa menu items's MenuItemInfo
    object is cleared. This breaks the link that is necessary for
    NativeMenuItemTarget's menuItemHit method to dispatch a menu item
    event.
---
 xpfe/appshell/nsAppShellService.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp
index adf8d764ad495..fd15aa0625ddc 100644
--- a/xpfe/appshell/nsAppShellService.cpp
+++ b/xpfe/appshell/nsAppShellService.cpp
@@ -93,6 +93,10 @@ void nsAppShellService::EnsureHiddenWindow() {
 
 NS_IMETHODIMP
 nsAppShellService::CreateHiddenWindow() {
+  if (mHiddenWindow) {
+    return NS_OK;
+  }
+
   if (!XRE_IsParentProcess()) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits