summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorsaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 20:35:27 +0000
committersaintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 20:35:27 +0000
commite5f47d3f9c2b4118e2f4df500573048283c76957 (patch)
treee76b477d84034c4f602f641a8d8cef41c8b5a69f /ui
parent252f86be785920b4ed67f0e194e5833ad0c88142 (diff)
downloadchromium_src-e5f47d3f9c2b4118e2f4df500573048283c76957.zip
chromium_src-e5f47d3f9c2b4118e2f4df500573048283c76957.tar.gz
chromium_src-e5f47d3f9c2b4118e2f4df500573048283c76957.tar.bz2
This is the 3 following CLs collapsed as one (for easier merge in M23)
http://src.chromium.org/viewvc/chrome?view=rev&revision=158546 http://src.chromium.org/viewvc/chrome?view=rev&revision=158721 http://src.chromium.org/viewvc/chrome?view=rev&revision=158771 NOTE: this can only be landed *after* this has landed: https://codereview.chromium.org/10990091/ BUG=152003 TBR=oshima@chromium.org,derat@chromium.org,sky@chromium.org,jhorwich@chromium.org Review URL: https://codereview.chromium.org/10993062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/display_change_observer_x11.cc10
-rw-r--r--ui/aura/root_window_host_linux.cc26
2 files changed, 32 insertions, 4 deletions
diff --git a/ui/aura/display_change_observer_x11.cc b/ui/aura/display_change_observer_x11.cc
index 21dab9c..ad2006d 100644
--- a/ui/aura/display_change_observer_x11.cc
+++ b/ui/aura/display_change_observer_x11.cc
@@ -130,6 +130,12 @@ void DisplayChangeObserverX11::NotifyDisplayChange() {
LOG(WARNING) << "Crtc not found for output: output=" << o;
continue;
}
+ // TODO(oshima): Temporarily ignore all displays other than
+ // primary, which has y = 0 to disable extended desktop.
+ // crbug.com/152003.
+ if (crtc_info->y != 0)
+ continue;
+
XRRModeInfo* mode = FindMode(screen_resources, crtc_info->mode);
if (!mode) {
LOG(WARNING) << "Could not find a mode for the output: output=" << o;
@@ -165,6 +171,10 @@ void DisplayChangeObserverX11::NotifyDisplayChange() {
y_coords.insert(crtc_info->y);
XRRFreeOutputInfo(output_info);
+
+ // TODO(oshima): There is only one display in m23.
+ // Set the id to 0. crbug.com/152003.
+ displays.back().set_id(0);
}
// Free all allocated resources.
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index 360c872..52000cf 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -498,11 +498,13 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) {
if (client) {
gfx::Point p = gfx::Screen::GetCursorScreenPoint();
client->ConvertPointFromScreen(root, &p);
- if (root->ContainsPoint(p)) {
+ // TODO(oshima): Make sure the pointer is on one of root windows.
+ if (root->ContainsPoint(p))
root->ConvertPointToNativeScreen(&p);
- XWarpPointer(
- xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y());
- }
+ else
+ p.SetPoint(0, 0);
+ XWarpPointer(
+ xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y());
}
ConfineCursorToRootWindow();
}
@@ -510,6 +512,22 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) {
delegate_->OnHostResized(bounds.size());
if (origin_changed)
delegate_->OnHostMoved(bounds_.origin());
+#if defined(OS_CHROMEOS)
+ // TODO(oshima): Clear the root when the window is moved or
+ // resized while the extended desktop is disabled.
+ // crbug.com/152003.
+ if (base::chromeos::IsRunningOnChromeOS()) {
+ XGCValues gc_values = {0};
+ gc_values.foreground = BlackPixel(xdisplay_, DefaultScreen(xdisplay_));
+ GC gc = XCreateGC(xdisplay_, x_root_window_, GCForeground, &gc_values);
+ XFillRectangle(xdisplay_, x_root_window_, gc,
+ x_root_bounds_.x(),
+ x_root_bounds_.y(),
+ x_root_bounds_.width(),
+ x_root_bounds_.height());
+ XFreeGC(xdisplay_, gc);
+ }
+#endif
break;
}
case GenericEvent: