Commit 752b985b authored by Thiemo Nagel's avatar Thiemo Nagel Committed by Commit Bot

Revert "[ozone/x11] Moved the DnD handling from X11WindowOzone to X11Window."

This reverts commit 6cb8f1ee.

Reason for revert: Could this be causing BookmarkBarViewTest22.CloseSourceBrowserDuringDrag failures?

[0602/000817.871182:ERROR:test_launcher.cc(1041)] no test result for BookmarkBarViewTest22.CloseSourceBrowserDuringDrag
[ RUN      ] BookmarkBarViewTest22.CloseSourceBrowserDuringDrag
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  25 (X_SendEvent)
  Resource id in failed request:  0x600010
  Serial number of failed request:  560
  Current serial number in output stream:  563
[144/291] BookmarkBarViewTest22.CloseSourceBrowserDuringDrag (159 ms)

https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests
https://chromium-swarm.appspot.com/task?id=4c8cabe25bd9e510#BookmarkBarViewTest22.CloseSourceBrowserDuringDrag,WebViewFocusInteractiveTest.Focus_FocusEvent

Original change's description:
> [ozone/x11] Moved the DnD handling from X11WindowOzone to X11Window.
> 
> This CL is the first step that prepares us to get rid of DWTHX11.
> 
> As we proceed with that, at some point we will have to throw off the
> DesktopDragDropClientAuraX11 because it is used by DWTHX11, and migrate
> DnD to DDDCOzone.  As the latter will be used on both Ozone and
> non-Ozone, it needs the X11window to handle DnD.
> 
> Hence this change.  I move the DnD-related code from X11WindowOzone into
> X11Window.
> 
> Change-Id: I682c794d9cfab4b7ad6b6a9b89331526f31d227a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213578
> Reviewed-by: Maksim Sisov <msisov@igalia.com>
> Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
> Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#774026}

TBR=thomasanderson@chromium.org,msisov@igalia.com,adunaev@igalia.com

