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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h

Issue 924853002: linux/x11: Fix setting window bounds in High DPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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
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 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
7 7
8 #include <X11/extensions/shape.h> 8 #include <X11/extensions/shape.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void InitModalType(ui::ModalType modal_type) override; 140 void InitModalType(ui::ModalType modal_type) override;
141 void FlashFrame(bool flash_frame) override; 141 void FlashFrame(bool flash_frame) override;
142 void OnRootViewLayout() override; 142 void OnRootViewLayout() override;
143 void OnNativeWidgetFocus() override; 143 void OnNativeWidgetFocus() override;
144 void OnNativeWidgetBlur() override; 144 void OnNativeWidgetBlur() override;
145 bool IsAnimatingClosed() const override; 145 bool IsAnimatingClosed() const override;
146 bool IsTranslucentWindowOpacitySupported() const override; 146 bool IsTranslucentWindowOpacitySupported() const override;
147 void SizeConstraintsChanged() override; 147 void SizeConstraintsChanged() override;
148 148
149 // Overridden from aura::WindowTreeHost: 149 // Overridden from aura::WindowTreeHost:
150 gfx::Transform GetRootTransform() const override;
150 ui::EventSource* GetEventSource() override; 151 ui::EventSource* GetEventSource() override;
151 gfx::AcceleratedWidget GetAcceleratedWidget() override; 152 gfx::AcceleratedWidget GetAcceleratedWidget() override;
152 void Show() override; 153 void Show() override;
153 void Hide() override; 154 void Hide() override;
154 gfx::Rect GetBounds() const override; 155 gfx::Rect GetBounds() const override;
155 void SetBounds(const gfx::Rect& requested_bounds) override; 156 void SetBounds(const gfx::Rect& requested_bounds) override;
156 gfx::Point GetLocationOnNativeScreen() const override; 157 gfx::Point GetLocationOnNativeScreen() const override;
157 void SetCapture() override; 158 void SetCapture() override;
158 void ReleaseCapture() override; 159 void ReleaseCapture() override;
159 void SetCursorNative(gfx::NativeCursor cursor) override; 160 void SetCursorNative(gfx::NativeCursor cursor) override;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 237
237 // Relayout the widget's client and non-client views. 238 // Relayout the widget's client and non-client views.
238 void Relayout(); 239 void Relayout();
239 240
240 // ui::PlatformEventDispatcher: 241 // ui::PlatformEventDispatcher:
241 bool CanDispatchEvent(const ui::PlatformEvent& event) override; 242 bool CanDispatchEvent(const ui::PlatformEvent& event) override;
242 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; 243 uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
243 244
244 void DelayedResize(const gfx::Size& size); 245 void DelayedResize(const gfx::Size& size);
245 246
247 gfx::Rect GetWorkAreaBoundsInPixels() const;
248 gfx::Rect ToDIPRect(const gfx::Rect& rect_in_pixels) const;
249 gfx::Rect ToPixelRect(const gfx::Rect& rect_in_dip) const;
250
246 // X11 things 251 // X11 things
247 // The display and the native X window hosting the root window. 252 // The display and the native X window hosting the root window.
248 XDisplay* xdisplay_; 253 XDisplay* xdisplay_;
249 ::Window xwindow_; 254 ::Window xwindow_;
250 255
251 // The native root window. 256 // The native root window.
252 ::Window x_root_window_; 257 ::Window x_root_window_;
253 258
254 ui::X11AtomCache atom_cache_; 259 ui::X11AtomCache atom_cache_;
255 260
256 // Is the window mapped to the screen? 261 // Is the window mapped to the screen?
257 bool window_mapped_; 262 bool window_mapped_;
258 263
259 // The bounds of |xwindow_|. 264 // The bounds of |xwindow_|.
260 gfx::Rect bounds_; 265 gfx::Rect bounds_in_pixels_;
261 266
262 // Whenever the bounds are set, we keep the previous set of bounds around so 267 // Whenever the bounds are set, we keep the previous set of bounds around so
263 // we can have a better chance of getting the real |restored_bounds_|. Window 268 // we can have a better chance of getting the real |restored_bounds_|. Window
264 // managers tend to send a Configure message with the maximized bounds, and 269 // managers tend to send a Configure message with the maximized bounds, and
265 // then set the window maximized property. (We don't rely on this for when we 270 // then set the window maximized property. (We don't rely on this for when we
266 // request that the window be maximized, only when we detect that some other 271 // request that the window be maximized, only when we detect that some other
267 // process has requested that we become the maximized window.) 272 // process has requested that we become the maximized window.)
268 gfx::Rect previous_bounds_; 273 gfx::Rect previous_bounds_;
269 274
270 // The bounds of our window before we were maximized. 275 // The bounds of our window before we were maximized.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 base::CancelableCallback<void()> delayed_resize_task_; 347 base::CancelableCallback<void()> delayed_resize_task_;
343 348
344 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; 349 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
345 350
346 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); 351 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
347 }; 352 };
348 353
349 } // namespace views 354 } // namespace views
350 355
351 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 356 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698