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

fix: explorer restart does not recreated thumbnail toolbar buttons #39586

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions shell/browser/native_window_views.cc
Expand Up @@ -234,6 +234,10 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,

if (title_bar_style_ != TitleBarStyle::kNormal)
set_has_frame(false);

// If the taskbar is re-created after we start up, we have to rebuild all of
// our buttons.
taskbar_created_message_ = RegisterWindowMessage(TEXT("TaskbarCreated"));
#endif

if (enable_larger_than_screen())
Expand Down
4 changes: 4 additions & 0 deletions shell/browser/native_window_views.h
Expand Up @@ -315,6 +315,10 @@ class NativeWindowViews : public NativeWindow,
// Controls Overlay if enabled on Windows.
SkColor overlay_button_color_;
SkColor overlay_symbol_color_;

// The message ID of the "TaskbarCreated" message, sent to us when we need to
// reset our thumbar buttons.
UINT taskbar_created_message_ = 0;
#endif

// Handles unhandled keyboard messages coming back from the renderer process.
Expand Down
6 changes: 6 additions & 0 deletions shell/browser/native_window_views_win.cc
Expand Up @@ -221,6 +221,12 @@ bool NativeWindowViews::PreHandleMSG(UINT message,
return true;
}

if (message == taskbar_created_message_) {
// We need to reset all of our buttons because the taskbar went away.
taskbar_host_.RestoreThumbarButtons(GetAcceleratedWidget());
return true;
}

switch (message) {
// Screen readers send WM_GETOBJECT in order to get the accessibility
// object, so take this opportunity to push Chromium into accessible
Expand Down