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

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

Issue 83783003: linux aura: Show the drag-image when available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_root_window_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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698