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

Unified Diff: src/platform/window_manager/real_compositor.cc

Issue 2078031: wm: Fix override-redirect window stacking bug. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222//chromeos.git
Patch Set: LOG(DFATAL) on invalid actor raise/lower Created 10 years, 7 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 | « src/platform/window_manager/mock_compositor.cc ('k') | src/platform/window_manager/stacking_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/window_manager/real_compositor.cc
diff --git a/src/platform/window_manager/real_compositor.cc b/src/platform/window_manager/real_compositor.cc
index 519608f972a7640833bb81d05069be8dd9dc3770..098fcebc4fe8ee52cba6b33f53dc6eb90fb7a256 100644
--- a/src/platform/window_manager/real_compositor.cc
+++ b/src/platform/window_manager/real_compositor.cc
@@ -227,31 +227,40 @@ void RealCompositor::Actor::SetTilt(double tilt, int duration_ms) {
}
void RealCompositor::Actor::Raise(Compositor::Actor* other) {
- CHECK(parent_) << "Tried to raise an actor that has no parent.";
+ CHECK(parent_) << "Raising actor " << this << ", which has no parent";
+ if (other == this) {
+ LOG(DFATAL) << "Got request to raise actor " << this << " above itself";
+ return;
+ }
RealCompositor::Actor* other_nc =
dynamic_cast<RealCompositor::Actor*>(other);
- CHECK(other_nc) << "Failed to cast to an Actor in Raise";
+ CHECK(other_nc) << "Failed to cast " << other << " to an Actor in Raise()";
parent_->RaiseChild(this, other_nc);
SetDirty();
}
void RealCompositor::Actor::Lower(Compositor::Actor* other) {
- CHECK(parent_) << "Tried to lower an actor that has no parent.";
+ CHECK(parent_) << "Lowering actor " << this << ", which has no parent";
+ if (other == this) {
+ LOG(DFATAL) << "Got request to lower actor " << this << " below itself";
+ return;
+ }
RealCompositor::Actor* other_nc =
dynamic_cast<RealCompositor::Actor*>(other);
- CHECK(other_nc) << "Failed to cast to an Actor in Lower";
+ CHECK(other_nc) << "Failed to cast " << other << " to an Actor in Lower()";
parent_->LowerChild(this, other_nc);
SetDirty();
}
void RealCompositor::Actor::RaiseToTop() {
- CHECK(parent_) << "Tried to raise an actor to top that has no parent.";
+ CHECK(parent_) << "Raising actor " << this << ", which has no parent, to top";
parent_->RaiseChild(this, NULL);
SetDirty();
}
void RealCompositor::Actor::LowerToBottom() {
- CHECK(parent_) << "Tried to lower an actor to bottom that has no parent.";
+ CHECK(parent_) << "Lowering actor " << this << ", which has no parent, "
+ << "to bottom";
parent_->LowerChild(this, NULL);
SetDirty();
}
@@ -259,9 +268,7 @@ void RealCompositor::Actor::LowerToBottom() {
string RealCompositor::Actor::GetDebugStringInternal(const string& type_name,
int indent_level) {
string out;
- for (int i = 0; i < indent_level; ++i)
- out += " ";
-
+ out.assign(indent_level * 2, ' ');
out += StringPrintf("\"%s\" %p (%s%s) (%d, %d) %dx%d "
"scale=(%.2f, %.2f) %.2f%% tilt=%0.2f\n",
!name_.empty() ? name_.c_str() : "",
« no previous file with comments | « src/platform/window_manager/mock_compositor.cc ('k') | src/platform/window_manager/stacking_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698