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

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

Issue 821803002: Use XGrabPointer instead of XChangeActivatePointerGrab() to change the cursor during a pointer grab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_capture
Patch Set: Created 5 years, 11 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
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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 687
688 // It is possible for the DesktopWindowTreeHostX11 to be destroyed during the 688 // It is possible for the DesktopWindowTreeHostX11 to be destroyed during the
689 // move loop, which would also destroy this drag-client. So keep track of 689 // move loop, which would also destroy this drag-client. So keep track of
690 // whether it is alive after the drag ends. 690 // whether it is alive after the drag ends.
691 base::WeakPtr<DesktopDragDropClientAuraX11> alive( 691 base::WeakPtr<DesktopDragDropClientAuraX11> alive(
692 weak_ptr_factory_.GetWeakPtr()); 692 weak_ptr_factory_.GetWeakPtr());
693 693
694 // Windows has a specific method, DoDragDrop(), which performs the entire 694 // Windows has a specific method, DoDragDrop(), which performs the entire
695 // drag. We have to emulate this, so we spin off a nested runloop which will 695 // drag. We have to emulate this, so we spin off a nested runloop which will
696 // track all cursor movement and reroute events to a specific handler. 696 // track all cursor movement and reroute events to a specific handler.
697 move_loop_->RunMoveLoop( 697 move_loop_->RunMoveLoop(source_window);
698 source_window, 698 move_loop_->UpdateCursor(
pkotwicz 2015/01/16 21:37:53 I wrote a new CL because this is wrong. The Update
699 cursor_manager_->GetInitializedCursor(ui::kCursorGrabbing)); 699 cursor_manager_->GetInitializedCursor(ui::kCursorGrabbing));
700 700
701 if (alive) { 701 if (alive) {
702 drag_widget_.reset(); 702 drag_widget_.reset();
703 703
704 source_provider_ = NULL; 704 source_provider_ = NULL;
705 g_current_drag_drop_client = NULL; 705 g_current_drag_drop_client = NULL;
706 drag_operation_ = 0; 706 drag_operation_ = 0;
707 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList")); 707 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList"));
708 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0)); 708 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0));
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 for (int x = 0; x < in_bitmap->width(); ++x) { 1192 for (int x = 0; x < in_bitmap->width(); ++x) {
1193 if (SkColorGetA(in_row[x]) > kMinAlpha) 1193 if (SkColorGetA(in_row[x]) > kMinAlpha)
1194 return true; 1194 return true;
1195 } 1195 }
1196 } 1196 }
1197 1197
1198 return false; 1198 return false;
1199 } 1199 }
1200 1200
1201 } // namespace views 1201 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698