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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc

Issue 54983005: Plumb native AppWindow input region through to window shape under Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo in X11 patch Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_win.cc ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (!XGetGeometry(xdisplay_, x_root_window_, &root, &x, &y, 423 if (!XGetGeometry(xdisplay_, x_root_window_, &root, &x, &y,
424 &width, &height, &border_width, &depth)) { 424 &width, &height, &border_width, &depth)) {
425 NOTIMPLEMENTED(); 425 NOTIMPLEMENTED();
426 return gfx::Rect(0, 0, 10, 10); 426 return gfx::Rect(0, 0, 10, 10);
427 } 427 }
428 428
429 return gfx::Rect(x, y, width, height); 429 return gfx::Rect(x, y, width, height);
430 } 430 }
431 431
432 void DesktopRootWindowHostX11::SetShape(gfx::NativeRegion native_region) { 432 void DesktopRootWindowHostX11::SetShape(gfx::NativeRegion native_region) {
433 SkPath path; 433 if (native_region) {
434 native_region->getBoundaryPath(&path); 434 SkPath path;
435 Region region = gfx::CreateRegionFromSkPath(path); 435 native_region->getBoundaryPath(&path);
436 XShapeCombineRegion(xdisplay_, xwindow_, ShapeBounding, 0, 0, region, false); 436 Region region = gfx::CreateRegionFromSkPath(path);
437 XDestroyRegion(region); 437 XShapeCombineRegion(
438 xdisplay_, xwindow_, ShapeBounding, 0, 0, region, false);
439 XDestroyRegion(region);
440 } else {
441 ResetWindowRegion();
442 }
443
444 delete native_region;
438 } 445 }
439 446
440 void DesktopRootWindowHostX11::Activate() { 447 void DesktopRootWindowHostX11::Activate() {
441 X11DesktopHandler::get()->ActivateWindow(xwindow_); 448 X11DesktopHandler::get()->ActivateWindow(xwindow_);
442 } 449 }
443 450
444 void DesktopRootWindowHostX11::Deactivate() { 451 void DesktopRootWindowHostX11::Deactivate() {
445 // Deactivating a window means activating nothing. 452 // Deactivating a window means activating nothing.
446 X11DesktopHandler::get()->ActivateWindow(None); 453 X11DesktopHandler::get()->ActivateWindow(None);
447 } 454 }
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 if (linux_ui) { 1424 if (linux_ui) {
1418 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); 1425 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme();
1419 if (native_theme) 1426 if (native_theme)
1420 return native_theme; 1427 return native_theme;
1421 } 1428 }
1422 1429
1423 return ui::NativeTheme::instance(); 1430 return ui::NativeTheme::instance();
1424 } 1431 }
1425 1432
1426 } // namespace views 1433 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_win.cc ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698