feat: Can a window always on top but behind the taskbar on Win32 (#18982)

For now it only adds the ability to place the window below
the task bar while still being always on top.
Previous behaviour was always showing the window above the task
bar when top is true. We keep this default behaviour, i.e. when
the 'level' parameter is omitted.

https://github.com/electron/electron/issues/18933

Notes: Can set a window always on top but behind the taskbar on Windows
This commit is contained in:
Julien Isorce 2019-07-10 07:40:11 -07:00 committed by Shelley Vohr
parent faa2710485
commit 8b31953d40
4 changed files with 47 additions and 7 deletions

View file

@ -214,6 +214,9 @@ class NativeWindowViews : public NativeWindow,
// Returns the restore state for the window.
ui::WindowShowState GetRestoredState();
// Maintain window placement.
void MoveBehindTaskBarIfNeeded();
std::unique_ptr<RootView> root_view_;
// The view should be focused by default.
@ -280,6 +283,9 @@ class NativeWindowViews : public NativeWindow,
bool forwarding_mouse_messages_ = false;
HWND legacy_window_ = NULL;
bool layered_ = false;
// Set to true if the window is always on top and behind the task bar.
bool behind_task_bar_ = false;
#endif
// Handles unhandled keyboard messages coming back from the renderer process.