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 749063003: Fix grabbing capture when the mouse is pressed on Desktop Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 649
650 // It is possible for the DesktopWindowTreeHostX11 to be destroyed during the 650 // It is possible for the DesktopWindowTreeHostX11 to be destroyed during the
651 // move loop, which would also destroy this drag-client. So keep track of 651 // move loop, which would also destroy this drag-client. So keep track of
652 // whether it is alive after the drag ends. 652 // whether it is alive after the drag ends.
653 base::WeakPtr<DesktopDragDropClientAuraX11> alive( 653 base::WeakPtr<DesktopDragDropClientAuraX11> alive(
654 weak_ptr_factory_.GetWeakPtr()); 654 weak_ptr_factory_.GetWeakPtr());
655 655
656 // Windows has a specific method, DoDragDrop(), which performs the entire 656 // Windows has a specific method, DoDragDrop(), which performs the entire
657 // drag. We have to emulate this, so we spin off a nested runloop which will 657 // drag. We have to emulate this, so we spin off a nested runloop which will
658 // track all cursor movement and reroute events to a specific handler. 658 // track all cursor movement and reroute events to a specific handler.
659 move_loop_->RunMoveLoop(source_window, grab_cursor_); 659 move_loop_->RunMoveLoop(source_window);
660 move_loop_->UpdateCursor(grab_cursor_);
660 661
661 if (alive) { 662 if (alive) {
662 drag_widget_.reset(); 663 drag_widget_.reset();
663 664
664 source_provider_ = NULL; 665 source_provider_ = NULL;
665 g_current_drag_drop_client = NULL; 666 g_current_drag_drop_client = NULL;
666 drag_operation_ = 0; 667 drag_operation_ = 0;
667 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList")); 668 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList"));
668 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0)); 669 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0));
669 670
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 for (int x = 0; x < in_bitmap->width(); ++x) { 1141 for (int x = 0; x < in_bitmap->width(); ++x) {
1141 if (SkColorGetA(in_row[x]) > kMinAlpha) 1142 if (SkColorGetA(in_row[x]) > kMinAlpha)
1142 return true; 1143 return true;
1143 } 1144 }
1144 } 1145 }
1145 1146
1146 return false; 1147 return false;
1147 } 1148 }
1148 1149
1149 } // namespace views 1150 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698