diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-05-02 10:21:38 -0400 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2014-07-17 13:59:01 -0700 |
commit | ccf48fb4f9923e59e82911a2c03dda9bc70541a0 (patch) | |
tree | 74fd61fddacf0cc9d78929f267519a799ade7aa0 /protocol | |
parent | bd65e508753b8c1eeadcaa1c223bace2a3477083 (diff) | |
download | weston-ccf48fb4f9923e59e82911a2c03dda9bc70541a0.tar.gz |
shell: Replace set_margin with set_window_geometry
Currently, there is a fun flicker when toggling maximization or
fullscreen on a window in mutter or more sophisicated compositors
and WMs.
What happens is that the client want so go maximized, so we
calculate the size that we want the window to resize to (640x480),
and then add on its margins to find the buffer size (+10 = 660x500),
and then send out a configure event for that size. The client
renders to that size, realizes that it's maximized, and then
says "oh hey, my margins are actually 0 now!", and so the compositor
has to send out another configure event.
In order to fix this, make the the configure request correspond to
the window geometry we'd like the window to be at. At the same time,
replace set_margin with set_window_geometry, where we specify a rect
rather than a border around the window.
Diffstat (limited to 'protocol')
-rw-r--r-- | protocol/xdg-shell.xml | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml index 0327f40a..9532644c 100644 --- a/protocol/xdg-shell.xml +++ b/protocol/xdg-shell.xml @@ -146,32 +146,6 @@ <arg name="parent" type="object" interface="wl_surface" allow-null="true"/> </request> - <request name="set_margin"> - <description summary="set the visible frame boundaries"> - This tells the compositor what the visible size of the window - should be, so it can use it to determine what borders to use for - constrainment and alignment. - - CSD often has invisible areas for decoration purposes, like drop - shadows. These "shadow" drawings need to be subtracted out of the - normal boundaries of the window when computing where to place - windows (e.g. to set this window so it's centered on top of another, - or to put it to the left or right of the screen.) - - This value should change as little as possible at runtime, to - prevent flicker. - - This value is also ignored when the window is maximized or - fullscreen, and assumed to be 0. - - If never called, this value is assumed to be 0. - </description> - <arg name="left_margin" type="int"/> - <arg name="right_margin" type="int"/> - <arg name="top_margin" type="int"/> - <arg name="bottom_margin" type="int"/> - </request> - <request name="set_title"> <description summary="set surface title"> Set a short title for the surface. @@ -308,7 +282,7 @@ The configure event asks the client to resize its surface. The width and height arguments specify a hint to the window - about how its surface should be resized in surface local + about how its surface should be resized in window geometry coordinates. The states listed in the event specify how the width/height arguments should be interpreted. @@ -339,6 +313,29 @@ <arg name="serial" type="uint" summary="a serial to configure for"/> </request> + <request name="set_window_geometry"> + <description summary="set the new window geometry"> + The window geometry of a window is its "visible bounds" from the + user's perspective. Client-side decorations often have invisible + portions like drop-shadows which should be ignored for the + purposes of aligning, placing and constraining windows. + + The default value is the full bounds of the surface, including any + subsurfaces. Once the window geometry of the surface is set once, + it is not possible to unset it, and it will remain the same until + set_window_geometry is called again, even if a new subsurface or + buffer is attached. + + If responding to a configure event, the window geometry in here + must respect the sizing negotiations specified by the states in + the configure event. + </description> + <arg name="x" type="int"/> + <arg name="y" type="int"/> + <arg name="width" type="int"/> + <arg name="height" type="int"/> + </request> + <request name="set_maximized" /> <request name="unset_maximized" /> |