Commit 28e7da02 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

X11: Treat a minimized window as visible

This is for consistency with Windows and allows minimized windows to be
activated.

BUG=924075
R=sky,fbeaufort

Change-Id: Ic86ffba47805b2ba4f5c8f049cdccd2e75be8d9b
Reviewed-on: https://chromium-review.googlesource.com/c/1437263
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626192}
parent a1379898
...@@ -518,7 +518,7 @@ void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state, ...@@ -518,7 +518,7 @@ void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state,
if (compositor()) if (compositor())
SetVisible(true); SetVisible(true);
if (!IsVisible()) if (!window_mapped_in_client_ || IsMinimized())
MapWindow(show_state); MapWindow(show_state);
switch (show_state) { switch (show_state) {
...@@ -547,7 +547,10 @@ void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state, ...@@ -547,7 +547,10 @@ void DesktopWindowTreeHostX11::Show(ui::WindowShowState show_state,
} }
bool DesktopWindowTreeHostX11::IsVisible() const { bool DesktopWindowTreeHostX11::IsVisible() const {
return window_mapped_in_client_ && !IsMinimized(); // On Windows, IsVisible() returns true for minimized windows. On X11, a
// minimized window is not mapped, so an explicit IsMinimized() check is
// necessary.
return window_mapped_in_client_ || IsMinimized();
} }
void DesktopWindowTreeHostX11::SetSize(const gfx::Size& requested_size) { void DesktopWindowTreeHostX11::SetSize(const gfx::Size& requested_size) {
...@@ -762,7 +765,6 @@ void DesktopWindowTreeHostX11::Activate() { ...@@ -762,7 +765,6 @@ void DesktopWindowTreeHostX11::Activate() {
// after an Activate(), so just set this state now. // after an Activate(), so just set this state now.
has_pointer_focus_ = false; has_pointer_focus_ = false;
has_window_focus_ = true; has_window_focus_ = true;
// window_mapped_in_client_ == true based on the IsVisible() check above.
window_mapped_in_server_ = true; window_mapped_in_server_ = true;
XSetErrorHandler(old_error_handler); XSetErrorHandler(old_error_handler);
} }
...@@ -816,7 +818,7 @@ void DesktopWindowTreeHostX11::Maximize() { ...@@ -816,7 +818,7 @@ void DesktopWindowTreeHostX11::Maximize() {
// Some WMs do not respect maximization hints on unmapped windows, so we // Some WMs do not respect maximization hints on unmapped windows, so we
// save this one for later too. // save this one for later too.
should_maximize_after_map_ = !IsVisible(); should_maximize_after_map_ = !window_mapped_in_client_;
// When we are in the process of requesting to maximize a window, we can // When we are in the process of requesting to maximize a window, we can
// accurately keep track of our restored bounds instead of relying on the // accurately keep track of our restored bounds instead of relying on the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment