summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland/ecore_wl_window.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-08-23 08:57:16 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-01 16:15:37 -0400
commite78dcd3f4f8274b70ae393f8ef4442ffb8070a8b (patch)
tree0029a68ff790f9689f4a0dff2597c0520eb13c18 /src/lib/ecore_wayland/ecore_wl_window.c
parentd7f1b277dc0d115412dcfbe9a0620be33c5c87dd (diff)
ecore-wayland: Add/Implement code to handle iconifying a window
xdg_shell protocol provides functions to minimize a surface. This is now implemented via ecore_wl_window_iconified_set. NB: This Does Not work for wl_shell surfaces because wl_shell provides no method to minimize. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wayland/ecore_wl_window.c')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c77
1 files changed, 62 insertions, 15 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 0d6ca72087..75fcd7daf9 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -733,6 +733,52 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent)
733 win->parent = parent; 733 win->parent = parent;
734} 734}
735 735
736/* @since 1.12 */
737EAPI void
738ecore_wl_window_iconified_set(Ecore_Wl_Window *win, Eina_Bool iconified)
739{
740 LOGFN(__FILE__, __LINE__, __FUNCTION__);
741
742 if (!win) return;
743
744 if (iconified)
745 {
746 if (win->xdg_surface)
747 {
748 xdg_surface_set_minimized(win->xdg_surface);
749 win->minimized = iconified;
750 }
751 else if (win->shell_surface)
752 {
753 /* TODO: handle case of iconifying a wl_shell surface */
754 }
755 }
756 else
757 {
758 if (win->xdg_surface)
759 {
760 /* TODO: Handle case of UnIconifying an xdg_surface
761 *
762 * NB: This will be needed for Enlightenment IBox scenario */
763 }
764 else if (win->shell_surface)
765 {
766 wl_shell_surface_set_toplevel(win->shell_surface);
767 win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
768 _ecore_wl_window_configure_send(win, win->saved.w, win->saved.h, 0);
769 }
770 }
771}
772
773EAPI Eina_Bool
774ecore_wl_window_iconified_get(Ecore_Wl_Window *win)
775{
776 LOGFN(__FILE__, __LINE__, __FUNCTION__);
777
778 if (!win) return EINA_FALSE;
779 return win->minimized;
780}
781
736EAPI Ecore_Wl_Window * 782EAPI Ecore_Wl_Window *
737ecore_wl_window_surface_find(struct wl_surface *surface) 783ecore_wl_window_surface_find(struct wl_surface *surface)
738{ 784{
@@ -968,21 +1014,22 @@ _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface
968 uint32_t state = *p; 1014 uint32_t state = *p;
969 switch (state) 1015 switch (state)
970 { 1016 {
971 case XDG_SURFACE_STATE_MAXIMIZED: 1017 case XDG_SURFACE_STATE_MAXIMIZED:
972 win->maximized = EINA_TRUE; 1018 win->maximized = EINA_TRUE;
973 break; 1019 break;
974 case XDG_SURFACE_STATE_FULLSCREEN: 1020 case XDG_SURFACE_STATE_FULLSCREEN:
975 win->fullscreen = EINA_TRUE; 1021 win->fullscreen = EINA_TRUE;
976 break; 1022 break;
977 case XDG_SURFACE_STATE_RESIZING: 1023 case XDG_SURFACE_STATE_RESIZING:
978 win->resizing = EINA_TRUE; 1024 win->resizing = EINA_TRUE;
979 break; 1025 break;
980 case XDG_SURFACE_STATE_ACTIVATED: 1026 case XDG_SURFACE_STATE_ACTIVATED:
981 win->focused = EINA_TRUE; 1027 win->focused = EINA_TRUE;
982 break; 1028 win->minimized = EINA_FALSE;
983 default: 1029 break;
984 break; 1030 default:
985 } 1031 break;
1032 }
986 } 1033 }
987 if ((width > 0) && (height > 0)) 1034 if ((width > 0) && (height > 0))
988 _ecore_wl_window_configure_send(win, width, height, 0); 1035 _ecore_wl_window_configure_send(win, width, height, 0);