Handle dock icon click to open Tunnel Manager (applicationShouldHandleReopen)#16
Handle dock icon click to open Tunnel Manager (applicationShouldHandleReopen)#16luckman212 wants to merge 1 commit intoWireGuard:masterfrom
applicationShouldHandleReopen)#16Conversation
c37881b to
2fec12a
Compare
|
Now that macOS development has somewhat resumed, wondering if anyone has some thoughts on this one? |
|
I've just added a commit removing the "?". It works as expected by opening the Tunnel Manager when reopened. |
|
@sebastianlivoni Nice. Does it build "as-is" using Xcode14? I haven't tried recently, but when I tried some months ago I didn't have a Developer license (I do now) so I couldn't build the NetworkExtension... |
|
Yep, it does built "as-is". I just had to add the following PATH to "Build Settings" because I'm using M1: PATH = ${PATH}:/opt/homebrew/opt/go@1.20/bin |
|
@zx2c4 or @protonjohn Any chance of this fix making it to the AppStore version? |
|
Or maybe @alessionossa could take a peek? |
I could take a look at it, but I have no rights on this repository to merge it and create and App Store version. Also, GitHub is just a mirror for https://git.zx2c4.com/wireguard-apple, so you should contact the developer push changes there in order to contribute. |

One thing that bugs me about the WireGuard macOS app is that clicking on its Dock icon does not open the Tunnel Manager window. This is non macOS-like, and limits the ability to show that window programatically via shell scripts, AppleScript, JXA, Alfred etc.
My poor-man's kludge to automate this is to literally quit the app and re-open it, like this (JXA):
...but that's embarrassingly inefficient. I believe after looking at the code that it's because there's no
applicationShouldHandleReopen()func handler.So this is not a full working PR, just a bit of starter code I was hoping to get refined into a working fix. I do believe the fix is small and fairly easy to implement.
References: