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

Unified Diff: ui/aura/root_window_host_linux.cc

Issue 12746002: Re-implement overscan & Implement Display Rotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | « ui/aura/root_window_host_linux.h ('k') | ui/aura/root_window_host_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window_host_linux.cc
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index c3c6f0d3a2e1eaf25fef333a14f35879e8ed9f40..48b1b27f2db9d94755a92a827bf314d6352266b4 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -579,6 +579,18 @@ void RootWindowHostLinux::SetBounds(const gfx::Rect& bounds) {
}
}
+gfx::Insets RootWindowHostLinux::GetInsets() const {
+ return insets_;
+}
+
+void RootWindowHostLinux::SetInsets(const gfx::Insets& insets) {
+ insets_ = insets;
+ if (pointer_barriers_.get()) {
+ UnConfineCursor();
+ ConfineCursorToRootWindow();
+ }
+}
+
gfx::Point RootWindowHostLinux::GetLocationOnNativeScreen() const {
return bounds_.origin();
}
@@ -627,31 +639,31 @@ bool RootWindowHostLinux::ConfineCursorToRootWindow() {
DCHECK(!pointer_barriers_.get());
if (pointer_barriers_.get())
return false;
- // TODO(oshima): There is a know issue where the pointer barrier
- // leaks mouse pointer under certain conditions. crbug.com/133694.
pointer_barriers_.reset(new XID[4]);
+ gfx::Rect bounds(bounds_);
+ bounds.Inset(insets_);
// Horizontal, top barriers.
pointer_barriers_[0] = XFixesCreatePointerBarrier(
xdisplay_, x_root_window_,
- bounds_.x(), bounds_.y(), bounds_.right(), bounds_.y(),
+ bounds.x(), bounds.y(), bounds.right(), bounds.y(),
BarrierPositiveY,
0, XIAllDevices);
// Horizontal, bottom barriers.
pointer_barriers_[1] = XFixesCreatePointerBarrier(
xdisplay_, x_root_window_,
- bounds_.x(), bounds_.bottom(), bounds_.right(), bounds_.bottom(),
+ bounds.x(), bounds.bottom(), bounds.right(), bounds.bottom(),
BarrierNegativeY,
0, XIAllDevices);
// Vertical, left barriers.
pointer_barriers_[2] = XFixesCreatePointerBarrier(
xdisplay_, x_root_window_,
- bounds_.x(), bounds_.y(), bounds_.x(), bounds_.bottom(),
+ bounds.x(), bounds.y(), bounds.x(), bounds.bottom(),
BarrierPositiveX,
0, XIAllDevices);
// Vertical, right barriers.
pointer_barriers_[3] = XFixesCreatePointerBarrier(
xdisplay_, x_root_window_,
- bounds_.right(), bounds_.y(), bounds_.right(), bounds_.bottom(),
+ bounds.right(), bounds.y(), bounds.right(), bounds.bottom(),
BarrierNegativeX,
0, XIAllDevices);
#endif
@@ -998,7 +1010,7 @@ void RootWindowHostLinux::TranslateAndDispatchMouseEvent(
gfx::Point location(event->location());
screen_position_client->ConvertNativePointToScreen(root, &location);
screen_position_client->ConvertPointFromScreen(root, &location);
- // |delegate_|'s OnHoustMouseEvent expects native coordinates relative to
+ // |delegate_|'s OnHostMouseEvent expects native coordinates relative to
// root.
location = ui::ConvertPointToPixel(root->layer(), location);
event->set_location(location);
« no previous file with comments | « ui/aura/root_window_host_linux.h ('k') | ui/aura/root_window_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698