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

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

Issue 922293002: linux/x11: Fix event dispatch in menus 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
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc » ('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 #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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 void SetCapture() override; 157 void SetCapture() override;
158 void ReleaseCapture() override; 158 void ReleaseCapture() override;
159 void SetCursorNative(gfx::NativeCursor cursor) override; 159 void SetCursorNative(gfx::NativeCursor cursor) override;
160 void MoveCursorToNative(const gfx::Point& location) override; 160 void MoveCursorToNative(const gfx::Point& location) override;
161 void OnCursorVisibilityChangedNative(bool show) override; 161 void OnCursorVisibilityChangedNative(bool show) override;
162 162
163 // Overridden frm ui::EventSource 163 // Overridden frm ui::EventSource
164 ui::EventProcessor* GetEventProcessor() override; 164 ui::EventProcessor* GetEventProcessor() override;
165 165
166 private: 166 private:
167 friend class DesktopWindowTreeHostX11HighDPITest;
167 // Initializes our X11 surface to draw on. This method performs all 168 // Initializes our X11 surface to draw on. This method performs all
168 // initialization related to talking to the X11 server. 169 // initialization related to talking to the X11 server.
169 void InitX11Window(const Widget::InitParams& params); 170 void InitX11Window(const Widget::InitParams& params);
170 171
171 // Creates an aura::WindowEventDispatcher to contain the |content_window|, 172 // Creates an aura::WindowEventDispatcher to contain the |content_window|,
172 // along with all aura client objects that direct behavior. 173 // along with all aura client objects that direct behavior.
173 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); 174 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params);
174 175
175 // Adjusts |requested_size| to avoid the WM "feature" where setting the 176 // Adjusts |requested_size| to avoid the WM "feature" where setting the
176 // window size to the monitor size causes the WM to set the EWMH for 177 // window size to the monitor size causes the WM to set the EWMH for
(...skipping 25 matching lines...) Expand all
202 // Dispatches a mouse event, taking mouse capture into account. If a 203 // Dispatches a mouse event, taking mouse capture into account. If a
203 // different host has capture, we translate the event to its coordinate space 204 // different host has capture, we translate the event to its coordinate space
204 // and dispatch it to that host instead. 205 // and dispatch it to that host instead.
205 void DispatchMouseEvent(ui::MouseEvent* event); 206 void DispatchMouseEvent(ui::MouseEvent* event);
206 207
207 // Dispatches a touch event, taking capture into account. If a different host 208 // Dispatches a touch event, taking capture into account. If a different host
208 // has capture, then touch-press events are translated to its coordinate space 209 // has capture, then touch-press events are translated to its coordinate space
209 // and dispatched to that host instead. 210 // and dispatched to that host instead.
210 void DispatchTouchEvent(ui::TouchEvent* event); 211 void DispatchTouchEvent(ui::TouchEvent* event);
211 212
213 // Updates the location of |located_event| to be in |host|'s coordinate system
214 // so that it can be dispatched to |host|.
215 void ConvertEventToDifferentHost(ui::LocatedEvent* located_event,
216 DesktopWindowTreeHostX11* host);
217
212 // Resets the window region for the current widget bounds if necessary. 218 // Resets the window region for the current widget bounds if necessary.
213 void ResetWindowRegion(); 219 void ResetWindowRegion();
214 220
215 // Serializes an image to the format used by _NET_WM_ICON. 221 // Serializes an image to the format used by _NET_WM_ICON.
216 void SerializeImageRepresentation(const gfx::ImageSkiaRep& rep, 222 void SerializeImageRepresentation(const gfx::ImageSkiaRep& rep,
217 std::vector<unsigned long>* data); 223 std::vector<unsigned long>* data);
218 224
219 // Returns an 8888 ARGB visual. Can return NULL if there is no matching 225 // Returns an 8888 ARGB visual. Can return NULL if there is no matching
220 // visual on this display. 226 // visual on this display.
221 Visual* GetARGBVisual(); 227 Visual* GetARGBVisual();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 base::CancelableCallback<void()> delayed_resize_task_; 342 base::CancelableCallback<void()> delayed_resize_task_;
337 343
338 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; 344 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
339 345
340 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); 346 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11);
341 }; 347 };
342 348
343 } // namespace views 349 } // namespace views
344 350
345 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ 351 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698