Skip to content

Queued non-client presses lose the button state on caption buttons #266

Done

Description

@JulienMaille

On Windows, QWindowKit translates queued non-client mouse messages for system buttons into client messages. The left press and release keep their transition; the right, middle, X1 and X2 buttons take their state only from the current physical key snapshot. If the button was released before the queued press is dispatched, the QWidget receives a press with buttons() == Qt::NoButton and no release.

In the probe, a native event filter keeps the physical button up and sends the corresponding non-client press and release to a point classified as HTMAXBUTTON. At a5728ca, the agent path delivers this for all four buttons; the left button control delivers both events. Without an agent, the equivalent client messages are correct.

Measured on Windows Server 2025 with MSVC and Qt 6.8.1 Widgets: baseline and corrected. This extends #259, which fixed the left button only. I have a one-commit fix ready and can open a PR.

Activity

  1. JulienMaille commented on Nov 28, 2026

    @JulienMaille
    ContributorAuthor

    @FinnWang-CN what do you think of this one?

  2. FinnWang-CN commented on Dec 1, 2026

    @FinnWang-CN
    Contributor

    Thanks for testing this, Julien. The left-button control and the direct client-message test point to the same timing issue we fixed in #259. I agree with extending that fix to the right, middle, X1 and X2 buttons. The forwarded message should set the affected button’s flag on press or double-click and clear it on release, while preserving the other button and modifier flags. Thanks for opening #267.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions