[wxWidgets/wxWidgets] Question: Is there a method that can invoke the platform’s native window dragging functionality, similar to startSystemMove() in Qt? (Issue #24875)

34 views
Skip to first unread message

StingKo

unread,
Oct 11, 2024, 8:26:08 AM10/11/24
to wx-...@googlegroups.com, Subscribed

Question: In a borderless window, is there a method similar to startSystemMove() in Qt that allows calling the platform’s native window dragging? It seems that only by doing this can we perfectly support window snapping on Windows (as well as the new window snapping feature introduced in macOS 15).

qt:https://doc.qt.io/qt-6/qwindow.html#startSystemMove


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24875@github.com>

VZ

unread,
Oct 11, 2024, 8:58:10 AM10/11/24
to wx-...@googlegroups.com, Subscribed

Don't you get a regular WM_MOVE (mapped to wxMoveEvent) for this? And if some other message gets sent, you can always process it by overriding MSWHandleMessage() under Windows.

Of course, it would be nice to provide a portable wrapper for this, including wrapping whatever macOS 15 does — any contributions would be welcome!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24875/2407361715@github.com>

Stephan Sokolow

unread,
Apr 9, 2026, 12:24:31 AM (3 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
ssokolow left a comment (wxWidgets/wxWidgets#24875)

Maybe I've been away from wxWidgets for far too long (I dropped wxPython and PyGTK in favour of PyQt during the GTK 2→3 transition to prioritize preserving a minimum degree of KDE-nativeness), but don't WM_MOVE and wxMoveEvent signal a move while startSystemMove triggers one?

(i.e. It exposes the underlying window system's mechanism for allowing clients to implement things like "this window can be repositioned by click-dragging anywhere that a child widget does not claim the input".)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24875/4211437328@github.com>

VZ

unread,
Apr 9, 2026, 9:20:54 AM (3 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed

Closed #24875 as not planned.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/24875/issue_event/24337073747@github.com>

VZ

unread,
Apr 9, 2026, 9:20:55 AM (3 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#24875)

I don't remember why I wrote the reply above any more but yes, it's indeed not the same thing. What the OP wanted was probably to be able to start moving the window by dragging it or something like this, which could be implemented under Windows and maybe macOS (although I have no idea how), but seems impossible under Linux, at least with Wayland. In any case, there are no plans for implementing this, so I think this one can be just closed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24875/4214529293@github.com>

Stephan Sokolow

unread,
Apr 9, 2026, 10:07:03 AM (3 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
ssokolow left a comment (wxWidgets/wxWidgets#24875)

I did a quick dive through the Qt source and the Wayland backend does appear to route it to an internal method named QWaylandWlShellSurface::move, which I think I lost track of when it crossed into some kind of private library in another repo but, based on its arguments, seems to correspond to move(seat: object<wl_seat>, serial: uint) in Wayland's xdg-toplevel extension.

According to those docs...

Start an interactive, user-driven move of the surface.

This request must be used in response to some sort of user action like a button press, key press, or touch down event. The passed serial is used to determine the type of interactive move (touch, pointer, etc).

The server may ignore move requests depending on the state of the surface (e.g. fullscreen or maximized), or if the passed serial is no longer valid.

If triggered, the surface will lose the focus of the device (wl_pointer, wl_touch, etc) used for the move. It is up to the compositor to visually indicate that the move is taking place, such as updating a pointer cursor, during the move. There is no guarantee that the device focus will return when the move is completed.

That does seem consistent with what QWindow::startSystemMove's docs say (emphasis mine):

On platforms that support it, this method of moving windows is preferred over setPosition, because it allows a more native look-and-feel of moving windows, e.g. letting the window manager snap this window against other windows, or special tiling or resizing behavior with animations when dragged to the edge of the screen. Furthermore, on some platforms such as Wayland, setPosition is not supported, so this is the only way the application can influence its position.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24875/4214875961@github.com>

VZ

unread,
Apr 9, 2026, 10:18:09 AM (3 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#24875)

OK, if this is supported by Wayland, this is more interesting and it would indeed be useful to have a wrapper for this.

I still don't have any plans to work on this myself in the observable future, but if anybody can make a PR implementing it for at least some platforms, it would be welcome!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24875/4214950883@github.com>

VZ

unread,
Apr 9, 2026, 10:18:16 AM (3 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed

Reopened #24875.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/24875/issue_event/24339177109@github.com>

Reply all
Reply to author
Forward
0 new messages