Skip to content

Commit 641c7e0

Browse files
committed
Refactor AppRunner and TrayIcon to remove singleton instance and update NOTIFYICONDATA to NOTIFYICONDATAW
1 parent 5977b6b commit 641c7e0

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/platform/windows/app_runner_windows.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,8 @@ AppRunner::AppRunner() : pimpl_(std::make_unique<Impl>()) {}
5151

5252
AppRunner::~AppRunner() = default;
5353

54-
AppRunner& AppRunner::GetInstance() {
55-
static AppRunner instance;
56-
return instance;
57-
}
58-
5954
int AppRunner::Run(std::shared_ptr<Window> window) {
6055
return pimpl_->Run(window);
6156
}
6257

63-
int RunApp(std::shared_ptr<Window> window) {
64-
return AppRunner::GetInstance().Run(window);
65-
}
66-
6758
} // namespace nativeapi

src/platform/windows/tray_icon_windows.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class TrayIcon::Impl {
2020
Impl(HWND hwnd, UINT icon_id)
2121
: hwnd_(hwnd), icon_id_(icon_id), icon_handle_(nullptr) {
2222
// Initialize NOTIFYICONDATA structure
23-
ZeroMemory(&nid_, sizeof(NOTIFYICONDATA));
24-
nid_.cbSize = sizeof(NOTIFYICONDATA);
23+
ZeroMemory(&nid_, sizeof(NOTIFYICONDATAW));
24+
nid_.cbSize = sizeof(NOTIFYICONDATAW);
2525
nid_.hWnd = hwnd_;
2626
nid_.uID = icon_id_;
2727
nid_.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
@@ -34,8 +34,8 @@ class TrayIcon::Impl {
3434
icon_id_ = icon_id;
3535

3636
// Re-initialize NOTIFYICONDATA structure
37-
ZeroMemory(&nid_, sizeof(NOTIFYICONDATA));
38-
nid_.cbSize = sizeof(NOTIFYICONDATA);
37+
ZeroMemory(&nid_, sizeof(NOTIFYICONDATAW));
38+
nid_.cbSize = sizeof(NOTIFYICONDATAW);
3939
nid_.hWnd = hwnd_;
4040
nid_.uID = icon_id_;
4141
nid_.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
@@ -90,7 +90,7 @@ class TrayIcon::Impl {
9090

9191
HWND hwnd_;
9292
UINT icon_id_;
93-
NOTIFYICONDATA nid_;
93+
NOTIFYICONDATAW nid_;
9494
std::shared_ptr<Menu> context_menu_;
9595
HICON icon_handle_;
9696
};

0 commit comments

Comments
 (0)