Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 2542533002: Don't check autohide taskbar for WS_EX_TOPMOST when we are querying the autohide state. (Closed)
Patch Set: Added comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 6f80d3e568e2ca1dc1471d563356f850ec2bdc39..2a770d17a2449feca470a80103b8cb32eff0fbfd 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -376,6 +376,13 @@ void HWNDMessageHandler::Init(HWND parent, const gfx::Rect& bounds) {
// Disable pen flicks (http://crbug.com/506977)
base::win::DisableFlicks(hwnd());
+
+ // Register for fullscreen window notifications from the shell.
+ APPBARDATA appbar = {};
+ appbar.cbSize = sizeof(APPBARDATA);
+ appbar.hWnd = hwnd();
+ appbar.uCallbackMessage = WM_APPBAR_NOTIFICATION_MESSAGE;
+ ::SHAppBarMessage(ABM_NEW, &appbar);
}
void HWNDMessageHandler::InitModalType(ui::ModalType modal_type) {
@@ -418,6 +425,12 @@ void HWNDMessageHandler::Close() {
}
void HWNDMessageHandler::CloseNow() {
+ // Unregister fullscreen notifications from the shell.
+ APPBARDATA appbar = {};
+ appbar.cbSize = sizeof(APPBARDATA);
+ appbar.hWnd = hwnd();
+ ::SHAppBarMessage(ABM_REMOVE, &appbar);
+
// We may already have been destroyed if the selection resulted in a tab
// switch which will have reactivated the browser window and closed us, so
// we need to check to see if we're still a window before trying to destroy
@@ -2387,6 +2400,24 @@ LRESULT HWNDMessageHandler::OnWindowSizingFinished(UINT message,
return 0;
}
+LRESULT HWNDMessageHandler::OnAppBarMessage(UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
+ // Please refer to the ChromeViewsDelegate::GetAppbarAutohideEdges() function
+ // for some context on how we handle autohide taskbars.
+
+ // We receive this notification when a window changes from fullscreen to
+ // non fullscreen. Sadly we don't get the window handle. The problem we
+ // are trying to address is the case where our window switched away to
+ // maximized from fullscreen mode and the autohide taskbar is around.
+ // We want to leave a pixel space at the place where the taskbar shows up
+ // to ensure that the taskbar shows up when the mouse is moved there.
+ // The SendFrameChanged() call below achieves that.
+ if (w_param == ABN_FULLSCREENAPP && (l_param == 0) && IsMaximized())
+ SendFrameChanged();
Peter Kasting 2016/12/02 01:56:41 Now that we removed the TOPMOST check, does this s
ananta 2016/12/02 06:09:14 I added this mostly for correctness sake, i.e quer
+ return 0;
+}
+
void HWNDMessageHandler::OnSessionChange(WPARAM status_code) {
// Direct3D presents are ignored while the screen is locked, so force the
// window to be redrawn on unlock.
« chrome/browser/ui/views/chrome_views_delegate.cc ('K') | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698