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

Unified Diff: components/exo/shell_surface.cc

Issue 2396883003: exo: Fix dragging edge cases (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « components/exo/shell_surface.h ('k') | 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 e51f8c00195d1ff9df7cccf6b35e53e4431cca36..5a7a634c343985d215e213893878c79822024dfc 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -373,6 +373,7 @@ ShellSurface::ShellSurface(Surface* surface,
can_minimize_(can_minimize),
container_(container) {
WMHelper::GetInstance()->AddActivationObserver(this);
+ WMHelper::GetInstance()->AddShellObserver(this);
surface_->SetSurfaceDelegate(this);
surface_->AddSurfaceObserver(this);
surface_->window()->Show();
@@ -405,6 +406,7 @@ ShellSurface::~ShellSurface() {
widget_->CloseNow();
}
WMHelper::GetInstance()->RemoveActivationObserver(this);
+ WMHelper::GetInstance()->RemoveShellObserver(this);
if (parent_)
parent_->RemoveObserver(this);
if (surface_) {
@@ -934,6 +936,8 @@ void ShellSurface::OnPreWindowStateTypeChange(
ash::wm::WindowStateType new_type = window_state->GetStateType();
if (ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(old_type) ||
ash::wm::IsMaximizedOrFullscreenOrPinnedWindowStateType(new_type)) {
+ EndDragOrMove(false /* revert */);
reveman 2017/01/23 20:23:48 how is other chrome windows handling this?
Dominik Laskowski 2017/01/23 23:01:36 It's not handled. If you enter full screen after d
reveman 2017/01/26 06:50:21 That sounds like a bug. Is there a more general wa
+
// When transitioning in/out of maximized or fullscreen mode we need to
// make sure we have a configure callback before we allow the default
// cross-fade animations. The configure callback provides a mechanism for
@@ -1028,6 +1032,18 @@ void ShellSurface::OnWindowActivated(
}
////////////////////////////////////////////////////////////////////////////////
+// WMHelper::ShellObserver overrides:
+
+void ShellSurface::OnOverviewModeStarted() {
+ EndDragOrMove(false /* revert */);
reveman 2017/01/23 20:23:48 is this also a problem for non-exo window dragging
Dominik Laskowski 2017/01/23 23:01:36 Yes, entering/exiting overview mode while dragging
reveman 2017/01/26 06:50:21 Ok, let's do Ash first and once that lands we'll m
+ ignore_widget_bounds_changes_ = true;
reveman 2017/01/23 20:23:48 why is this needed? seems fragile to rely on us de
Dominik Laskowski 2017/01/23 23:01:36 When entering overview mode, a lost focus event ca
reveman 2017/01/26 06:50:21 Why do they need to be discarded? Doesn't this lea
+}
+
+void ShellSurface::OnOverviewModeEnded() {
+ ignore_widget_bounds_changes_ = false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
// WMHelper::AccessibilityObserver overrides:
void ShellSurface::OnAccessibilityModeChanged() {
@@ -1410,8 +1426,8 @@ void ShellSurface::UpdateWidgetBounds() {
return;
}
- // 2) When a window is being dragged.
- if (IsResizing())
+ // 2) When a window is being dragged, or is being moved by the shell.
+ if (IsResizing() || ignore_widget_bounds_changes_)
return;
// Return early if there is pending configure requests.
« no previous file with comments | « components/exo/shell_surface.h ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698