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

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

Issue 12319091: x11 desktop aura: Fix the cached bounds of the X window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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_linux.h" 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_linux.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 10
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 } else { 923 } else {
924 root_window_host_delegate_->OnHostLostMouseGrab(); 924 root_window_host_delegate_->OnHostLostMouseGrab();
925 } 925 }
926 break; 926 break;
927 case ConfigureNotify: { 927 case ConfigureNotify: {
928 DCHECK_EQ(xwindow_, xev->xconfigure.window); 928 DCHECK_EQ(xwindow_, xev->xconfigure.window);
929 DCHECK_EQ(xwindow_, xev->xconfigure.event); 929 DCHECK_EQ(xwindow_, xev->xconfigure.event);
930 // It's possible that the X window may be resized by some other means than 930 // It's possible that the X window may be resized by some other means than
931 // from within aura (e.g. the X window manager can change the size). Make 931 // from within aura (e.g. the X window manager can change the size). Make
932 // sure the root window size is maintained properly. 932 // sure the root window size is maintained properly.
933 gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, 933 int translated_x = xev->xconfigure.x;
934 int translated_y = xev->xconfigure.y;
935 if (!xev->xconfigure.send_event && !xev->xconfigure.override_redirect) {
936 Window unused;
937 XTranslateCoordinates(xdisplay_, xwindow_, x_root_window_,
938 0, 0, &translated_x, &translated_y, &unused);
939 }
940 gfx::Rect bounds(translated_x, translated_y,
934 xev->xconfigure.width, xev->xconfigure.height); 941 xev->xconfigure.width, xev->xconfigure.height);
935 bool size_changed = bounds_.size() != bounds.size(); 942 bool size_changed = bounds_.size() != bounds.size();
936 bool origin_changed = bounds_.origin() != bounds.origin(); 943 bool origin_changed = bounds_.origin() != bounds.origin();
937 bounds_ = bounds; 944 bounds_ = bounds;
938 if (size_changed) 945 if (size_changed)
939 root_window_host_delegate_->OnHostResized(bounds.size()); 946 root_window_host_delegate_->OnHostResized(bounds.size());
940 if (origin_changed) 947 if (origin_changed)
941 root_window_host_delegate_->OnHostMoved(bounds_.origin()); 948 root_window_host_delegate_->OnHostMoved(bounds_.origin());
942 break; 949 break;
943 } 950 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 DesktopRootWindowHost* DesktopRootWindowHost::Create( 1118 DesktopRootWindowHost* DesktopRootWindowHost::Create(
1112 internal::NativeWidgetDelegate* native_widget_delegate, 1119 internal::NativeWidgetDelegate* native_widget_delegate,
1113 DesktopNativeWidgetAura* desktop_native_widget_aura, 1120 DesktopNativeWidgetAura* desktop_native_widget_aura,
1114 const gfx::Rect& initial_bounds) { 1121 const gfx::Rect& initial_bounds) {
1115 return new DesktopRootWindowHostLinux(native_widget_delegate, 1122 return new DesktopRootWindowHostLinux(native_widget_delegate,
1116 desktop_native_widget_aura, 1123 desktop_native_widget_aura,
1117 initial_bounds); 1124 initial_bounds);
1118 } 1125 }
1119 1126
1120 } // namespace views 1127 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698