[ozone/wayland] Update pointer position during dragging [chromium/src : main]

0 views
Skip to first unread message

Hidehiko Abe (Gerrit)

unread,
Nov 21, 2025, 7:07:38 AM (10 days ago) Nov 21
to Łukasz Patron, AyeAye, Kramer Ge, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
Attention needed from Kramer Ge and Łukasz Patron

Hidehiko Abe added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Hidehiko Abe . unresolved

Could you add tests?

Open in Gerrit

Related details

Attention is currently required from:
  • Kramer Ge
  • Łukasz Patron
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
Gerrit-Change-Number: 7182320
Gerrit-PatchSet: 2
Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
Gerrit-Attention: Kramer Ge <fang...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Nov 2025 12:07:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Łukasz Patron (Gerrit)

unread,
Nov 21, 2025, 7:33:20 AM (10 days ago) Nov 21
to AyeAye, Hidehiko Abe, Kramer Ge, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
Attention needed from Hidehiko Abe and Kramer Ge

Łukasz Patron voted and added 1 comment

Votes added by Łukasz Patron

Auto-Submit+1

1 comment

Patchset-level comments
File-level comment, Patchset 2:
Hidehiko Abe . resolved

Could you add tests?

Łukasz Patron

yeah, just updated existing one since I broke it.

Open in Gerrit

Related details

