Commit e597ebee authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

Ease expectation of having move/resize handler.

It is not guaranteed that move/resize handler is set by a
PlatformWindow. Thus, remove the DCHECK and add if (handler_)
condition as part of the existing condition to dispatch move/resize
requests.

Bug: 990756
Change-Id: Ibfa1251f65af547382f04d44fdef28d620c0bdd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807311Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#697919}
parent 6775621a
...@@ -25,9 +25,7 @@ namespace views { ...@@ -25,9 +25,7 @@ namespace views {
WindowEventFilterLinux::WindowEventFilterLinux( WindowEventFilterLinux::WindowEventFilterLinux(
DesktopWindowTreeHost* window_tree_host, DesktopWindowTreeHost* window_tree_host,
ui::WmMoveResizeHandler* handler) ui::WmMoveResizeHandler* handler)
: window_tree_host_(window_tree_host), handler_(handler) { : window_tree_host_(window_tree_host), handler_(handler) {}
DCHECK(handler_);
}
WindowEventFilterLinux::~WindowEventFilterLinux() = default; WindowEventFilterLinux::~WindowEventFilterLinux() = default;
...@@ -154,7 +152,8 @@ void WindowEventFilterLinux::LowerWindow() {} ...@@ -154,7 +152,8 @@ void WindowEventFilterLinux::LowerWindow() {}
void WindowEventFilterLinux::MaybeDispatchHostWindowDragMovement( void WindowEventFilterLinux::MaybeDispatchHostWindowDragMovement(
int hittest, int hittest,
ui::MouseEvent* event) { ui::MouseEvent* event) {
if (event->IsLeftMouseButton() && ui::CanPerformDragOrResize(hittest)) { if (handler_ && event->IsLeftMouseButton() &&
ui::CanPerformDragOrResize(hittest)) {
// Some platforms (eg X11) may require last pointer location not in the // Some platforms (eg X11) may require last pointer location not in the
// local surface coordinates, but rather in the screen coordinates for // local surface coordinates, but rather in the screen coordinates for
// interactive move/resize. // interactive move/resize.
......
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