Skip to content

Commit

Permalink
chore: WindowsTaskbarPlugin::window_proc_id_
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmercerind committed Sep 5, 2023
1 parent d79fec3 commit 6a904b8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions windows/windows_taskbar_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ class WindowsTaskbarPlugin : public flutter::Plugin {
static constexpr auto kResetWindowTitle = "ResetWindowTitle";
static constexpr auto kIsTaskbarVisible = "IsTaskbarVisible";

int window_proc_id = -1;

void HandleMethodCall(
const flutter::MethodCall<flutter::EncodableValue>& method_call,
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);

std::string GetErrorString(std::string method_name);

int32_t window_proc_id_ = -1;
flutter::PluginRegistrarWindows* registrar_ = nullptr;
std::unique_ptr<WindowsTaskbar> windows_taskbar_ = nullptr;
std::unique_ptr<flutter::MethodChannel<flutter::EncodableValue>> channel_ =
Expand All @@ -74,7 +73,7 @@ WindowsTaskbarPlugin::WindowsTaskbarPlugin(
channel_->SetMethodCallHandler([this](const auto& call, auto result) {
HandleMethodCall(call, std::move(result));
});
window_proc_id = registrar_->RegisterTopLevelWindowProcDelegate(
window_proc_id_ = registrar_->RegisterTopLevelWindowProcDelegate(
[=](HWND hwnd, UINT message, WPARAM wparam,
LPARAM lparam) -> std::optional<HRESULT> {
{
Expand All @@ -101,7 +100,7 @@ WindowsTaskbarPlugin::WindowsTaskbarPlugin(
}

WindowsTaskbarPlugin::~WindowsTaskbarPlugin() {
registrar_->UnregisterTopLevelWindowProcDelegate(window_proc_id);
registrar_->UnregisterTopLevelWindowProcDelegate(window_proc_id_);
}

void WindowsTaskbarPlugin::HandleMethodCall(
Expand Down

0 comments on commit 6a904b8

Please sign in to comment.