mynameiskenlee / flutter_macos_menubar_example

starter template for building macOS menubar app with flutter and AppKit
https://www.reddit.com/r/FlutterDev/comments/g7aavn/creating_a_menubar_app_for_macos/
128 stars 14 forks source link

Content of the app is not clickable #1

Open JSosna opened 2 years ago

JSosna commented 2 years ago

Thank you for this template, but it, unfortunately, doesn't work for me. It compiles, shows and hides, but the content of the app isn't clickable. I can't press the close text button or fab button. Could you help me?

Flutter 3.0.5 macOS 12.1 M1 Pro

https://user-images.githubusercontent.com/20880200/181343755-f2e6ff9d-21f6-49d1-9771-24c94dd98a23.mov

mynameiskenlee commented 2 years ago

Hi, Thank you for spotting this issue. I have just tested it with Flutter 3.0.5 on my machine (2018 MacBook Pro with macOS 12.5) as it is originally developed with flutter 2. It works just fine for me and I couldn't replicate the issue, it probably a problem on the apple silicon side. However, I don't have an apple silicon Mac right now to diagnose into this issue, I will probably get one later this year. Meanwhile, would you mind to take a look into the terminal output to see if there is any warning or error thrown?

Thank you.

JSosna commented 2 years ago

Thanks for quick response.

Here are the logs:

2022-07-29 23:19:43.665938+0200 flutter_macos_menubar_example[39411:556187] Metal API Validation Enabled
2022-07-29 23:19:43.696640+0200 flutter_macos_menubar_example[39411:556187] [] [0x12c134c20] CVCGDisplayLink::setCurrentDisplay: 3
2022-07-29 23:19:43.696798+0200 flutter_macos_menubar_example[39411:556187] [] [0x12c134c00] CVDisplayLinkCreateWithCGDisplays count: 1 [displayID[0]: 0x3] [CVCGDisplayLink: 0x12c134c20]
2022-07-29 23:19:43.696820+0200 flutter_macos_menubar_example[39411:556187] [] [0x12c134c20] CVCGDisplayLink::finalize
2022-07-29 23:19:43.696834+0200 flutter_macos_menubar_example[39411:556187] [] [0x12c134c20] CVDisplayLink::finalize
2022-07-29 23:19:43.725121+0200 flutter_macos_menubar_example[39411:556187] -[flutter_macos_menubar_example.AppDelegate applicationDidFinishLaunching:]: unrecognized selector sent to instance 0x6000009759b0
2022-07-29 23:19:43.725251+0200 flutter_macos_menubar_example[39411:556187] -[flutter_macos_menubar_example.AppDelegate applicationDidFinishLaunching:]: unrecognized selector sent to instance 0x6000009759b0
flutter: The Dart VM service is listening on http://127.0.0.1:64034/pr4vliM8MGs=/
mynameiskenlee commented 2 years ago

Just did some research on the unrecognized selector issue. That is because I have applied changes from #https://github.com/flutter/flutter/issues/59969#issuecomment-764955247 to make the windows look more macOS like which make changes to NSWindow.contentView and causes the error. (you will find out that translucent background if you add backgroundColor: Colors.transparent, to the Scaffold in main_window.dart or new_window.dart) Probably not related to the un-clickable issue.

I will continue investigate into the issue. Please do let me know if you have more update on this. Thank you.

rlfolden commented 1 year ago

Just did some research on the unrecognized selector issue. That is because I have applied changes from #flutter/flutter#59969 (comment) to make the windows look more macOS like which make changes to NSWindow.contentView and causes the error. (you will find out that translucent background if you add backgroundColor: Colors.transparent, to the Scaffold in main_window.dart or new_window.dart) Probably not related to the un-clickable issue.

I will continue investigate into the issue. Please do let me know if you have more update on this. Thank you.

I have the same problem using MACOS 11 It works on MACOS 12

Jarrodsz commented 1 year ago

Great startrr anyone managed to fix this?

what is the advantwge over using this solution where you have to open xcode and edit compared to the system_tray package on pub.dev?

mynameiskenlee commented 1 year ago

Thanks for the questions @Jarrodsz

Great startrr anyone managed to fix this?

I recently got myself an m2 Mac mini, will test that if I have time.

I am also checking if there will have any chance that flutter is adding native multi window support in the future, as one of the dependency multi_window isn't getting any new update and I cannot find any replacement for it.

what is the advantage over using this solution where you have to open xcode and edit compared to the system_tray package on pub.dev?

I think the use case for the two is completely different, the purpose of this repo is to build an app that live inside of the menu bar which is useful for building utilities app, whereas system_tray is to add a menu to the menu bar.

If that is the case, in flutter 3.7, flutter added native support for using the macOS native application menu with PlatformMenuBar which I think is more suitable than system_tray for that use case. If you're using flutter <3.7, system_tray is still a good solution.