aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wayland
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-11-18 12:54:00 -0500
committerChris Michael <cp.michael@samsung.com>2015-11-18 12:54:00 -0500
commit4534c4aec3aa518b5723b483694c78a30a07ee46 (patch)
tree73f755dfbf8aa2c1847ec5835c9e7696295491a4 /src/lib/ecore_wayland
parentecore-wayland: Add EINA_SAFETY checks to window functions (diff)
downloadefl-4534c4aec3aa518b5723b483694c78a30a07ee46.tar.gz
ecore-wayland: Fix iconified functions for consistency
* sanitize bool params * enforce window state flag setting * correctly detect window state using window flag @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 389cebceae..95ff881fa0 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -745,6 +745,7 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
EAPI void
ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
{
+ Eina_Bool prev;
struct wl_array states;
uint32_t *s;
@@ -752,13 +753,14 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
EINA_SAFETY_ON_NULL_RETURN(win);
+ prev = win->minimized;
+ iconified = !!iconified;
+ if (prev == iconified) return;
+
if (iconified)
{
if (win->xdg_surface)
- {
- xdg_surface_set_minimized(win->xdg_surface);
- win->minimized = iconified;
- }
+ xdg_surface_set_minimized(win->xdg_surface);
else if (win->shell_surface)
{
/* TODO: handle case of iconifying a wl_shell surface */
@@ -768,7 +770,6 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
{
if (win->xdg_surface)
{
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
@@ -776,12 +777,12 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
wl_array_release(&states);
}
else if (win->shell_surface)
- {
- wl_shell_surface_set_toplevel(win->shell_surface);
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
- _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
- }
+ wl_shell_surface_set_toplevel(win->shell_surface);
+
+ win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
}
+
+ win->minimized = iconified;
}
EAPI Eina_Bool