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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 11363177: Don't use drag to corner resizing for unresizable windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added more cases and unit tests Created 8 years, 1 month 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
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index ab5782a347c6afe9c06cd8cae5286db063e5e9a5..9f5f7c999f23726806a4f27a57e9870cfbcf021a 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -36,6 +36,10 @@ scoped_ptr<WindowResizer> CreateWindowResizer(aura::Window* window,
const gfx::Point& point_in_parent,
int window_component) {
DCHECK(window);
+ // No need to return a resizer when the window cannot get resized.
+ if (!wm::CanResizeWindow(window))
sky 2012/11/13 17:01:54 Doesn't returning null here mean you can't drag fr
Mr4D (OOO till 08-26) 2012/11/13 21:27:23 The suggestion to do this came from you ( :) ) - b
+ return scoped_ptr<WindowResizer>();
+
if (window->parent() &&
window->parent()->id() == internal::kShellWindowId_WorkspaceContainer) {
// Allow dragging maximized windows if it's not tracked by workspace. This
@@ -286,8 +290,9 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location_in_parent,
wm::ConvertPointToScreen(window()->parent(), &location_in_screen);
const bool in_original_root =
wm::GetRootWindowAt(location_in_screen) == window()->GetRootWindow();
+
// Hide a phantom window for snapping if the cursor is in another root window.
- if (in_original_root) {
+ if (in_original_root && wm::CanResizeWindow(window())) {
UpdateSnapPhantomWindow(location_in_parent, bounds);
} else {
snap_type_ = SNAP_NONE;

Powered by Google App Engine
This is Rietveld 408576698