Change-Id: I2d5147265dab2e820bcb5467530df280f0bf1823
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2223945Reviewed-by: default avatarThiemo Nagel <tnagel@chromium.org>
Commit-Queue: Thiemo Nagel <tnagel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774063}
parent e13b8e26
...@@ -481,7 +481,7 @@ jumbo_component("base") { ...@@ -481,7 +481,7 @@ jumbo_component("base") {
deps += [ "//ui/events" ] deps += [ "//ui/events" ]
} }
if ((is_desktop_linux || is_chromeos) && (use_x11 || ozone_platform_x11)) { if (is_desktop_linux && (use_x11 || ozone_platform_x11)) {
public_deps += [ "//ui/base/x" ] public_deps += [ "//ui/base/x" ]
# X11 drag and drop wants to use common drag and drop types. # X11 drag and drop wants to use common drag and drop types.
......
...@@ -46,7 +46,7 @@ jumbo_component("x") { ...@@ -46,7 +46,7 @@ jumbo_component("x") {
"x11_workspace_handler.h", "x11_workspace_handler.h",
] ]
if (is_desktop_linux || is_chromeos) { if (is_desktop_linux) {
sources += [ sources += [
"selection_owner.cc", "selection_owner.cc",
"selection_owner.h", "selection_owner.h",
......
...@@ -672,7 +672,7 @@ void XDragDropClient::SendXdndDrop(XID dest_window) { ...@@ -672,7 +672,7 @@ void XDragDropClient::SendXdndDrop(XID dest_window) {
void XDragDropClient::EndMoveLoop() { void XDragDropClient::EndMoveLoop() {
StopEndMoveLoopTimer(); StopEndMoveLoopTimer();
delegate_->EndDragLoop(); delegate_->EndMoveLoop();
} }
} // namespace ui } // namespace ui
...@@ -60,8 +60,8 @@ class COMPONENT_EXPORT(UI_BASE_X) XDragDropClient { ...@@ -60,8 +60,8 @@ class COMPONENT_EXPORT(UI_BASE_X) XDragDropClient {
// Drops data at the current location and returns the resulting operation. // Drops data at the current location and returns the resulting operation.
virtual int PerformDrop() = 0; virtual int PerformDrop() = 0;
// Called to end the drag loop that is maintained by the subclass. // Called to end the move loop that is maintained by the subclass.
virtual void EndDragLoop() = 0; virtual void EndMoveLoop() = 0;
protected: protected:
virtual ~Delegate() = default; virtual ~Delegate() = default;
......
...@@ -4,8 +4,19 @@ ...@@ -4,8 +4,19 @@
#include "ui/ozone/platform/x11/x11_window_ozone.h" #include "ui/ozone/platform/x11/x11_window_ozone.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/x/x11_os_exchange_data_provider.h"
#include "ui/base/x/x11_pointer_grab.h"
#include "ui/base/x/x11_topmost_window_finder.h"
#include "ui/events/event.h"
#include "ui/events/platform/scoped_event_dispatcher.h"
#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/events/x/x11_window_event_manager.h"
#include "ui/ozone/platform/x11/x11_cursor_ozone.h" #include "ui/ozone/platform/x11/x11_cursor_ozone.h"
#include "ui/platform_window/platform_window_delegate.h" #include "ui/platform_window/platform_window_delegate.h"
#include "ui/platform_window/platform_window_handler/wm_drop_handler.h"
#include "ui/platform_window/x11/x11_topmost_window_finder.h"
#include "ui/platform_window/x11/x11_window_manager.h"
namespace ui { namespace ui {
...@@ -19,4 +30,129 @@ void X11WindowOzone::SetCursor(PlatformCursor cursor) { ...@@ -19,4 +30,129 @@ void X11WindowOzone::SetCursor(PlatformCursor cursor) {
XWindow::SetCursor(cursor_ozone->xcursor()); XWindow::SetCursor(cursor_ozone->xcursor());
} }
void X11WindowOzone::Initialize(PlatformWindowInitProperties properties) {
X11Window::Initialize(std::move(properties));
// Set a class property key that allows |this| to be used for drag action.
SetWmDragHandler(this, this);
drag_drop_client_ =
std::make_unique<XDragDropClient>(this, display(), window());
}
void X11WindowOzone::StartDrag(const ui::OSExchangeData& data,
int operation,
gfx::NativeCursor cursor,
base::OnceCallback<void(int)> callback) {
DCHECK(drag_drop_client_);
end_drag_callback_ = std::move(callback);
drag_drop_client_->InitDrag(operation, &data);
SetCapture();
dragging_ = true;
}
std::unique_ptr<ui::XTopmostWindowFinder> X11WindowOzone::CreateWindowFinder() {
return std::make_unique<X11TopmostWindowFinder>();
}
int X11WindowOzone::UpdateDrag(const gfx::Point& screen_point) {
WmDropHandler* drop_handler = GetWmDropHandler(*this);
if (!drop_handler)
return ui::DragDropTypes::DRAG_NONE;
// TODO: calculate the appropriate drag operation here.
return drop_handler->OnDragMotion(gfx::PointF(screen_point),
ui::DragDropTypes::DRAG_COPY);
}
void X11WindowOzone::UpdateCursor(
ui::DragDropTypes::DragOperation negotiated_operation) {
NOTIMPLEMENTED_LOG_ONCE();
}
void X11WindowOzone::OnBeginForeignDrag(XID window) {
NOTIMPLEMENTED_LOG_ONCE();
}
void X11WindowOzone::OnEndForeignDrag() {
NOTIMPLEMENTED_LOG_ONCE();
}
void X11WindowOzone::OnBeforeDragLeave() {
NOTIMPLEMENTED_LOG_ONCE();
}
int X11WindowOzone::PerformDrop() {
WmDropHandler* drop_handler = GetWmDropHandler(*this);
if (!drop_handler)
return ui::DragDropTypes::DRAG_NONE;
DCHECK(drag_drop_client_);
auto* target_current_context = drag_drop_client_->target_current_context();
DCHECK(target_current_context);
int drag_operation = ui::DragDropTypes::DRAG_NONE;
drop_handler->OnDragDrop(std::make_unique<ui::OSExchangeData>(
std::make_unique<ui::XOSExchangeDataProvider>(
drag_drop_client_->xwindow(),
target_current_context->fetched_targets())));
return drag_operation;
}
void X11WindowOzone::EndMoveLoop() {
std::move(end_drag_callback_).Run(0);
}
bool X11WindowOzone::DispatchDraggingUiEvent(ui::Event* event) {
// Drag and drop have a priority over other processing.
if (dragging_) {
DCHECK(drag_drop_client_);
switch (event->type()) {
case ui::ET_MOUSE_MOVED:
case ui::ET_MOUSE_DRAGGED: {
drag_drop_client_->HandleMouseMovement(
event->AsLocatedEvent()->root_location(),
event->AsMouseEvent()->flags(),
event->AsMouseEvent()->time_stamp());
return true;
}
case ui::ET_MOUSE_RELEASED:
if (!event->AsMouseEvent()->IsLeftMouseButton())
break;
// Assume that drags are being done with the left mouse button. Only
// break the drag if the left mouse button was released.
drag_drop_client_->HandleMouseReleased();
dragging_ = false;
ReleaseCapture();
return true;
case ui::ET_KEY_PRESSED:
if (event->AsKeyEvent()->key_code() != ui::VKEY_ESCAPE)
break;
EndMoveLoop();
drag_drop_client_->HandleMoveLoopEnded();
dragging_ = false;
ReleaseCapture();
return true;
default:
break;
}
}
return false;
}
void X11WindowOzone::OnXWindowSelectionEvent(XEvent* xev) {
X11Window::OnXWindowSelectionEvent(xev);
DCHECK(drag_drop_client_);
drag_drop_client_->OnSelectionNotify(xev->xselection);
}
void X11WindowOzone::OnXWindowDragDropEvent(XEvent* xev) {
X11Window::OnXWindowDragDropEvent(xev);
DCHECK(drag_drop_client_);
drag_drop_client_->HandleXdndEvent(xev->xclient);
}
} // namespace ui } // namespace ui
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef UI_OZONE_PLATFORM_X11_X11_WINDOW_OZONE_H_ #ifndef UI_OZONE_PLATFORM_X11_X11_WINDOW_OZONE_H_
#define UI_OZONE_PLATFORM_X11_X11_WINDOW_OZONE_H_ #define UI_OZONE_PLATFORM_X11_X11_WINDOW_OZONE_H_
#include "ui/base/x/x11_drag_drop_client.h"
#include "ui/platform_window/platform_window_handler/wm_drag_handler.h"
#include "ui/platform_window/x11/x11_window.h" #include "ui/platform_window/x11/x11_window.h"
namespace ui { namespace ui {
...@@ -13,7 +15,9 @@ class PlatformWindowDelegate; ...@@ -13,7 +15,9 @@ class PlatformWindowDelegate;
// PlatformWindow implementation for non-ChromeOS X11 Ozone. // PlatformWindow implementation for non-ChromeOS X11 Ozone.
// PlatformEvents are ui::Events. // PlatformEvents are ui::Events.
class X11WindowOzone : public X11Window { class X11WindowOzone : public X11Window,
public WmDragHandler,
public XDragDropClient::Delegate {
public: public:
explicit X11WindowOzone(PlatformWindowDelegate* delegate); explicit X11WindowOzone(PlatformWindowDelegate* delegate);
~X11WindowOzone() override; ~X11WindowOzone() override;
...@@ -23,6 +27,38 @@ class X11WindowOzone : public X11Window { ...@@ -23,6 +27,38 @@ class X11WindowOzone : public X11Window {
// Overridden from PlatformWindow: // Overridden from PlatformWindow:
void SetCursor(PlatformCursor cursor) override; void SetCursor(PlatformCursor cursor) override;
// Overridden from X11Window:
void Initialize(PlatformWindowInitProperties properties) override;
private:
// WmDragHandler
void StartDrag(const ui::OSExchangeData& data,
int operation,
gfx::NativeCursor cursor,
base::OnceCallback<void(int)> callback) override;
// ui::XDragDropClient::Delegate
std::unique_ptr<ui::XTopmostWindowFinder> CreateWindowFinder() override;
int UpdateDrag(const gfx::Point& screen_point) override;
void UpdateCursor(
ui::DragDropTypes::DragOperation negotiated_operation) override;
void OnBeginForeignDrag(XID window) override;
void OnEndForeignDrag() override;
void OnBeforeDragLeave() override;
int PerformDrop() override;
void EndMoveLoop() override;
// X11Window:
bool DispatchDraggingUiEvent(ui::Event* event) override;
void OnXWindowSelectionEvent(XEvent* xev) override;
void OnXWindowDragDropEvent(XEvent* xev) override;
// True while the drag initiated in this window is in progress.
bool dragging_ = false;
std::unique_ptr<XDragDropClient> drag_drop_client_;
base::OnceCallback<void(int)> end_drag_callback_;
}; };
} // namespace ui } // namespace ui
......
...@@ -7,10 +7,7 @@ ...@@ -7,10 +7,7 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "ui/base/buildflags.h" #include "ui/base/buildflags.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/x/x11_desktop_window_move_client.h" #include "ui/base/x/x11_desktop_window_move_client.h"
#include "ui/base/x/x11_pointer_grab.h"
#include "ui/base/x/x11_topmost_window_finder.h"
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_util_internal.h" #include "ui/base/x/x11_util_internal.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
...@@ -24,15 +21,10 @@ ...@@ -24,15 +21,10 @@
#include "ui/platform_window/common/platform_window_defaults.h" #include "ui/platform_window/common/platform_window_defaults.h"
#include "ui/platform_window/extensions/workspace_extension_delegate.h" #include "ui/platform_window/extensions/workspace_extension_delegate.h"
#include "ui/platform_window/extensions/x11_extension_delegate.h" #include "ui/platform_window/extensions/x11_extension_delegate.h"
#include "ui/platform_window/platform_window_handler/wm_drop_handler.h"
#include "ui/platform_window/x11/x11_topmost_window_finder.h"
#include "ui/platform_window/x11/x11_window_manager.h" #include "ui/platform_window/x11/x11_window_manager.h"
#if defined(USE_OZONE) #if defined(USE_OZONE)
#include "ui/base/x/x11_os_exchange_data_provider.h"
#include "ui/events/ozone/events_ozone.h" #include "ui/events/ozone/events_ozone.h"
#else
#include "ui/base/dragdrop/os_exchange_data_provider_x11.h"
#endif // defined(USE_OZONE) #endif // defined(USE_OZONE)
#if BUILDFLAG(USE_ATK) #if BUILDFLAG(USE_ATK)
...@@ -143,11 +135,6 @@ void X11Window::Initialize(PlatformWindowInitProperties properties) { ...@@ -143,11 +135,6 @@ void X11Window::Initialize(PlatformWindowInitProperties properties) {
x11_extension_delegate_ = properties.x11_extension_delegate; x11_extension_delegate_ = properties.x11_extension_delegate;
Init(config); Init(config);
SetWmDragHandler(this, this);
drag_drop_client_ =
std::make_unique<XDragDropClient>(this, display(), window());
} }
void X11Window::SetXEventDelegate(XEventDelegate* delegate) { void X11Window::SetXEventDelegate(XEventDelegate* delegate) {
...@@ -654,6 +641,10 @@ void X11Window::OnXWindowCreated() { ...@@ -654,6 +641,10 @@ void X11Window::OnXWindowCreated() {
platform_window_delegate_->OnAcceleratedWidgetAvailable(GetWidget()); platform_window_delegate_->OnAcceleratedWidgetAvailable(GetWidget());
} }
bool X11Window::DispatchDraggingUiEvent(ui::Event* event) {
return false;
}
void X11Window::OnXWindowStateChanged() { void X11Window::OnXWindowStateChanged() {
// Determine the new window state information to be propagated to the client. // Determine the new window state information to be propagated to the client.
// Note that the order of checks is important here, because window can have // Note that the order of checks is important here, because window can have
...@@ -741,15 +732,11 @@ void X11Window::OnXWindowLostPointerGrab() { ...@@ -741,15 +732,11 @@ void X11Window::OnXWindowLostPointerGrab() {
void X11Window::OnXWindowSelectionEvent(XEvent* xev) { void X11Window::OnXWindowSelectionEvent(XEvent* xev) {
if (x_event_delegate_) if (x_event_delegate_)
x_event_delegate_->OnXWindowSelectionEvent(xev); x_event_delegate_->OnXWindowSelectionEvent(xev);
DCHECK(drag_drop_client_);
drag_drop_client_->OnSelectionNotify(xev->xselection);
} }
void X11Window::OnXWindowDragDropEvent(XEvent* xev) { void X11Window::OnXWindowDragDropEvent(XEvent* xev) {
if (x_event_delegate_) if (x_event_delegate_)
x_event_delegate_->OnXWindowDragDropEvent(xev); x_event_delegate_->OnXWindowDragDropEvent(xev);
DCHECK(drag_drop_client_);
drag_drop_client_->HandleXdndEvent(xev->xclient);
} }
base::Optional<gfx::Size> X11Window::GetMinimumSizeForXWindow() { base::Optional<gfx::Size> X11Window::GetMinimumSizeForXWindow() {
...@@ -780,117 +767,6 @@ void X11Window::EndMoveLoop() { ...@@ -780,117 +767,6 @@ void X11Window::EndMoveLoop() {
x11_window_move_client_->EndMoveLoop(); x11_window_move_client_->EndMoveLoop();
} }
void X11Window::StartDrag(const OSExchangeData& data,
int operation,
gfx::NativeCursor cursor,
base::OnceCallback<void(int)> callback) {
DCHECK(drag_drop_client_);
end_drag_callback_ = std::move(callback);
drag_drop_client_->InitDrag(operation, &data);
SetCapture();
dragging_ = true;
}
std::unique_ptr<XTopmostWindowFinder> X11Window::CreateWindowFinder() {
return std::make_unique<X11TopmostWindowFinder>();
}
int X11Window::UpdateDrag(const gfx::Point& screen_point) {
WmDropHandler* drop_handler = GetWmDropHandler(*this);
if (!drop_handler)
return DragDropTypes::DRAG_NONE;
// TODO: calculate the appropriate drag operation here.
return drop_handler->OnDragMotion(gfx::PointF(screen_point),
DragDropTypes::DRAG_COPY);
}
void X11Window::UpdateCursor(
DragDropTypes::DragOperation negotiated_operation) {
NOTIMPLEMENTED_LOG_ONCE();
}
void X11Window::OnBeginForeignDrag(XID window) {
NOTIMPLEMENTED_LOG_ONCE();
}
void X11Window::OnEndForeignDrag() {
NOTIMPLEMENTED_LOG_ONCE();
}
void X11Window::OnBeforeDragLeave() {
NOTIMPLEMENTED_LOG_ONCE();
}
int X11Window::PerformDrop() {
WmDropHandler* drop_handler = GetWmDropHandler(*this);
if (!drop_handler)
return DragDropTypes::DRAG_NONE;
DCHECK(drag_drop_client_);
auto* target_current_context = drag_drop_client_->target_current_context();
DCHECK(target_current_context);
int drag_operation = DragDropTypes::DRAG_NONE;
#if defined(USE_OZONE)
drop_handler->OnDragDrop(std::make_unique<OSExchangeData>(
std::make_unique<XOSExchangeDataProvider>(
drag_drop_client_->xwindow(),
target_current_context->fetched_targets())));
#else
drop_handler->OnDragDrop(std::make_unique<OSExchangeData>(
std::make_unique<OSExchangeDataProviderX11>(
drag_drop_client_->xwindow(),
target_current_context->fetched_targets())));
#endif
return drag_operation;
}
void X11Window::EndDragLoop() {
std::move(end_drag_callback_).Run(0);
}
bool X11Window::DispatchDraggingUiEvent(Event* event) {
// Drag and drop have a priority over other processing.
if (dragging_) {
DCHECK(drag_drop_client_);
switch (event->type()) {
case ET_MOUSE_MOVED:
case ET_MOUSE_DRAGGED: {
drag_drop_client_->HandleMouseMovement(
event->AsLocatedEvent()->root_location(),
event->AsMouseEvent()->flags(),
event->AsMouseEvent()->time_stamp());
return true;
}
case ET_MOUSE_RELEASED:
if (!event->AsMouseEvent()->IsLeftMouseButton())
break;
// Assume that drags are being done with the left mouse button. Only
// break the drag if the left mouse button was released.
drag_drop_client_->HandleMouseReleased();
dragging_ = false;
ReleaseCapture();
return true;
case ET_KEY_PRESSED:
if (event->AsKeyEvent()->key_code() != VKEY_ESCAPE)
break;
EndMoveLoop();
drag_drop_client_->HandleMoveLoopEnded();
dragging_ = false;
ReleaseCapture();
return true;
default:
break;
}
}
return false;
}
gfx::Size X11Window::AdjustSizeForDisplay( gfx::Size X11Window::AdjustSizeForDisplay(
const gfx::Size& requested_size_in_pixels) { const gfx::Size& requested_size_in_pixels) {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
...@@ -920,7 +796,7 @@ gfx::Size X11Window::AdjustSizeForDisplay( ...@@ -920,7 +796,7 @@ gfx::Size X11Window::AdjustSizeForDisplay(
void X11Window::ConvertEventLocationToTargetLocation( void X11Window::ConvertEventLocationToTargetLocation(
const gfx::Rect& target_window_bounds, const gfx::Rect& target_window_bounds,
const gfx::Rect& current_window_bounds, const gfx::Rect& current_window_bounds,
LocatedEvent* located_event) { ui::LocatedEvent* located_event) {
// TODO(msisov): for ozone, we need to access PlatformScreen instead and get // TODO(msisov): for ozone, we need to access PlatformScreen instead and get
// the displays. // the displays.
auto* display = display::Screen::GetScreen(); auto* display = display::Screen::GetScreen();
......
...@@ -6,14 +6,12 @@ ...@@ -6,14 +6,12 @@
#define UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_ #define UI_PLATFORM_WINDOW_X11_X11_WINDOW_H_
#include "base/macros.h" #include "base/macros.h"
#include "ui/base/x/x11_drag_drop_client.h"
#include "ui/base/x/x11_window.h" #include "ui/base/x/x11_window.h"
#include "ui/events/platform/platform_event_dispatcher.h" #include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/events/platform/x11/x11_event_source.h" #include "ui/events/platform/x11/x11_event_source.h"
#include "ui/platform_window/extensions/workspace_extension.h" #include "ui/platform_window/extensions/workspace_extension.h"
#include "ui/platform_window/extensions/x11_extension.h" #include "ui/platform_window/extensions/x11_extension.h"
#include "ui/platform_window/platform_window.h" #include "ui/platform_window/platform_window.h"
#include "ui/platform_window/platform_window_handler/wm_drag_handler.h"
#include "ui/platform_window/platform_window_handler/wm_move_loop_handler.h" #include "ui/platform_window/platform_window_handler/wm_move_loop_handler.h"
#include "ui/platform_window/platform_window_handler/wm_move_resize_handler.h" #include "ui/platform_window/platform_window_handler/wm_move_resize_handler.h"
#include "ui/platform_window/platform_window_init_properties.h" #include "ui/platform_window/platform_window_init_properties.h"
...@@ -21,7 +19,6 @@ ...@@ -21,7 +19,6 @@
namespace ui { namespace ui {
class PlatformWindowDelegate;
class X11ExtensionDelegate; class X11ExtensionDelegate;
class X11DesktopWindowMoveClient; class X11DesktopWindowMoveClient;
class LocatedEvent; class LocatedEvent;
...@@ -47,9 +44,7 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow, ...@@ -47,9 +44,7 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
public XEventDispatcher, public XEventDispatcher,
public WorkspaceExtension, public WorkspaceExtension,
public X11Extension, public X11Extension,
public WmMoveLoopHandler, public WmMoveLoopHandler {
public WmDragHandler,
public XDragDropClient::Delegate {
public: public:
explicit X11Window(PlatformWindowDelegate* platform_window_delegate); explicit X11Window(PlatformWindowDelegate* platform_window_delegate);
~X11Window() override; ~X11Window() override;
...@@ -173,23 +168,6 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow, ...@@ -173,23 +168,6 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
bool RunMoveLoop(const gfx::Vector2d& drag_offset) override; bool RunMoveLoop(const gfx::Vector2d& drag_offset) override;
void EndMoveLoop() override; void EndMoveLoop() override;
// WmDragHandler
void StartDrag(const ui::OSExchangeData& data,
int operation,
gfx::NativeCursor cursor,
base::OnceCallback<void(int)> callback) override;
// ui::XDragDropClient::Delegate
std::unique_ptr<ui::XTopmostWindowFinder> CreateWindowFinder() override;
int UpdateDrag(const gfx::Point& screen_point) override;
void UpdateCursor(
ui::DragDropTypes::DragOperation negotiated_operation) override;
void OnBeginForeignDrag(XID window) override;
void OnEndForeignDrag() override;
void OnBeforeDragLeave() override;
int PerformDrop() override;
void EndDragLoop() override;
// Handles |xevent| as a Atk Key Event // Handles |xevent| as a Atk Key Event
bool HandleAsAtkEvent(XEvent* xevent); bool HandleAsAtkEvent(XEvent* xevent);
...@@ -233,14 +211,6 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow, ...@@ -233,14 +211,6 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
std::unique_ptr<X11DesktopWindowMoveClient> x11_window_move_client_; std::unique_ptr<X11DesktopWindowMoveClient> x11_window_move_client_;
// True while the drag initiated in this window is in progress.
bool dragging_ = false;
// Called after the drag operation started in this window has completed.
base::OnceCallback<void(int)> end_drag_callback_;
// Handles XDND events going through this window.
std::unique_ptr<XDragDropClient> drag_drop_client_;
DISALLOW_COPY_AND_ASSIGN(X11Window); DISALLOW_COPY_AND_ASSIGN(X11Window);
}; };
......
...@@ -426,7 +426,7 @@ int DesktopDragDropClientAuraX11::PerformDrop() { ...@@ -426,7 +426,7 @@ int DesktopDragDropClientAuraX11::PerformDrop() {
return drag_operation; return drag_operation;
} }
void DesktopDragDropClientAuraX11::EndDragLoop() { void DesktopDragDropClientAuraX11::EndMoveLoop() {
move_loop_->EndMoveLoop(); move_loop_->EndMoveLoop();
} }
......
...@@ -122,7 +122,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11 ...@@ -122,7 +122,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
void OnEndForeignDrag() override; void OnEndForeignDrag() override;
void OnBeforeDragLeave() override; void OnBeforeDragLeave() override;
int PerformDrop() override; int PerformDrop() override;
void EndDragLoop() override; void EndMoveLoop() override;
// A nested run loop that notifies this object of events through the // A nested run loop that notifies this object of events through the
// ui::X11MoveLoopDelegate interface. // ui::X11MoveLoopDelegate interface.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment