Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[Windows] Maximize the window over the taskbar in the fullscreen mode.
Browse files Browse the repository at this point in the history
It allows the users to close the fullscreen application.

BUG=XWALK-4861
  • Loading branch information
Joone Hur committed Jan 22, 2016
1 parent 72d2469 commit 04d1582
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/views/widget/widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ void Widget::SetVisibleOnAllWorkspaces(bool always_visible) {

void Widget::Maximize() {
native_widget_->Maximize();
#if defined(OS_WIN)
saved_show_state_ = ui::SHOW_STATE_MAXIMIZED;
#endif
}

void Widget::Minimize() {
Expand Down
10 changes: 10 additions & 0 deletions ui/views/win/hwnd_message_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,16 @@ void HWNDMessageHandler::ShowWindowWithState(ui::WindowShowState show_state) {
}

ShowWindow(hwnd(), native_show_state);

// Overlap the taskbar and remove the minimize and maximize button in
// the title bar for the fullscreen mode.
if (native_show_state == SW_SHOWMAXIMIZED) {
LONG style = GetWindowLong(hwnd(), GWL_STYLE);
SetWindowLong(hwnd(), GWL_STYLE, style & ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
SetWindowPos(hwnd(), HWND_TOPMOST, 0, 0, GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN), SWP_DRAWFRAME | SWP_FRAMECHANGED);
}

// When launched from certain programs like bash and Windows Live Messenger,
// show_state is set to SW_HIDE, so we need to correct that condition. We
// don't just change show_state to SW_SHOWNORMAL because MSDN says we must
Expand Down

0 comments on commit 04d1582

Please sign in to comment.