summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomohiro Komagata <tomohiro.komagata.aj@gmail.com>2017-12-04 19:40:31 +0000
committerDaniel Stone <daniels@collabora.com>2017-12-04 19:40:31 +0000
commit7861fa91517aea77e57f8aed5f03e8bc531eff14 (patch)
tree30a98fd54cc731e97b9555913369b55db34b1478
parent43c5a65b034a243700cf9c5bfbe6bcefb15f1161 (diff)
clients: simple-egl: Restore window size when un-maximized
The window position was correct but the window size was wrong when simple-egl returns from maximized window to un-maximized. Its size should be restored to original size. Signed-off-by: Tomohiro Komagata <tomohiro.komagata.aj@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--clients/simple-egl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/clients/simple-egl.c b/clients/simple-egl.c
index dad0f09b..a1e57aef 100644
--- a/clients/simple-egl.c
+++ b/clients/simple-egl.c
@@ -100,7 +100,7 @@ struct window {
struct ivi_surface *ivi_surface;
EGLSurface egl_surface;
struct wl_callback *callback;
- int fullscreen, opaque, buffer_size, frame_sync, delay;
+ int fullscreen, maximized, opaque, buffer_size, frame_sync, delay;
bool wait_for_configure;
};
@@ -317,23 +317,27 @@ handle_toplevel_configure(void *data, struct zxdg_toplevel_v6 *toplevel,
uint32_t *p;
window->fullscreen = 0;
+ window->maximized = 0;
wl_array_for_each(p, states) {
uint32_t state = *p;
switch (state) {
case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
window->fullscreen = 1;
break;
+ case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
+ window->maximized = 1;
+ break;
}
}
if (width > 0 && height > 0) {
- if (!window->fullscreen) {
+ if (!window->fullscreen && !window->maximized) {
window->window_size.width = width;
window->window_size.height = height;
}
window->geometry.width = width;
window->geometry.height = height;
- } else if (!window->fullscreen) {
+ } else if (!window->fullscreen && !window->maximized) {
window->geometry = window->window_size;
}