From 784e5bc6fb17a527efc63d22b00b7280bd5d13b6 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Tue, 16 Dec 2025 21:11:40 +0100 Subject: [PATCH] xdg-shell: add popup move/resize requests Some applications want to allow the user to interactively move and resize popups. For example, IDEs might use popups to display code completion suggestions. Depending on the situation, the user might want to resize this suggestion window to make more or less information visible. The xdg_popup.reposition request is morally equivalent to atomically destroying the old popup and creating a new popup with the new xdg_positioner. Therefore this request cancels any ongoing interactive move and resize operations. Signed-off-by: Julian Orth --- stable/xdg-shell/xdg-shell.xml | 80 +++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/stable/xdg-shell/xdg-shell.xml b/stable/xdg-shell/xdg-shell.xml index 39ecf8a..11f75ab 100644 --- a/stable/xdg-shell/xdg-shell.xml +++ b/stable/xdg-shell/xdg-shell.xml @@ -29,7 +29,7 @@ DEALINGS IN THE SOFTWARE. - + The xdg_wm_base interface is exposed as a global object enabling clients to turn their wl_surfaces into windows in a desktop environment. It @@ -122,7 +122,7 @@ - + The xdg_positioner provides a collection of rules for the placement of a child surface relative to a parent surface. Rules can be defined to ensure @@ -407,7 +407,7 @@ - + An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface. @@ -620,7 +620,7 @@ - + This interface defines an xdg_surface role which allows a surface to, among other things, set window-like properties such as maximize, @@ -1242,7 +1242,7 @@ - + A popup surface is a short-lived, temporary surface. It can be used to implement for example menus, popovers, tooltips and other similar user @@ -1273,6 +1273,8 @@ + @@ -1344,6 +1346,8 @@ ever sent once for the initial configuration. Starting with version 3, it may be sent again if the popup is setup with an xdg_positioner with set_reactive requested, or in response to xdg_popup.reposition requests. + + Starting with version 8, this event may be sent at any time. @@ -1388,6 +1392,9 @@ If the popup is repositioned together with a parent that is being resized, but not in response to a configure event, the client should send an xdg_positioner.set_parent_size request. + + Since version 8, this request will cancel any interactive move or resize + operation. @@ -1414,5 +1421,68 @@ + + + + + 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. For example, 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. + + + + + + + + Start a user-driven, interactive resize 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 resize (touch, + pointer, etc). + + The server may ignore resize requests. For example, if the passed serial + is no longer valid. + + If triggered, the client will receive configure events with the + expected sizes. The client must also acknowledge configure events using + "ack_configure". + + If triggered, the surface also will lose the focus of the device + (wl_pointer, wl_touch, etc) used for the resize. It is up to the + compositor to visually indicate that the resize is taking place, + such as updating a pointer cursor, during the resize. There is no + guarantee that the device focus will return when the resize is + completed. + + The edges parameter specifies how the surface should be resized, and + is one of the values of the resize_edge enum. Values not matching + a variant of the enum will cause the invalid_resize_edge protocol error. + The compositor may use this information to update the surface position + for example when dragging the top left corner. The compositor may also + use this information to adapt its behavior, e.g. choose an appropriate + cursor image. + + + + + +