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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 456943004: Fix SetShape (SetAlphaShape) to allow Null regions (+ tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing delete; Remove unnecessary layer check" Created 6 years, 4 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
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 849a46b2e3febb7daeb4159c98d29cc788d8d41d..5802d95d7998ec83e9ee3729c678d837aee6a587 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -495,10 +495,15 @@ gfx::Rect DesktopWindowTreeHostX11::GetWorkAreaBoundsInScreen() const {
void DesktopWindowTreeHostX11::SetShape(gfx::NativeRegion native_region) {
if (window_shape_)
XDestroyRegion(window_shape_);
- custom_window_shape_ = true;
- window_shape_ = gfx::CreateRegionFromSkRegion(*native_region);
+ custom_window_shape_ = false;
+ window_shape_ = NULL;
+
+ if (native_region) {
+ custom_window_shape_ = true;
+ window_shape_ = gfx::CreateRegionFromSkRegion(*native_region);
+ delete native_region;
+ }
ResetWindowRegion();
- delete native_region;
}
void DesktopWindowTreeHostX11::Activate() {

Powered by Google App Engine
This is Rietveld 408576698