diff --git a/lib/src/plugin.dart b/lib/src/plugin.dart index 8eda012..c644cab 100644 --- a/lib/src/plugin.dart +++ b/lib/src/plugin.dart @@ -146,6 +146,8 @@ class BetrayalPlugin { "message: 10b$message ${message.hex}, id: ${id.hex}, event: ${code.toRadixString(16)}, position: $position}, hWnd: $hWnd"); } break; + default: + _logger.warning("asked to call unknown method by plugin!"); } } diff --git a/windows/betrayal_plugin.cpp b/windows/betrayal_plugin.cpp index 3d92380..3109e09 100644 --- a/windows/betrayal_plugin.cpp +++ b/windows/betrayal_plugin.cpp @@ -40,7 +40,7 @@ namespace Betrayal int window_proc_id = -1; IconManager icons; - // Called when a method is called on this plugin's channel from Dart. + // Called by the Windows Event Loop std::optional BetrayalPlugin::HandleWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { std::optional result; @@ -98,6 +98,7 @@ namespace Betrayal #define WITH_ID const int id = std::get(args.at(flutter::EncodableValue("id"))); #define WITH_ARGS_HWND_ID WITH_ARGS WITH_HWND WITH_ID + // Called when a method is called on this plugin's channel from Dart. void HandleMethodCall( const flutter::MethodCall &method_call, std::unique_ptr> result) @@ -106,6 +107,7 @@ namespace Betrayal if (method.compare("reset") == 0) { icons.clear_all(); + result->Success(flutter::EncodableValue(0)); } else if (method.compare("getSystemMetrics") == 0) {