Attention is currently required from:
  • Hidehiko Abe
  • Kramer Ge
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
    Gerrit-Change-Number: 7182320
    Gerrit-PatchSet: 2
    Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Fri, 21 Nov 2025 12:33:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Hidehiko Abe <hide...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Łukasz Patron (Gerrit)

    unread,
    Nov 21, 2025, 7:36:19 AM (10 days ago) Nov 21
    to AyeAye, Hidehiko Abe, Kramer Ge, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
    Attention needed from Hidehiko Abe and Kramer Ge

    Łukasz Patron voted and added 1 comment

    Votes added by Łukasz Patron

    Auto-Submit+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 3:
    Łukasz Patron . resolved

    oh it seems like OnPointerMotionEvent() was already handling cursor position update so I removed previous code.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Kramer Ge
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
    Gerrit-Change-Number: 7182320
    Gerrit-PatchSet: 3
    Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
    Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
    Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
    Gerrit-Attention: Kramer Ge <fang...@chromium.org>
    Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
    Gerrit-Comment-Date: Fri, 21 Nov 2025 12:36:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kramer Ge (Gerrit)

    unread,
    Nov 24, 2025, 2:57:47 PM (7 days ago) Nov 24
    to Łukasz Patron, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
    Attention needed from Hidehiko Abe, Nick Yamane and Łukasz Patron

    Kramer Ge voted and added 3 comments

    Votes added by Kramer Ge

    Commit-Queue+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 7 (Latest):
    Kramer Ge . resolved

    Thanks for the CL, +nickdiego@.

    File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
    Line 489, Patchset 7 (Latest): pointer_delegate_->OnPointerMotionEvent(
    location, timestamp, wl::EventDispatchPolicy::kImmediate,
    /*is_synthesized=*/true);
    Kramer Ge . unresolved

    I think this should be called when `pointer_grabber_for_window_drag_` is not null.

    And, IMO it doesn't resolve the underlying issue.
    My observation is that `wl_pointer` leaves the surface when drag begins, and we do not send button release to `pointer_delegate_` unless `pointer_grabber_for_window_drag_`. In this case `pointer_grabber_for_window_drag_` is not null for and we artificially generated a button release for some reason, which seems to be the actual bug.

    +nickdiego

    Line 489, Patchset 7 (Parent): auto* cursor_position = connection_->wayland_cursor_position();
    if (cursor_position) {
    CHECK(window_);
    // TODO(crbug.com/41494257): Once we enable the input region for
    // subsurfaces, we need to update this part since the location will no
    // longer be relative to the window.
    auto location_in_screen =
    gfx::ToRoundedPoint(location) +
    window_->GetBoundsInDIP().origin().OffsetFromOrigin();
    cursor_position->OnCursorPositionChanged(location_in_screen);
    }
    Kramer Ge . unresolved

    I don't think this should be removed as it is used as a source for cursor position elsewhere

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hidehiko Abe
    • Nick Yamane
    • Łukasz Patron
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Mon, 24 Nov 2025 19:57:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Łukasz Patron (Gerrit)

      unread,
      Nov 24, 2025, 3:04:44 PM (7 days ago) Nov 24
      to Chromium LUCI CQ, Nick Yamane, Kramer Ge, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Kramer Ge and Nick Yamane

      Łukasz Patron voted and added 2 comments

      Votes added by Łukasz Patron

      Auto-Submit+1

      2 comments

      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Line 489, Patchset 7 (Latest): pointer_delegate_->OnPointerMotionEvent(
      location, timestamp, wl::EventDispatchPolicy::kImmediate,
      /*is_synthesized=*/true);
      Kramer Ge . unresolved

      I think this should be called when `pointer_grabber_for_window_drag_` is not null.

      And, IMO it doesn't resolve the underlying issue.
      My observation is that `wl_pointer` leaves the surface when drag begins, and we do not send button release to `pointer_delegate_` unless `pointer_grabber_for_window_drag_`. In this case `pointer_grabber_for_window_drag_` is not null for and we artificially generated a button release for some reason, which seems to be the actual bug.

      +nickdiego

      Łukasz Patron

      >we artificially generated a button release for some reason, which seems to be the actual bug.

      if you don't send artificial button release, it'll just leave you in text selection mode after the file drop.

      Line 489, Patchset 7 (Parent): auto* cursor_position = connection_->wayland_cursor_position();
      if (cursor_position) {
      CHECK(window_);
      // TODO(crbug.com/41494257): Once we enable the input region for
      // subsurfaces, we need to update this part since the location will no
      // longer be relative to the window.
      auto location_in_screen =
      gfx::ToRoundedPoint(location) +
      window_->GetBoundsInDIP().origin().OffsetFromOrigin();
      cursor_position->OnCursorPositionChanged(location_in_screen);
      }
      Kramer Ge . resolved

      I don't think this should be removed as it is used as a source for cursor position elsewhere

      Łukasz Patron

      I removed it because OnPointerMotionEvent() does the same already:

      ```
      void WaylandEventSource::OnPointerMotionEvent(
      const gfx::PointF& location,
      base::TimeTicks timestamp,
      wl::EventDispatchPolicy dispatch_policy,
      bool is_synthesized) {
      pointer_location_ = location;
        int flags = pointer_flags_ | keyboard_modifiers_ | tablet_tool_buttons_;
      if (is_synthesized) {
      flags |= EF_IS_SYNTHESIZED;
      }
      MouseEvent event(EventType::kMouseMoved, pointer_location_, pointer_location_,
      timestamp, flags, 0);
      auto* target = window_manager_->GetCurrentPointerFocusedWindow();
        // A window may be deleted when the event arrived from the server.
      if (!target) {
      return;
      }
        if (dispatch_policy == wl::EventDispatchPolicy::kImmediate) {
      SetTargetAndDispatchEvent(&event, target);
      } else {
      pointer_frames_.push_back(
      std::make_unique<FrameData>(event, base::NullCallback()));
      }
      }
      ```

      and tests still passed with it removed, which proved my assumption.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Kramer Ge
      • Nick Yamane
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Kramer Ge <fang...@chromium.org>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Mon, 24 Nov 2025 20:04:32 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Kramer Ge <fang...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kramer Ge (Gerrit)

      unread,
      Nov 24, 2025, 5:27:32 PM (7 days ago) Nov 24
      to Łukasz Patron, Chromium LUCI CQ, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Nick Yamane and Łukasz Patron

      Kramer Ge voted and added 1 comment

      Votes added by Kramer Ge

      Commit-Queue+1

      1 comment

      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Line 489, Patchset 7 (Latest): pointer_delegate_->OnPointerMotionEvent(
      location, timestamp, wl::EventDispatchPolicy::kImmediate,
      /*is_synthesized=*/true);
      Kramer Ge . unresolved

      I think this should be called when `pointer_grabber_for_window_drag_` is not null.

      And, IMO it doesn't resolve the underlying issue.
      My observation is that `wl_pointer` leaves the surface when drag begins, and we do not send button release to `pointer_delegate_` unless `pointer_grabber_for_window_drag_`. In this case `pointer_grabber_for_window_drag_` is not null for and we artificially generated a button release for some reason, which seems to be the actual bug.

      +nickdiego

      Łukasz Patron

      >we artificially generated a button release for some reason, which seems to be the actual bug.

      if you don't send artificial button release, it'll just leave you in text selection mode after the file drop.

      Kramer Ge

      You're right we have to send artificial button release. I was just wondering if the release should be sent targeting the window where pointer isn't in. If drag does not involve data exchange, GNOME always dispatches button release to the same window even if button down and up occurred in 2 different windows. Given that model, location of the event is indeed the problem.

      So it's OK fixing it like this, but motion may be dispatched to the origin window if drag enters a different window. So probably skip `OnPointerMotionEvent` when pointer focused window is not equal to `window_`.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Nick Yamane
      • Łukasz Patron
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Mon, 24 Nov 2025 22:27:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Łukasz Patron <priv...@gmail.com>
      Comment-In-Reply-To: Kramer Ge <fang...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Łukasz Patron (Gerrit)

      unread,
      Nov 24, 2025, 5:39:34 PM (7 days ago) Nov 24
      to Chromium LUCI CQ, Nick Yamane, Kramer Ge, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Kramer Ge and Nick Yamane

      Łukasz Patron added 1 comment

      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Line 489, Patchset 7 (Latest): pointer_delegate_->OnPointerMotionEvent(
      location, timestamp, wl::EventDispatchPolicy::kImmediate,
      /*is_synthesized=*/true);
      Kramer Ge . unresolved

      I think this should be called when `pointer_grabber_for_window_drag_` is not null.

      And, IMO it doesn't resolve the underlying issue.
      My observation is that `wl_pointer` leaves the surface when drag begins, and we do not send button release to `pointer_delegate_` unless `pointer_grabber_for_window_drag_`. In this case `pointer_grabber_for_window_drag_` is not null for and we artificially generated a button release for some reason, which seems to be the actual bug.

      +nickdiego

      Łukasz Patron

      >we artificially generated a button release for some reason, which seems to be the actual bug.

      if you don't send artificial button release, it'll just leave you in text selection mode after the file drop.

      Kramer Ge

      You're right we have to send artificial button release. I was just wondering if the release should be sent targeting the window where pointer isn't in. If drag does not involve data exchange, GNOME always dispatches button release to the same window even if button down and up occurred in 2 different windows. Given that model, location of the event is indeed the problem.

      So it's OK fixing it like this, but motion may be dispatched to the origin window if drag enters a different window. So probably skip `OnPointerMotionEvent` when pointer focused window is not equal to `window_`.

      Łukasz Patron

      hmm, I wrapped the whole thing with `if (pointer_grabber_for_window_drag_)` and now tests fail:

      ../../ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc:1447: Failure
      Expected equality of these values:
      gfx::PointF(10, 11)
      Which is: 10,11
      pointer_delegate->GetPointerLocation()
      Which is: 0,0
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Kramer Ge
      • Nick Yamane
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Kramer Ge <fang...@chromium.org>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Mon, 24 Nov 2025 22:39:17 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Łukasz Patron (Gerrit)

      unread,
      Nov 24, 2025, 5:51:07 PM (7 days ago) Nov 24
      to Chromium LUCI CQ, Nick Yamane, Kramer Ge, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Łukasz Patron

      also it seems like that caused another bug, since it likely last updated the pointer position right before it left the window, so after file drop it believes that I dropped it on the browser window and starts downloading it.

      Gerrit-Comment-Date: Mon, 24 Nov 2025 22:50:50 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kramer Ge (Gerrit)

      unread,
      Nov 25, 2025, 2:43:10 PM (6 days ago) Nov 25
      to Łukasz Patron, Chromium LUCI CQ, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Nick Yamane and Łukasz Patron

      Kramer Ge added 1 comment

      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Kramer Ge

      Does wrapping in `if (window_ == window_manager_->GetCurrentPointerFocusedWindow())` work?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Nick Yamane
      • Łukasz Patron
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Tue, 25 Nov 2025 19:43:04 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Łukasz Patron (Gerrit)

      unread,
      Nov 25, 2025, 2:58:25 PM (6 days ago) Nov 25
      to Chromium LUCI CQ, Nick Yamane, Kramer Ge, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Kramer Ge and Nick Yamane

      Łukasz Patron added 1 comment

      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Łukasz Patron

      tests pass with that, but buggy behavior is still there - https://www.youtube.com/watch?v=nY1hpJbuqas

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Kramer Ge
      • Nick Yamane
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Kramer Ge <fang...@chromium.org>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Tue, 25 Nov 2025 19:58:06 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kramer Ge (Gerrit)

      unread,
      Nov 25, 2025, 4:35:45 PM (6 days ago) Nov 25
      to Łukasz Patron, Chromium LUCI CQ, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Nick Yamane and Łukasz Patron

      Kramer Ge voted and added 1 comment

      Votes added by Kramer Ge

      Code-Review+1
      Commit-Queue+2

      1 comment

      File ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
      Line 489, Patchset 7 (Latest): pointer_delegate_->OnPointerMotionEvent(
      location, timestamp, wl::EventDispatchPolicy::kImmediate,
      /*is_synthesized=*/true);
      Kramer Ge . resolved

      I think this should be called when `pointer_grabber_for_window_drag_` is not null.

      And, IMO it doesn't resolve the underlying issue.
      My observation is that `wl_pointer` leaves the surface when drag begins, and we do not send button release to `pointer_delegate_` unless `pointer_grabber_for_window_drag_`. In this case `pointer_grabber_for_window_drag_` is not null for and we artificially generated a button release for some reason, which seems to be the actual bug.

      +nickdiego

      Łukasz Patron

      >we artificially generated a button release for some reason, which seems to be the actual bug.

      if you don't send artificial button release, it'll just leave you in text selection mode after the file drop.

      Kramer Ge

      You're right we have to send artificial button release. I was just wondering if the release should be sent targeting the window where pointer isn't in. If drag does not involve data exchange, GNOME always dispatches button release to the same window even if button down and up occurred in 2 different windows. Given that model, location of the event is indeed the problem.

      So it's OK fixing it like this, but motion may be dispatched to the origin window if drag enters a different window. So probably skip `OnPointerMotionEvent` when pointer focused window is not equal to `window_`.

      Łukasz Patron

      hmm, I wrapped the whole thing with `if (pointer_grabber_for_window_drag_)` and now tests fail:

      ../../ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc:1447: Failure
      Expected equality of these values:
      gfx::PointF(10, 11)
      Which is: 10,11
      pointer_delegate->GetPointerLocation()
      Which is: 0,0
      Łukasz Patron

      also it seems like that caused another bug, since it likely last updated the pointer position right before it left the window, so after file drop it believes that I dropped it on the browser window and starts downloading it.

      Kramer Ge

      Does wrapping in `if (window_ == window_manager_->GetCurrentPointerFocusedWindow())` work?

      Łukasz Patron

      tests pass with that, but buggy behavior is still there - https://www.youtube.com/watch?v=nY1hpJbuqas

      Kramer Ge

      Ah, it's because `window_manager_->GetCurrentPointerFocusedWindow()` is null, so this is fine after all, it's actually just setting `pointer_location_`, not dispatching the event.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Nick Yamane
      • Łukasz Patron
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Tue, 25 Nov 2025 21:35:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Łukasz Patron (Gerrit)

      unread,
      Nov 28, 2025, 4:49:17 AM (4 days ago) Nov 28
      to Kramer Ge, Chromium LUCI CQ, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Kramer Ge and Nick Yamane

      Łukasz Patron added 1 comment

      Patchset-level comments
      Łukasz Patron . resolved

      bump? can someone else review too? ^^

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Kramer Ge
      • Nick Yamane
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Kramer Ge <fang...@chromium.org>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Fri, 28 Nov 2025 09:49:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kramer Ge (Gerrit)

      unread,
      Nov 28, 2025, 2:39:18 PM (3 days ago) Nov 28
      to Łukasz Patron, Peter McNeeley, Chromium LUCI CQ, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Nick Yamane, Peter McNeeley and Łukasz Patron

      Kramer Ge added 1 comment

      Patchset-level comments
      Kramer Ge . resolved

      adding 2nd reviewer

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Nick Yamane
      • Peter McNeeley
      • Łukasz Patron
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
      Gerrit-Change-Number: 7182320
      Gerrit-PatchSet: 7
      Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
      Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
      Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
      Gerrit-Reviewer: Peter McNeeley <peterm...@google.com>
      Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
      Gerrit-Attention: Peter McNeeley <peterm...@google.com>
      Gerrit-Attention: Nick Yamane <nick...@igalia.com>
      Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
      Gerrit-Comment-Date: Fri, 28 Nov 2025 19:39:09 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Peter McNeeley (Gerrit)

      unread,
      Nov 30, 2025, 9:35:31 PM (20 hours ago) Nov 30
      to Łukasz Patron, Chromium LUCI CQ, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com
      Attention needed from Hidehiko Abe, Nick Yamane and Łukasz Patron

      Peter McNeeley voted and added 1 comment

      Votes added by Peter McNeeley

      Code-Review+1
      Commit-Queue+2

      1 comment

      Patchset-level comments
      Peter McNeeley . resolved

      sg

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Hidehiko Abe
      • Nick Yamane
      • Łukasz Patron
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
        Gerrit-Change-Number: 7182320
        Gerrit-PatchSet: 7
        Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
        Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
        Gerrit-Reviewer: Kramer Ge <fang...@chromium.org>
        Gerrit-Reviewer: Nick Yamane <nick...@igalia.com>
        Gerrit-Reviewer: Peter McNeeley <peterm...@google.com>
        Gerrit-Reviewer: Łukasz Patron <priv...@gmail.com>
        Gerrit-Attention: Łukasz Patron <priv...@gmail.com>
        Gerrit-Attention: Nick Yamane <nick...@igalia.com>
        Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
        Gerrit-Comment-Date: Mon, 01 Dec 2025 02:35:19 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Nov 30, 2025, 11:36:49 PM (18 hours ago) Nov 30
        to Łukasz Patron, Peter McNeeley, Kramer Ge, Nick Yamane, AyeAye, Hidehiko Abe, max+watc...@igalia.com, ozone-...@chromium.org, nickdiego+wa...@igalia.com

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        [ozone/wayland] Update pointer position during dragging

        Prior to this change, dragging a file from chrome://downloads by its
        filename would often open the file after it was dropped somewhere, this
        is because the synthetic mouse release has outdated location.

        After ensuring that pointer location is updated during drag motion,
        similarly to WaylandWindowDragController::OnDragLeave(), this is no
        longer a problem.
        Bug: 462468355
        Test: ozone_unittests
        Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
        Reviewed-by: Peter McNeeley <peterm...@google.com>
        Commit-Queue: Peter McNeeley <peterm...@google.com>
        Auto-Submit: Łukasz Patron <priv...@gmail.com>
        Reviewed-by: Kramer Ge <fang...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1551919}
        Files:
        • M ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc
        • M ui/ozone/platform/wayland/host/wayland_data_drag_controller.h
        • M ui/ozone/platform/wayland/host/wayland_data_drag_controller_unittest.cc
        Change size: S
        Delta: 3 files changed, 10 insertions(+), 12 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Kramer Ge, +1 by Peter McNeeley
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ib377b7ec04a9f5a02a21e36f7c43871a3e414798
        Gerrit-Change-Number: 7182320
        Gerrit-PatchSet: 8
        Gerrit-Owner: Łukasz Patron <priv...@gmail.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages