Commit d2ff0611 authored by arjanl's avatar arjanl Committed by Commit bot

[Linux] Show preview contents for minimized windows

When minimizing a window, we hide the contents to prevent
unnecessary redrawing. However, this means that when the frame is
redrawn after the hiding, it is blank. Several desktop environments rely
on the window having contents when minimized, drawing the window
off-screen to be able to show preview content in overviews (Unity,
Gnome Shell).

This patch stops all drawing operations before hiding the
window, making sure that the content before hiding is retained and can
be shown by the window manager as a preview, but still avoiding unnecessary
redrawing of minimized windows.

BUG=156346

Review URL: https://codereview.chromium.org/542113004

Cr-Commit-Position: refs/heads/master@{#293909}
parent 36c90790
......@@ -1249,12 +1249,19 @@ void DesktopWindowTreeHostX11::OnWMStateUpdated() {
// HWNDMessageHandler::GetClientAreaBounds() returns an empty size when the
// window is minimized. On Linux, returning empty size in GetBounds() or
// SetBounds() does not work.
// We also propagate the minimization to the compositor, to makes sure that we
// don't draw any 'blank' frames that could be noticed in applications such as
// window manager previews, which show content even when a window is
// minimized.
bool is_minimized = IsMinimized();
if (is_minimized != was_minimized) {
if (is_minimized)
if (is_minimized) {
compositor()->SetVisible(false);
content_window_->Hide();
else
} else {
content_window_->Show();
compositor()->SetVisible(true);
}
}
if (restored_bounds_.IsEmpty()) {
......
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