From c09e89929bad8f19b6eb70018c1d984bbe650346 Mon Sep 17 00:00:00 2001 From: Jonas Ådahl Date: Fri, 15 Jul 2016 16:55:51 +0800 Subject: xdg-shell: Add resize_x/y constraint adjustment to positioner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to get feedback of available space where a client can create its popup, let it create requset that its popup rectangle being resized would it not fit the within the work area. This adds two new constraint adjustment values to the adjustment enum, and dimension parameters to the xdg_popup.configure event. The existing constraint adjustment actions take precedence, and resizing will only be triggered if all other adjustments requested didn't manage to make the popup rectangle fully visible. Signed-off-by: Jonas Ådahl Acked-by: Quentin Glidic --- unstable/xdg-shell/xdg-shell-unstable-v6.xml | 41 +++++++++++++++++++++------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml b/unstable/xdg-shell/xdg-shell-unstable-v6.xml index d6802be..565df8c 100644 --- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml +++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml @@ -234,6 +234,20 @@ + + The constraint adjustment value define ways the compositor will adjust + the position of the surface, if the unadjusted position would result + in the surface being partly constrained. + + Whether a surface is considered 'constrained' is left to the compositor + to determine. For example, the surface may be partly outside the + compositor's defined 'work area', thus necessitating the child surface's + position be adjusted until it is entirely inside the work area. + + The adjustments can be combined, according to a defined precedence: 1) + Flip, 2) Slide, 3) Resize. + + Don't alter the surface position even if it is constrained on some @@ -253,8 +267,6 @@ x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained. - - If 'slide_x' is combined with 'flip_x', 'flip_x' takes precedence. @@ -270,8 +282,6 @@ y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained. - - If 'slide_y' is combined with 'flip_y', 'flip_y' takes precedence. @@ -282,9 +292,8 @@ 'left', change the gravity to 'right' and the anchor to 'right'. If the adjusted position also ends up being constrained, the resulting - position will be the one before the adjustment. If the resulting - position is still constrained, and 'flip_x' is combined with - 'slide_x', the position is adjusted according to 'slide_x'. + position of the flip_x adjustment will be the one before the + adjustment. @@ -295,9 +304,19 @@ 'bottom', change the gravity to 'top' and the anchor to 'top'. If the adjusted position also ends up being constrained, the resulting - position will be the one before the adjustment. If the resulting - position is still constrained, and 'flip_y' is combined with - 'slide_y', the position is adjusted according to 'slide_y'. + position of the flip_y adjustment will be the one before the + adjustment. + + + + + Resize the surface horizontally so that it is completely + unconstrained. + + + + + Resize the surface vertically so that it is completely unconstrained. @@ -1010,6 +1029,8 @@ summary="x position relative to parent surface window geometry"/> + + -- cgit v1.2.3