| Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| index 784446e2dfced277d11e5800b29d1bcada28ee1b..1e8b01c58d52d8c4d3fe6238a8b526b2bb4b3ea5 100644
|
| --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
|
| @@ -1715,6 +1715,14 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
|
| }
|
| break;
|
| }
|
| + case VisibilityNotify:
|
| + // Allows to trigger visibilityChange events when the browser window
|
| + // is minimized or restored.
|
| + if (xev->xvisibility.state == VisibilityFullyObscured)
|
| + content_window_->SetPageVisibility(false);
|
| + else
|
| + content_window_->SetPageVisibility(true);
|
| + break;
|
| case FocusOut:
|
| if (xev->xfocus.mode != NotifyGrab) {
|
| ReleaseCapture();
|
| @@ -1747,8 +1755,20 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
|
| previous_bounds_ = bounds_;
|
| bounds_ = bounds;
|
|
|
| - if (origin_changed)
|
| + if (origin_changed) {
|
| OnHostMoved(bounds_.origin());
|
| + // Allows to trigger visibilityChange events while swithcing between
|
| + // workspaces.
|
| + ::Screen* screen = DefaultScreenOfDisplay(xdisplay_);
|
| + int screen_width = WidthOfScreen(screen);
|
| + int screen_height = HeightOfScreen(screen);
|
| +
|
| + if (translated_x < 0 || translated_x > screen_width ||
|
| + translated_y < 0 || translated_y > screen_height)
|
| + content_window_->SetPageVisibility(false);
|
| + else
|
| + content_window_->SetPageVisibility(true);
|
| + }
|
|
|
| if (size_changed) {
|
| delayed_resize_task_.Reset(base::Bind(
|
|
|