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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 provider); | 580 provider); |
581 | 581 |
582 source_provider_->TakeOwnershipOfSelection(); | 582 source_provider_->TakeOwnershipOfSelection(); |
583 | 583 |
584 std::vector< ::Atom> actions = GetOfferedDragOperations(); | 584 std::vector< ::Atom> actions = GetOfferedDragOperations(); |
585 ui::SetAtomArrayProperty(xwindow_, "XdndActionList", "ATOM", actions); | 585 ui::SetAtomArrayProperty(xwindow_, "XdndActionList", "ATOM", actions); |
586 | 586 |
587 // Windows has a specific method, DoDragDrop(), which performs the entire | 587 // Windows has a specific method, DoDragDrop(), which performs the entire |
588 // drag. We have to emulate this, so we spin off a nested runloop which will | 588 // drag. We have to emulate this, so we spin off a nested runloop which will |
589 // track all cursor movement and reroute events to a specific handler. | 589 // track all cursor movement and reroute events to a specific handler. |
| 590 move_loop_.SetDragImage(source_provider_->GetDragImage(), |
| 591 source_provider_->GetDragImageOffset()); |
590 move_loop_.RunMoveLoop(source_window, grab_cursor_); | 592 move_loop_.RunMoveLoop(source_window, grab_cursor_); |
| 593 move_loop_.SetDragImage(gfx::ImageSkia(), gfx::Vector2dF()); |
591 | 594 |
592 source_provider_ = NULL; | 595 source_provider_ = NULL; |
593 drag_drop_in_progress_ = false; | 596 drag_drop_in_progress_ = false; |
594 drag_operation_ = 0; | 597 drag_operation_ = 0; |
595 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList")); | 598 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList")); |
596 | 599 |
597 return resulting_operation_; | 600 return resulting_operation_; |
598 } | 601 } |
599 | 602 |
600 void DesktopDragDropClientAuraX11::DragUpdate(aura::Window* target, | 603 void DesktopDragDropClientAuraX11::DragUpdate(aura::Window* target, |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 // GdkEvent about the failed drag. (And sending this message doesn't appear | 921 // GdkEvent about the failed drag. (And sending this message doesn't appear |
919 // to go through normal xlib machinery, but instead passes through the low | 922 // to go through normal xlib machinery, but instead passes through the low |
920 // level xProto (the x11 wire format) that I don't understand. | 923 // level xProto (the x11 wire format) that I don't understand. |
921 // | 924 // |
922 // I'm unsure if I have to jump through those hoops, or if XSendEvent is | 925 // I'm unsure if I have to jump through those hoops, or if XSendEvent is |
923 // sufficient. | 926 // sufficient. |
924 XSendEvent(xdisplay_, xid, False, 0, xev); | 927 XSendEvent(xdisplay_, xid, False, 0, xev); |
925 } | 928 } |
926 | 929 |
927 } // namespace views | 930 } // namespace views |
OLD | NEW |