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

Unified Diff: transient_window_collection.cc

Issue 6902072: wm: Update a lot of code to use structs from geometry.h. (Closed) Base URL: ssh://gitrw.chromium.org:9222/window_manager.git@master
Patch Set: move override-redirect stacking and visibility into Window Created 9 years, 8 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 | « transient_window_collection.h ('k') | util.h » ('j') | window.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: transient_window_collection.cc
diff --git a/transient_window_collection.cc b/transient_window_collection.cc
index 5d069b7ddc1c6e3865577b41b2b6c5f0874b11ec..d27dde367674b46bec4304c833e5b7dab2e481fa 100644
--- a/transient_window_collection.cc
+++ b/transient_window_collection.cc
@@ -105,9 +105,7 @@ void TransientWindowCollection::AddWindow(
transient->centered = false;
} else {
transient->UpdateOffsetsToCenterOverWindow(
- owner_win_,
- Rect(0, 0, wm()->width(), wm()->height()),
- constrain_onscreen_);
+ owner_win_, wm()->root_bounds(), constrain_onscreen_);
transient->centered = true;
}
@@ -187,30 +185,26 @@ void TransientWindowCollection::ApplyStackingForAllWindows(
}
void TransientWindowCollection::HandleConfigureRequest(
- Window* transient_win,
- int req_x, int req_y,
- int req_width, int req_height) {
+ Window* transient_win, const Rect& requested_bounds) {
CHECK(transient_win);
TransientWindow* transient = GetTransientWindow(*transient_win);
CHECK(transient);
- Rect orig_client_bounds = transient_win->client_bounds();
+ const Rect orig_client_bounds = transient_win->client_bounds();
// Move and resize the transient window as requested (only let info bubbles
// move themselves).
if (transient_win->type() == chromeos::WM_IPC_WINDOW_CHROME_INFO_BUBBLE) {
- transient->SaveOffsetsRelativeToWindow(owner_win_, Point(req_x, req_y));
+ transient->SaveOffsetsRelativeToWindow(
+ owner_win_, requested_bounds.position());
transient->centered = false;
}
- if (req_width != transient_win->client_width() ||
- req_height != transient_win->client_height()) {
- transient_win->ResizeClient(req_width, req_height, GRAVITY_NORTHWEST);
+ if (requested_bounds.size() != transient_win->client_size()) {
+ transient_win->Resize(requested_bounds.size(), GRAVITY_NORTHWEST);
if (transient->centered) {
transient->UpdateOffsetsToCenterOverWindow(
- owner_win_,
- Rect(0, 0, wm()->width(), wm()->height()),
- constrain_onscreen_);
+ owner_win_, wm()->root_bounds(), constrain_onscreen_);
}
}
« no previous file with comments | « transient_window_collection.h ('k') | util.h » ('j') | window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698