summaryrefslogtreecommitdiff
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
parent35b4794c4afd1c2ffc865a90068b26d36e72def9 (diff)
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)
745EAPI void 745EAPI void
746ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified) 746ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
747{ 747{
748 Eina_Bool prev;
748 struct wl_array states; 749 struct wl_array states;
749 uint32_t *s; 750 uint32_t *s;
750 751
@@ -752,13 +753,14 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
752 753
753 EINA_SAFETY_ON_NULL_RETURN(win); 754 EINA_SAFETY_ON_NULL_RETURN(win);
754 755
756 prev = win->minimized;
757 iconified = !!iconified;
758 if (prev == iconified) return;
759
755 if (iconified) 760 if (iconified)
756 { 761 {
757 if (win->xdg_surface) 762 if (win->xdg_surface)
758 { 763 xdg_surface_set_minimized(win->xdg_surface);
759 xdg_surface_set_minimized(win->xdg_surface);
760 win->minimized = iconified;
761 }
762 else if (win->shell_surface) 764 else if (win->shell_surface)
763 { 765 {
764 /* TODO: handle case of iconifying a wl_shell surface */ 766 /* 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)
768 { 770 {
769 if (win->xdg_surface) 771 if (win->xdg_surface)
770 { 772 {
771 win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
772 wl_array_init(&states); 773 wl_array_init(&states);
773 s = wl_array_add(&states, sizeof(*s)); 774 s = wl_array_add(&states, sizeof(*s));
774 *s = XDG_SURFACE_STATE_ACTIVATED; 775 *s = XDG_SURFACE_STATE_ACTIVATED;
@@ -776,12 +777,12 @@ ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
776 wl_array_release(&states); 777 wl_array_release(&states);
777 } 778 }
778 else if (win->shell_surface) 779 else if (win->shell_surface)
779 { 780 wl_shell_surface_set_toplevel(win->shell_surface);
780 wl_shell_surface_set_toplevel(win->shell_surface); 781
781 win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL; 782 win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
782 _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
783 }
784 } 783 }
784
785 win->minimized = iconified;
785} 786}
786 787
787EAPI Eina_Bool 788EAPI Eina_Bool