Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: components/exo/wayland/server.cc

Issue 2855883009: Don't send activation event when created (Closed)
Patch Set: changed to do all in server.cc Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wayland/server.cc
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index 5b718c3c726411bd4d312c12d1ae118378c1112b..bc9c28b3c2940b2897c043859c2d95f5f25d8b88 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -160,7 +160,7 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kSurfaceHasBlendingKey, false);
// A property key containing a boolean set to true whether the current
// OnWindowActivated invocation should be ignored.
-DEFINE_UI_CLASS_PROPERTY_KEY(bool, kIgnoreWindowActivated, false);
+DEFINE_UI_CLASS_PROPERTY_KEY(bool, kIgnoreWindowActivated, true);
wl_resource* GetSurfaceResource(Surface* surface) {
return surface->GetProperty(kSurfaceResourceKey);
@@ -255,7 +255,19 @@ void surface_set_input_region(wl_client* client,
}
void surface_commit(wl_client* client, wl_resource* resource) {
- GetUserDataAs<Surface>(resource)->Commit();
+ Surface* surface = GetUserDataAs<Surface>(resource);
+ surface->Commit();
+ // Enable the activation event on the shell surface's window.
+ aura::Window* window = surface->window()->parent();
+ if (!window) {
+ return;
+ }
+ Surface* main_surface = ShellSurface::GetMainSurface(window);
+ if (main_surface) {
+ if (window->GetProperty(kIgnoreWindowActivated)) {
+ window->SetProperty(kIgnoreWindowActivated, false);
reveman 2017/05/05 18:04:29 Can we use an aura::WindowObserver for this instea
oshima 2017/05/05 23:09:33 The window becomes visible before being activated
+ }
+ }
}
void surface_set_buffer_transform(wl_client* client,
@@ -1936,8 +1948,8 @@ void remote_surface_activate(wl_client* client,
// Activation on Aura is synchronous, so activation callbacks will be called
// before the flag is reset.
window->SetProperty(kIgnoreWindowActivated, true);
- GetUserDataAs<ShellSurface>(resource)->Activate();
- window->ClearProperty(kIgnoreWindowActivated);
+ shell_surface->Activate();
+ window->SetProperty(kIgnoreWindowActivated, false);
oshima 2017/05/05 23:09:33 we still need this because activation may fail
}
void remote_surface_maximize(wl_client* client, wl_resource* resource) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698