| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/dock_info.h" | 5 #include "chrome/browser/dock_info.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/gfx/native_widget_types.h" | 9 #include "base/gfx/native_widget_types.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 virtual bool ShouldStopIterating(XID window) { | 68 virtual bool ShouldStopIterating(XID window) { |
| 69 if (BaseWindowFinder::ShouldIgnoreWindow(window)) | 69 if (BaseWindowFinder::ShouldIgnoreWindow(window)) |
| 70 return false; | 70 return false; |
| 71 | 71 |
| 72 if (window == target_) { | 72 if (window == target_) { |
| 73 // Window is topmost, stop iterating. | 73 // Window is topmost, stop iterating. |
| 74 is_top_most_ = true; | 74 is_top_most_ = true; |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 if (x11_util::IsWindowVisible(window)) { | 78 if (!x11_util::IsWindowVisible(window)) { |
| 79 // The window isn't visible, keep iterating. | 79 // The window isn't visible, keep iterating. |
| 80 return false; | 80 return false; |
| 81 } | 81 } |
| 82 | 82 |
| 83 gfx::Rect rect; | 83 gfx::Rect rect; |
| 84 if (x11_util::GetWindowRect(window, &rect) && rect.Contains(screen_loc_)) { | 84 if (x11_util::GetWindowRect(window, &rect) && rect.Contains(screen_loc_)) { |
| 85 // At this point we haven't found our target window, so this window is | 85 // At this point we haven't found our target window, so this window is |
| 86 // higher in the z-order than the target window. If this window contains | 86 // higher in the z-order than the target window. If this window contains |
| 87 // the point, then we can stop the search now because this window is | 87 // the point, then we can stop the search now because this window is |
| 88 // obscuring the target window at this point. | 88 // obscuring the target window at this point. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 gtk_window_get_position(window(), &x, &y); | 210 gtk_window_get_position(window(), &x, &y); |
| 211 gtk_window_get_size(window(), &w, &h); | 211 gtk_window_get_size(window(), &w, &h); |
| 212 bounds->SetRect(x, y, w, h); | 212 bounds->SetRect(x, y, w, h); |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { | 216 void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const { |
| 217 gtk_window_move(window(), bounds.x(), bounds.y()); | 217 gtk_window_move(window(), bounds.x(), bounds.y()); |
| 218 gtk_window_resize(window(), bounds.width(), bounds.height()); | 218 gtk_window_resize(window(), bounds.width(), bounds.height()); |
| 219 } | 219 } |
| OLD | NEW |