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

Unified Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc

Issue 2326223002: Revert of Refactor X11ForeignWindowManager (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_window_event_manager.cc ('k') | ui/views/widget/desktop_aura/x11_desktop_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
index 660c9e85f8a146e5dc63e0b470a2b0d90e946cdf..74c10787dc12e5ed7d74d10de627be97270de6fb 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc
@@ -23,8 +23,8 @@
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
#include "ui/base/x/selection_utils.h"
+#include "ui/base/x/x11_foreign_window_manager.h"
#include "ui/base/x/x11_util.h"
-#include "ui/base/x/x11_window_event_manager.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
@@ -197,12 +197,13 @@
// The XID of the window that's initiated the drag.
unsigned long source_window_;
- // Events that we have selected on |source_window_|.
- std::unique_ptr<ui::XScopedEventSelector> source_window_events_;
-
// The DesktopDragDropClientAuraX11 for |source_window_| if |source_window_|
// belongs to a Chrome window.
DesktopDragDropClientAuraX11* source_client_;
+
+ // Used to unselect PropertyChangeMask on |source_window_| if |source_window_|
+ // does not belong to a Chrome window when X11DragContext is destroyed.
+ int foreign_window_manager_source_window_id_;
// The client we inform once we're done with requesting data.
DesktopDragDropClientAuraX11* drag_drop_client_;
@@ -240,6 +241,7 @@
source_window_(event.data.l[0]),
source_client_(
DesktopDragDropClientAuraX11::GetForWindow(source_window_)),
+ foreign_window_manager_source_window_id_(0),
drag_drop_client_(NULL),
waiting_to_handle_position_(false),
suggested_action_(None) {
@@ -264,8 +266,9 @@
// The window doesn't have a DesktopDragDropClientAuraX11, that means it's
// created by some other process. Listen for messages on it.
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
- source_window_events_.reset(
- new ui::XScopedEventSelector(source_window_, PropertyChangeMask));
+ foreign_window_manager_source_window_id_ =
+ ui::XForeignWindowManager::GetInstance()->RequestEvents(
+ source_window_, PropertyChangeMask);
// We must perform a full sync here because we could be racing
// |source_window_|.
@@ -284,6 +287,8 @@
if (!source_client_) {
// Unsubscribe from message events.
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
+ ui::XForeignWindowManager::GetInstance()->CancelRequest(
+ foreign_window_manager_source_window_id_);
}
}
« no previous file with comments | « ui/base/x/x11_window_event_manager.cc ('k') | ui/views/widget/desktop_aura/x11_desktop_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698