bitsdojo_window
bitsdojo_window copied to clipboard
OnRestore callback
Hello!
I've stumbled upon a problem with using your package and a package for a tray notification. Hiding window with appWindow.hide() hides it just fine, but clicking on a tray icon shows blank window.
I am not this familiar with windows API, but I suspect that it's due to how flutter engine works - it basically just makes initial window visible upon lmb click on tray icon, without triggering a rebuild\redraw on the window message.
I do realize that it might not be directly related to the package, but still wonder if it is possible to handle such a case on the package side?
If someone stumbles upon similar issue, that can be solved with adding
PostMessage(hwnd, 0x7FFE, 3, 0);
where necessary in cpp files.
My cases were global hotkeys events in
LRESULT
Win32Window::MessageHandler(HWND hwnd,
UINT const message,
WPARAM const wparam,
LPARAM const lparam) noexcept {
and single instance mutex
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
Those make sure that upon sending SetForegroundWindow()
or any other related events we emit event which is handled by bitsdojo_window package internally. Those values basically mean "Redraw children" in this package.
On a second thought, I think having a callback which is invoked upon window state change (or on restore?) would help solve this case, and probably other use cases
Yes, this is coming in the next update