wl: moved visibility change callback to main
authorGwanglim Lee <gl77.lee@samsung.com>
Fri, 31 Jul 2015 07:48:30 +0000 (16:48 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 31 Jul 2015 07:48:30 +0000 (16:48 +0900)
Change-Id: I64f8e9c5f53a2eec01ffed73e142594591830553

src/e_mod_main.c
src/e_mod_wl.c
src/e_mod_wl.h

index 0142399..daedcd2 100644 (file)
@@ -47,9 +47,11 @@ static Eina_Bool   _pol_cb_client_add(void *data EINA_UNUSED, int type, void *ev
 static Eina_Bool   _pol_cb_client_move(void *data EINA_UNUSED, int type, void *event);
 static Eina_Bool   _pol_cb_client_resize(void *data EINA_UNUSED, int type, void *event);
 static Eina_Bool   _pol_cb_client_stack(void *data EINA_UNUSED, int type, void *event);
-#ifndef HAVE_WAYLAND_ONLY
 static Eina_Bool   _pol_cb_client_property(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
+static Eina_Bool   _pol_cb_client_vis_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED);
+#ifndef HAVE_WAYLAND_ONLY
 static Eina_Bool   _pol_cb_window_property(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Property *ev);
+static Eina_Bool   _pol_cb_window_configure_request(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Configure_Request *ev);
 #endif
 
 static void
@@ -719,6 +721,15 @@ _pol_cb_client_property(void *data EINA_UNUSED, int type EINA_UNUSED, void *even
    return EINA_FALSE;
 }
 
+static Eina_Bool
+_pol_cb_client_vis_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
+{
+#ifdef HAVE_WAYLAND_ONLY
+   e_mod_pol_wl_win_scrmode_apply();
+#endif
+   return ECORE_CALLBACK_PASS_ON;
+}
+
 #ifndef HAVE_WAYLAND_ONLY
 static Eina_Bool
 _pol_cb_window_property(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Property *ev)
@@ -1001,6 +1012,8 @@ e_modapi_init(E_Module *m)
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE,                  _pol_cb_client_resize,                   NULL);
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_STACK,                   _pol_cb_client_stack,                    NULL);
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_PROPERTY,                _pol_cb_client_property,                 NULL);
+   E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_VISIBILITY_CHANGE,       _pol_cb_client_vis_change,               NULL);
+
 
 #ifndef HAVE_WAYLAND_ONLY
    E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_PROPERTY,          _pol_cb_window_property,                 NULL);
index a7b327a..d9614e1 100644 (file)
@@ -37,7 +37,6 @@ static Eina_Hash *hash_notification_levels = NULL;
 static Eina_Hash *hash_policy_conformants = NULL;
 static Eina_Hash *hash_window_screen_modes = NULL;
 static Eina_List *_window_screen_modes = NULL;
-static Eina_List *_handlers = NULL;
 
 static Pol_Wayland*
 _pol_wayland_get_info(E_Pixmap *cp)
@@ -102,15 +101,6 @@ _pol_wayland_role_handle(E_Client *ec, const char* role)
 }
 
 static void
-_window_screen_mode_apply(void)
-{
-  //traversal e_client loop
-  // if  e_client is visible then apply screen_mode
-  // if all e_clients are default mode then set default screen_mode
-  return;
-}
-
-static void
 _pol_surface_parent_set(E_Client *ec, struct wl_resource *parent_resource)
 {
    E_Pixmap *pp;
@@ -639,7 +629,7 @@ _e_tizen_policy_cb_window_screen_mode_set(struct wl_client *client, struct wl_re
    wsm->surface = surface;
    wsm->interface = resource;
 
-   _window_screen_mode_apply();
+   e_mod_pol_wl_win_scrmode_apply();
 
    /* Add other error handling code on window_screen send done. */
    tizen_policy_send_window_screen_mode_done(resource, surface, mode, TIZEN_POLICY_ERROR_STATE_NONE);
@@ -722,17 +712,11 @@ _e_tizen_policy_cb_bind(struct wl_client *client, void *data, uint32_t version,
    wl_resource_set_implementation(res, &_e_tizen_policy_interface, cdata, NULL);
 }
 
-static Eina_Bool
-_cb_client_visibility_change(void *data EINA_UNUSED,
-                             int type   EINA_UNUSED,
-                             void      *event)
+void
+e_mod_pol_wl_win_scrmode_apply(void)
 {
-   //E_Event_Client *ev;
-   //ev = event;
-
-   _window_screen_mode_apply();
-
-   return ECORE_CALLBACK_PASS_ON;
+   // TODO: update screen mode for ec which was changed to be visible
+   ;
 }
 
 Eina_Bool
@@ -761,9 +745,6 @@ e_mod_pol_wl_init(void)
    hash_policy_conformants = eina_hash_pointer_new(free);
    hash_window_screen_modes = eina_hash_pointer_new(free);
 
-   E_LIST_HANDLER_APPEND(_handlers, E_EVENT_CLIENT_VISIBILITY_CHANGE,
-                         _cb_client_visibility_change, NULL);
-
    return EINA_TRUE;
 }
 
@@ -775,7 +756,6 @@ e_mod_pol_wl_shutdown(void)
    E_FREE_FUNC(hash_policy_conformants, eina_hash_free);
 
    eina_list_free(_window_screen_modes);
-   E_FREE_LIST(_handlers, ecore_event_handler_del);
    E_FREE_FUNC(hash_window_screen_modes, eina_hash_free);
 }
 
index 23ace58..fd2a124 100644 (file)
@@ -21,5 +21,9 @@ void e_mod_pol_wl_position_send(E_Client *ec);
 /* notification */
 void e_mod_pol_wl_notification_level_fetch(E_Client *ec);
 void e_mod_pol_wl_keyboard_geom_broadcast(E_Client *ec);
+
+/* window screenmode */
+void e_mod_pol_wl_win_scrmode_apply(void);
+
 #endif /* HAVE_WAYLAND_ONLY */
 #endif /* E_MOD_WL_H */