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

Unified Diff: components/exo/shell_surface.cc

Issue 2360533002: exo: Implement minimal support for version 6 of XDG shell. (Closed)
Patch Set: exo: Implement basic support for version 6 of XDG shell. Created 4 years, 2 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 | components/exo/wayland/server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index cf8cced1d4c8210fd0d2ee2a0262be8089afd467..97bd44e5a503327ea9b8b9f7e4ce72be58a1cd21 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -637,8 +637,13 @@ void ShellSurface::OnSurfaceCommit() {
surface_->CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces();
surface_->CommitSurfaceHierarchy();
- if (enabled() && !widget_)
- CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL);
+ if (enabled() && !widget_) {
+ // Defer widget creation until surface contains some contents.
+ if (surface_->content_size().IsEmpty())
+ Configure();
+ else
+ CreateShellSurfaceWidget(ui::SHOW_STATE_NORMAL);
+ }
// Apply the accumulated pending origin offset to reflect acknowledged
// configure requests.
@@ -1076,8 +1081,6 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
}
void ShellSurface::Configure() {
- DCHECK(widget_);
-
// Delay configure callback if |scoped_configure_| is set.
if (scoped_configure_) {
scoped_configure_->set_needs_configure();
@@ -1097,10 +1100,16 @@ void ShellSurface::Configure() {
return;
}
- uint32_t serial = configure_callback_.Run(
- widget_->GetWindowBoundsInScreen().size(),
- ash::wm::GetWindowState(widget_->GetNativeWindow())->GetStateType(),
- IsResizing(), widget_->IsActive());
+ uint32_t serial;
+ if (widget_) {
Daniele Castagna 2016/10/20 20:09:16 Can you mention in the CL description why the widg
reveman 2017/01/30 22:54:05 Done.
+ serial = configure_callback_.Run(
+ widget_->GetWindowBoundsInScreen().size(),
+ ash::wm::GetWindowState(widget_->GetNativeWindow())->GetStateType(),
+ IsResizing(), widget_->IsActive());
+ } else {
+ serial = configure_callback_.Run(
+ gfx::Size(), ash::wm::WINDOW_STATE_TYPE_NORMAL, false, false);
+ }
// Apply origin offset and resize component at the first Commit() after this
// configure request has been acknowledged.
« no previous file with comments | « no previous file | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698