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

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

Issue 181013011: Fix Linux Aura drag-and-drop cancellation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert BookmarkBarView changes; remove NotifyDragLeave call. Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 675 }
676 676
677 SendXdndLeave(source_current_window_); 677 SendXdndLeave(source_current_window_);
678 source_current_window_ = None; 678 source_current_window_ = None;
679 } 679 }
680 680
681 move_loop_.EndMoveLoop(); 681 move_loop_.EndMoveLoop();
682 } 682 }
683 683
684 void DesktopDragDropClientAuraX11::OnMoveLoopEnded() { 684 void DesktopDragDropClientAuraX11::OnMoveLoopEnded() {
685 if (source_current_window_ != None)
686 SendXdndLeave(source_current_window_);
685 target_current_context_.reset(); 687 target_current_context_.reset();
686 } 688 }
687 689
688 void DesktopDragDropClientAuraX11::DragTranslate( 690 void DesktopDragDropClientAuraX11::DragTranslate(
689 const gfx::Point& root_window_location, 691 const gfx::Point& root_window_location,
690 scoped_ptr<ui::OSExchangeData>* data, 692 scoped_ptr<ui::OSExchangeData>* data,
691 scoped_ptr<ui::DropTargetEvent>* event, 693 scoped_ptr<ui::DropTargetEvent>* event,
692 aura::client::DragDropDelegate** delegate) { 694 aura::client::DragDropDelegate** delegate) {
693 gfx::Point root_location = root_window_location; 695 gfx::Point root_location = root_window_location;
694 root_window_->GetHost()->ConvertPointFromNativeScreen( 696 root_window_->GetHost()->ConvertPointFromNativeScreen(&root_location);
695 &root_location);
696 aura::Window* target_window = 697 aura::Window* target_window =
697 root_window_->GetEventHandlerForPoint(root_location); 698 root_window_->GetEventHandlerForPoint(root_location);
698 bool target_window_changed = false; 699 bool target_window_changed = false;
699 if (target_window != target_window_) { 700 if (target_window != target_window_) {
700 if (target_window_) 701 if (target_window_)
701 NotifyDragLeave(); 702 NotifyDragLeave();
702 target_window_ = target_window; 703 target_window_ = target_window;
703 if (target_window_) 704 if (target_window_)
704 target_window_->AddObserver(this); 705 target_window_->AddObserver(this);
705 target_window_changed = true; 706 target_window_changed = true;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 // GdkEvent about the failed drag. (And sending this message doesn't appear 926 // GdkEvent about the failed drag. (And sending this message doesn't appear
926 // to go through normal xlib machinery, but instead passes through the low 927 // to go through normal xlib machinery, but instead passes through the low
927 // level xProto (the x11 wire format) that I don't understand. 928 // level xProto (the x11 wire format) that I don't understand.
928 // 929 //
929 // I'm unsure if I have to jump through those hoops, or if XSendEvent is 930 // I'm unsure if I have to jump through those hoops, or if XSendEvent is
930 // sufficient. 931 // sufficient.
931 XSendEvent(xdisplay_, xid, False, 0, xev); 932 XSendEvent(xdisplay_, xid, False, 0, xev);
932 } 933 }
933 934
934 } // namespace views 935 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698