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

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

Issue 375593002: Do not set the mouse event handler if Widget::SetCapture() fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
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_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 void DesktopWindowTreeHostX11::SetUseNativeFrame(bool use_native_frame) { 1294 void DesktopWindowTreeHostX11::SetUseNativeFrame(bool use_native_frame) {
1295 use_native_frame_ = use_native_frame; 1295 use_native_frame_ = use_native_frame;
1296 ui::SetUseOSWindowFrame(xwindow_, use_native_frame); 1296 ui::SetUseOSWindowFrame(xwindow_, use_native_frame);
1297 ResetWindowRegion(); 1297 ResetWindowRegion();
1298 } 1298 }
1299 1299
1300 void DesktopWindowTreeHostX11::OnCaptureReleased() { 1300 void DesktopWindowTreeHostX11::OnCaptureReleased() {
1301 x11_capture_.reset(); 1301 x11_capture_.reset();
1302 g_current_capture = NULL; 1302 g_current_capture = NULL;
1303 OnHostLostWindowCapture(); 1303 OnHostLostWindowCapture();
1304 native_widget_delegate_->OnMouseCaptureLost();
1305 } 1304 }
1306 1305
1307 void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) { 1306 void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) {
1308 // In Windows, the native events sent to chrome are separated into client 1307 // In Windows, the native events sent to chrome are separated into client
1309 // and non-client versions of events, which we record on our LocatedEvent 1308 // and non-client versions of events, which we record on our LocatedEvent
1310 // structures. On X11, we emulate the concept of non-client. Before we pass 1309 // structures. On X11, we emulate the concept of non-client. Before we pass
1311 // this event to the cross platform event handling framework, we need to 1310 // this event to the cross platform event handling framework, we need to
1312 // make sure it is appropriately marked as non-client if it's in the non 1311 // make sure it is appropriately marked as non-client if it's in the non
1313 // client area, or otherwise, we can get into a state where the a window is 1312 // client area, or otherwise, we can get into a state where the a window is
1314 // set as the |mouse_pressed_handler_| in window_event_dispatcher.cc 1313 // set as the |mouse_pressed_handler_| in window_event_dispatcher.cc
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 if (linux_ui) { 1820 if (linux_ui) {
1822 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 1821 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
1823 if (native_theme) 1822 if (native_theme)
1824 return native_theme; 1823 return native_theme;
1825 } 1824 }
1826 1825
1827 return ui::NativeTheme::instance(); 1826 return ui::NativeTheme::instance();
1828 } 1827 }
1829 1828
1830 } // namespace views 1829 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698