Index: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
index 180614e955525046fbbfc4e2a0b5b810d681ca8a..884608768bf65683f5d04ca8c0d967755c6f8e3f 100644 |
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
@@ -430,11 +430,18 @@ gfx::Rect DesktopRootWindowHostX11::GetWorkAreaBoundsInScreen() const { |
} |
void DesktopRootWindowHostX11::SetShape(gfx::NativeRegion native_region) { |
- SkPath path; |
- native_region->getBoundaryPath(&path); |
- Region region = gfx::CreateRegionFromSkPath(path); |
- XShapeCombineRegion(xdisplay_, xwindow_, ShapeBounding, 0, 0, region, false); |
- XDestroyRegion(region); |
+ if (native_region) { |
+ SkPath path; |
+ native_region->getBoundaryPath(&path); |
+ Region region = gfx::CreateRegionFromSkPath(path); |
+ XShapeCombineRegion( |
+ xdisplay_, xwindow_, ShapeBounding, 0, 0, region, false); |
+ XDestroyRegion(region); |
+ } else { |
+ ResetWindowRegion(); |
+ } |
+ |
+ delete native_region; |
} |
void DesktopRootWindowHostX11::Activate() { |