Chromium Code Reviews| Index: components/exo/wayland/server.cc |
| diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc |
| index f746de2bd6156df06406bac62f342c39dfd43d05..983c1c1d8de6f5dce112711e81bc894f37957176 100644 |
| --- a/components/exo/wayland/server.cc |
| +++ b/components/exo/wayland/server.cc |
| @@ -158,6 +158,10 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kSurfaceHasSecurityKey, false); |
| // associated with window. |
| DEFINE_UI_CLASS_PROPERTY_KEY(bool, kSurfaceHasBlendingKey, false); |
| +// A property key containing a boolean set to true if the currently being |
| +// processed window activation is of Wayland client origin. |
| +DEFINE_UI_CLASS_PROPERTY_KEY(bool, kIsActivatingFromClient, false); |
|
reveman
2017/04/19 04:14:13
nit: maybe s/kIsActivatingFromClient/kIgnoreWindow
mtomasz
2017/04/20 00:46:17
Done.
|
| + |
| wl_resource* GetSurfaceResource(Surface* surface) { |
| return surface->GetProperty(kSurfaceResourceKey); |
| } |
| @@ -1926,7 +1930,14 @@ void remote_surface_set_top_inset(wl_client* client, |
| void remote_surface_activate(wl_client* client, |
| wl_resource* resource, |
| uint32_t serial) { |
| + ShellSurface* shell_surface = GetUserDataAs<ShellSurface>(resource); |
| + aura::Window* window = shell_surface->GetWidget()->GetNativeWindow(); |
| + |
| + // Activation on Aura is synchronous, so activation callbacks will be called |
| + // before the activation source flag is reset. |
| + window->SetProperty(kIsActivatingFromClient, true); |
| GetUserDataAs<ShellSurface>(resource)->Activate(); |
| + window->SetProperty(kIsActivatingFromClient, false); |
|
reveman
2017/04/19 04:14:13
nit: use ClearProperty
mtomasz
2017/04/20 00:46:17
Done.
|
| } |
| void remote_surface_maximize(wl_client* client, wl_resource* resource) { |
| @@ -2121,6 +2132,13 @@ class WaylandRemoteShell : public WMHelper::MaximizeModeObserver, |
| // Overridden from WMHelper::ActivationObserver: |
| void OnWindowActivated(aura::Window* gained_active, |
| aura::Window* lost_active) override { |
| + // If the origin of activation is Wayland client, then assume it's been |
| + // already activated on the client side, so do not notify about the |
| + // activation. It means that zcr_remote_shell_v1_send_activated is used |
| + // only to notify about activations originating in Aura. |
| + if (gained_active && gained_active->GetProperty(kIsActivatingFromClient)) |
| + return; |
| + |
| SendActivated(gained_active, lost_active); |
| } |