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

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

Issue 1707233002: Reduce the fullscreen window height by 1px on activation loss. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce the size of the fullscreen window by 1px on activation loss Created 4 years, 10 months 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 f632827ca29663e93365929d151c4c1c5add9d49..f70dc276eadd0a3c25c49afceed05fe598c43830 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -333,6 +333,7 @@ HWNDMessageHandler::HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate)
dwm_transition_desired_(false),
sent_window_size_changing_(false),
left_button_down_on_caption_(false),
+ background_fullscreen_hack_(false),
autohide_factory_(this),
weak_factory_(this) {}
@@ -844,6 +845,7 @@ void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
}
void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
+ set_background_fullscreen_hack(false);
fullscreen_handler()->SetFullscreen(fullscreen);
// If we are out of fullscreen and there was a pending DWM transition for the
// window, then go ahead and do it now.
@@ -929,7 +931,8 @@ LRESULT HWNDMessageHandler::OnWndProc(UINT message,
}
if (message == WM_ACTIVATE && IsTopLevelWindow(window))
- PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param));
+ PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param),
+ reinterpret_cast<HWND>(l_param));
return result;
}
@@ -1027,12 +1030,16 @@ void HWNDMessageHandler::SetInitialFocus() {
}
}
-void HWNDMessageHandler::PostProcessActivateMessage(int activation_state,
- bool minimized) {
+void HWNDMessageHandler::PostProcessActivateMessage(
+ int activation_state,
+ bool minimized,
+ HWND window_gaining_or_losing_activation) {
DCHECK(IsTopLevelWindow(hwnd()));
const bool active = activation_state != WA_INACTIVE && !minimized;
- if (delegate_->CanActivate())
- delegate_->HandleActivationChanged(active);
+ if (delegate_->CanActivate()) {
+ delegate_->HandleActivationChanged(active,
+ window_gaining_or_losing_activation);
+ }
}
void HWNDMessageHandler::RestoreEnabledIfNecessary() {
@@ -2167,7 +2174,8 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) {
(work_area != last_work_area_);
if (monitor && (monitor == last_monitor_) &&
((fullscreen_handler_->fullscreen() &&
- !fullscreen_handler_->metro_snap()) ||
+ !fullscreen_handler_->metro_snap() &&
+ !background_fullscreen_hack()) ||
work_area_changed)) {
// A rect for the monitor we're on changed. Normally Windows notifies
// us about this (and thus we're reaching here due to the SetWindowPos()

Powered by Google App Engine
This is Rietveld 408576698