_e_comp_wl_intercept_hooks_delete++;
}
-EINTERN void
-e_comp_wl_shell_surface_ready(E_Client *ec)
-{
- if (!ec) return;
-
- _e_comp_wl_hook_call(E_COMP_WL_HOOK_SHELL_SURFACE_READY, ec);
-}
-
E_API void
e_comp_wl_input_cursor_timer_enable_set(Eina_Bool enabled)
{
EINTERN Eina_Bool e_comp_wl_evas_handle_mouse_button(E_Comp_Wl_Data *comp_wl, E_Client *ec, uint32_t timestamp, uint32_t button_id, uint32_t state);
-EINTERN void e_comp_wl_shell_surface_ready(E_Client *ec);
-
EINTERN void e_comp_wl_map_inv_coord_get(E_Client *ec, int x, int y, int *mx, int *my);
EINTERN Eina_Bool e_comp_wl_cursor_hide(E_Client *ec);
#include "e_config_intern.h"
#include "e_view_intern.h"
#include "e_view_client_intern.h"
-#include "e_desktop_shell_intern.h"
#include <tizen-extension-server-protocol.h>
+struct _E_Comp_Wl_Shell
+{
+ struct wl_listener new_toplevel;
+};
+
EINTERN Eina_Bool
e_shell_e_client_shell_assignable_check(E_Client *ec)
{
}
}
+static void
+_shell_cb_new_toplevel(struct wl_listener *listener, void *data)
+{
+ E_Desktop_Toplevel *toplevel = data;
+
+ e_comp_wl_shell_surface_ready(e_desktop_toplevel_ec_get(toplevel));
+}
+
+EINTERN E_Comp_Wl_Shell *
+e_comp_wl_shell_create(E_Desktop_Shell *desktop_shell)
+{
+ E_Comp_Wl_Shell *shell;
+
+ shell = calloc(1, sizeof(*shell));
+ if (!shell)
+ return NULL;
+
+ shell->new_toplevel.notify = _shell_cb_new_toplevel;
+ e_desktop_shell_new_toplevel_listener_add(desktop_shell, &shell->new_toplevel);
+
+ return shell;
+}
+
+EINTERN void
+e_comp_wl_shell_destroy(E_Comp_Wl_Shell *shell)
+{
+ wl_list_remove(&shell->new_toplevel.link);
+ free(shell);
+}
+
+EINTERN void
+e_comp_wl_shell_surface_ready(E_Client *ec)
+{
+ e_comp_wl_hook_call(E_COMP_WL_HOOK_SHELL_SURFACE_READY, ec);
+}
+
#define E_COMP_WL_SHELL_INTERN_H
#include "e_comp_wl.h"
+#include "e_desktop_shell_intern.h"
+typedef struct _E_Comp_Wl_Shell E_Comp_Wl_Shell;
typedef struct _E_Comp_Wl_Shell_Surface_Api E_Shell_Surface_Api;
+E_Comp_Wl_Shell *e_comp_wl_shell_create(E_Desktop_Shell *desktop_shell);
+void e_comp_wl_shell_destroy(E_Comp_Wl_Shell *shell);
+void e_comp_wl_shell_surface_ready(E_Client *ec);
+
EINTERN Eina_Bool e_shell_e_client_shell_assignable_check(E_Client *ec);
EINTERN void e_shell_e_client_shsurface_assign(E_Client *ec, struct wl_resource *shsurface, E_Shell_Surface_Api *api);
EINTERN void e_shell_e_client_shsurface_api_set(E_Client *ec, E_Shell_Surface_Api *api);
{
struct wl_global *wl_shell;
struct wl_global *xdg_shell_v5;
+ E_Comp_Wl_Shell *e_comp_wl_shell;
struct wl_listener display_destroy;
wl_signal_emit(&shell->events.destroy, shell);
+ e_comp_wl_shell_destroy(shell->e_comp_wl_shell);
wl_global_destroy(shell->wl_shell);
wl_global_destroy(shell->xdg_shell_v5);
wl_list_remove(&shell->display_destroy.link);
if (!shell)
return NULL;
+ wl_signal_init(&shell->events.destroy);
+ wl_signal_init(&shell->events.new_toplevel);
+
shell->wl_shell = e_desktop_wl_shell_create(display);
if (!shell->wl_shell)
goto err_wl_shell;
if (!e_desktop_xdg_shell_v6_init(display, shell))
goto err_xdg_shell_v6;
- wl_signal_init(&shell->events.destroy);
- wl_signal_init(&shell->events.new_toplevel);
+ shell->e_comp_wl_shell = e_comp_wl_shell_create(shell);
+ if (!shell->e_comp_wl_shell)
+ goto err_xdg_shell_v6;
shell->display_destroy.notify = _shell_cb_display_destroy;
wl_display_add_destroy_listener(display, &shell->display_destroy);
EINTERN void
e_desktop_shell_toplevel_add(E_Desktop_Shell *shell, E_Desktop_Toplevel *toplevel)
{
- e_comp_wl_shell_surface_ready(e_surface_ec_get(toplevel->surface.surface));
-
wl_signal_emit(&shell->events.new_toplevel, toplevel);
}