Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register TaskbarCreated message to reshow tray icon #90

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,17 @@ void checkKeyboardLayout() nothrow {
}
}

uint taskBarCreatedMsg = 0;

extern(Windows)
LRESULT WndProc(HWND hwnd, uint msg, WPARAM wParam, LPARAM lParam) nothrow {
// Huge try block because WndProc is defined as "nothrow"
try {

switch (msg) {
case WM_CREATE:
taskBarCreatedMsg = RegisterWindowMessage("TaskbarCreated");
break;
case WM_DESTROY:
// Hide the tray icon and cleanup before closing the application
trayIcon.hide();
Expand Down Expand Up @@ -367,6 +371,10 @@ LRESULT WndProc(HWND hwnd, uint msg, WPARAM wParam, LPARAM lParam) nothrow {
break;

default: // Pass everything else to OSK
if (msg == taskBarCreatedMsg) {
debugWriteln("Show tray icon");
trayIcon.show();
}
return oskWndProc(hwnd, msg, wParam, lParam);
}

Expand Down