diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2013-11-29 17:48:52 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-12-02 16:20:58 -0800 |
commit | fdca95c7db067132b5670cbaa56c4088c2be3f1f (patch) | |
tree | aa1b7fdb60296dc652c515c3433a503b2abdf920 /tests | |
parent | 5b4ddbc11e84a22caefa655f4504e2999726458b (diff) |
window: handle insufficient buffer space
It is quite possible for os_create_anonymous_file() to fail when trying
to allocate a new wl_shm buffer. Propagate this failure out from
shm_surface_prepare. Most parts of toytoolkit are already avoiding NULL
cairo surfaces.
If cairo surface allocation fails, do not try to call the widget redraw
functions, those are not prepared to deal with NULL. Also do not
schedule a frame callback, this allows us to retry drawing the next
time.
If redraw fails for the main_surface of a window, restore the widget
geometry to what the compositor currently is showing. This keeps the
window visual appearance in sync with application state, so interacting
with the application does not break too badly.
If the very first draw of any window fails, then forcefully exit the
program. E.g. if weston-desktop-shell fails to allocate buffers for the
unlock dialog, w-d-s exits, and weston unlocks the screen automatically.
This patch allows e.g. weston-terminal to stop from enlarging while
resizing, if new sized buffers can no longer the allocated. Even then,
the application stays usable, as it can often repaint in the last
successful size. It does not crash, and the user is able to resize it
smaller, too.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions