OLD | NEW |
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_drag_drop_client_aurax11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 | 8 |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "ui/aura/client/drag_drop_client.h" | 11 #include "ui/aura/client/drag_drop_client.h" |
12 #include "ui/aura/client/drag_drop_delegate.h" | 12 #include "ui/aura/client/drag_drop_delegate.h" |
13 #include "ui/aura/root_window.h" | 13 #include "ui/aura/root_window.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/base/dragdrop/drag_drop_types.h" | 15 #include "ui/base/dragdrop/drag_drop_types.h" |
16 #include "ui/base/dragdrop/os_exchange_data.h" | 16 #include "ui/base/dragdrop/os_exchange_data.h" |
17 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" | 17 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" |
18 #include "ui/base/events/event.h" | 18 #include "ui/base/events/event.h" |
19 #include "ui/base/x/selection_utils.h" | 19 #include "ui/base/x/selection_utils.h" |
20 #include "ui/base/x/x11_util.h" | 20 #include "ui/base/x/x11_util.h" |
21 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" | 21 #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" |
22 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h" | |
23 | 22 |
24 using aura::client::DragDropDelegate; | 23 using aura::client::DragDropDelegate; |
25 using ui::OSExchangeData; | 24 using ui::OSExchangeData; |
26 | 25 |
27 namespace { | 26 namespace { |
28 | 27 |
29 const int kMinXdndVersion = 5; | 28 const int kMinXdndVersion = 5; |
30 | 29 |
31 const int kWillAcceptDrop = 1; | 30 const int kWillAcceptDrop = 1; |
32 const int kWantFurtherPosEvents = 2; | 31 const int kWantFurtherPosEvents = 2; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (event->type == PropertyNotify && | 359 if (event->type == PropertyNotify && |
361 event->xproperty.atom == atom_cache_->GetAtom("XdndActionList")) { | 360 event->xproperty.atom == atom_cache_->GetAtom("XdndActionList")) { |
362 ReadActions(); | 361 ReadActions(); |
363 } | 362 } |
364 return true; | 363 return true; |
365 } | 364 } |
366 | 365 |
367 /////////////////////////////////////////////////////////////////////////////// | 366 /////////////////////////////////////////////////////////////////////////////// |
368 | 367 |
369 DesktopDragDropClientAuraX11::DesktopDragDropClientAuraX11( | 368 DesktopDragDropClientAuraX11::DesktopDragDropClientAuraX11( |
370 views::DesktopRootWindowHostX11* root_window_host, | |
371 aura::RootWindow* root_window, | 369 aura::RootWindow* root_window, |
372 views::DesktopNativeCursorManager* cursor_manager, | 370 views::DesktopNativeCursorManager* cursor_manager, |
373 Display* xdisplay, | 371 Display* xdisplay, |
374 ::Window xwindow) | 372 ::Window xwindow) |
375 : move_loop_(this), | 373 : move_loop_(this), |
376 root_window_host_(root_window_host), | |
377 root_window_(root_window), | 374 root_window_(root_window), |
378 xdisplay_(xdisplay), | 375 xdisplay_(xdisplay), |
379 xwindow_(xwindow), | 376 xwindow_(xwindow), |
380 atom_cache_(xdisplay_, kAtomsToCache), | 377 atom_cache_(xdisplay_, kAtomsToCache), |
381 target_window_(NULL), | 378 target_window_(NULL), |
382 source_provider_(NULL), | 379 source_provider_(NULL), |
383 source_current_window_(None), | 380 source_current_window_(None), |
384 drag_drop_in_progress_(false), | 381 drag_drop_in_progress_(false), |
385 drag_operation_(0), | 382 drag_operation_(0), |
386 resulting_operation_(0), | 383 resulting_operation_(0), |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 // GdkEvent about the failed drag. (And sending this message doesn't appear | 914 // GdkEvent about the failed drag. (And sending this message doesn't appear |
918 // to go through normal xlib machinery, but instead passes through the low | 915 // to go through normal xlib machinery, but instead passes through the low |
919 // level xProto (the x11 wire format) that I don't understand. | 916 // level xProto (the x11 wire format) that I don't understand. |
920 // | 917 // |
921 // I'm unsure if I have to jump through those hoops, or if XSendEvent is | 918 // I'm unsure if I have to jump through those hoops, or if XSendEvent is |
922 // sufficient. | 919 // sufficient. |
923 XSendEvent(xdisplay_, xid, False, 0, xev); | 920 XSendEvent(xdisplay_, xid, False, 0, xev); |
924 } | 921 } |
925 | 922 |
926 } // namespace views | 923 } // namespace views |
OLD | NEW |