| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 xev.xclient.window = source_window; | 614 xev.xclient.window = source_window; |
| 615 xev.xclient.data.l[0] = xwindow_; | 615 xev.xclient.data.l[0] = xwindow_; |
| 616 xev.xclient.data.l[1] = (drag_operation != 0) ? 1 : 0; | 616 xev.xclient.data.l[1] = (drag_operation != 0) ? 1 : 0; |
| 617 xev.xclient.data.l[2] = DragOperationToAtom(drag_operation); | 617 xev.xclient.data.l[2] = DragOperationToAtom(drag_operation); |
| 618 | 618 |
| 619 SendXClientEvent(source_window, &xev); | 619 SendXClientEvent(source_window, &xev); |
| 620 } | 620 } |
| 621 | 621 |
| 622 void DesktopDragDropClientAuraX11::OnSelectionNotify( | 622 void DesktopDragDropClientAuraX11::OnSelectionNotify( |
| 623 const XSelectionEvent& xselection) { | 623 const XSelectionEvent& xselection) { |
| 624 if (!target_current_context_) { | 624 if (target_current_context_) |
| 625 NOTIMPLEMENTED(); | 625 target_current_context_->OnSelectionNotify(xselection); |
| 626 return; | |
| 627 } | |
| 628 | 626 |
| 629 target_current_context_->OnSelectionNotify(xselection); | 627 // ICCCM requires us to delete the property passed into SelectionNotify. |
| 628 if (xselection.property != None) |
| 629 XDeleteProperty(xdisplay_, xwindow_, xselection.property); |
| 630 } | 630 } |
| 631 | 631 |
| 632 int DesktopDragDropClientAuraX11::StartDragAndDrop( | 632 int DesktopDragDropClientAuraX11::StartDragAndDrop( |
| 633 const ui::OSExchangeData& data, | 633 const ui::OSExchangeData& data, |
| 634 aura::Window* root_window, | 634 aura::Window* root_window, |
| 635 aura::Window* source_window, | 635 aura::Window* source_window, |
| 636 const gfx::Point& root_location, | 636 const gfx::Point& root_location, |
| 637 int operation, | 637 int operation, |
| 638 ui::DragDropTypes::DragEventSource source) { | 638 ui::DragDropTypes::DragEventSource source) { |
| 639 source_current_window_ = None; | 639 source_current_window_ = None; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 // GdkEvent about the failed drag. (And sending this message doesn't appear | 1044 // GdkEvent about the failed drag. (And sending this message doesn't appear |
| 1045 // to go through normal xlib machinery, but instead passes through the low | 1045 // to go through normal xlib machinery, but instead passes through the low |
| 1046 // level xProto (the x11 wire format) that I don't understand. | 1046 // level xProto (the x11 wire format) that I don't understand. |
| 1047 // | 1047 // |
| 1048 // I'm unsure if I have to jump through those hoops, or if XSendEvent is | 1048 // I'm unsure if I have to jump through those hoops, or if XSendEvent is |
| 1049 // sufficient. | 1049 // sufficient. |
| 1050 XSendEvent(xdisplay_, xid, False, 0, xev); | 1050 XSendEvent(xdisplay_, xid, False, 0, xev); |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 } // namespace views | 1053 } // namespace views |
| OLD | NEW |