From 71c6290f14af5ce113a7029a2b56cf90e75b5f09 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Mon, 6 Jan 2025 10:16:47 +0900 Subject: [PATCH] e_comp_wl: Drop e_comp_wl_surface_role_{set,get} The e_comp_wl_surface_role is replaced by e_surface_role. Change-Id: I6820c11046f9e84796782f866a22f9fed1263f74 --- src/bin/server/e_comp_wl.c | 38 ------------------------------- src/bin/server/e_comp_wl_intern.h | 2 -- src/bin/server/e_compositor.c | 20 ++++++++-------- src/bin/server/e_foreign_shell.c | 5 ++-- src/include/e_comp_wl.h | 2 +- 5 files changed, 14 insertions(+), 53 deletions(-) diff --git a/src/bin/server/e_comp_wl.c b/src/bin/server/e_comp_wl.c index c4d03853da..06ac225408 100644 --- a/src/bin/server/e_comp_wl.c +++ b/src/bin/server/e_comp_wl.c @@ -5946,44 +5946,6 @@ e_comp_wl_surface_viewport_get(E_Client *ec, Eina_Rectangle *buffer_viewport, Ei return EINA_TRUE; } -EINTERN Eina_Bool -e_comp_wl_surface_role_set(E_Client *ec, const char *role_name, struct wl_resource *error_resource, uint32_t error_code) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(role_name, EINA_FALSE); - - /* Must be called with valid comp_data */ - EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE); - - if ((ec->comp_data->role_name == NULL) || - (ec->comp_data->role_name == role_name) || - (strcmp(ec->comp_data->role_name, role_name) == 0)) - { - ec->comp_data->role_name = role_name; - return EINA_TRUE; - } - - if (error_resource) - { - wl_resource_post_error(error_resource, error_code, - "Cannot assign role %s to wl_surface@%d," - " already has role %s\n", - role_name, - ec->comp_data->wl_surface ? - wl_resource_get_id(ec->comp_data->wl_surface) : -1, - ec->comp_data->role_name); - } - - return EINA_FALSE; -} - -EINTERN const char * -e_comp_wl_surface_role_get(E_Client *ec) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL); - return ec->comp_data ? ec->comp_data->role_name : NULL; -} - EINTERN struct wl_resource * e_comp_wl_client_surface_get(E_Client *ec) { diff --git a/src/bin/server/e_comp_wl_intern.h b/src/bin/server/e_comp_wl_intern.h index fc9390d34a..b6e38b1259 100644 --- a/src/bin/server/e_comp_wl_intern.h +++ b/src/bin/server/e_comp_wl_intern.h @@ -69,8 +69,6 @@ EINTERN Eina_Bool e_comp_wl_commit_sync_configure(E_Client *ec); EINTERN void e_comp_wl_surface_state_init(E_Comp_Wl_Surface_State *state, int w, int h); EINTERN void e_comp_wl_surface_state_finish(E_Comp_Wl_Surface_State *state); EINTERN Eina_Bool e_comp_wl_surface_viewport_get(E_Client *ec, Eina_Rectangle *buffer_viewport, Eina_Rectangle *output_viewport, unsigned int *transform); -EINTERN Eina_Bool e_comp_wl_surface_role_set(E_Client *ec, const char *role_name, struct wl_resource *error_resource, uint32_t error_code); -EINTERN const char *e_comp_wl_surface_role_get(E_Client *ec); EINTERN void e_comp_wl_client_surface_set(E_Client *ec, struct wl_resource *surface); EINTERN struct wl_resource *e_comp_wl_client_surface_get(E_Client *ec); diff --git a/src/bin/server/e_compositor.c b/src/bin/server/e_compositor.c index 77dd0abad0..389b4a24c9 100644 --- a/src/bin/server/e_compositor.c +++ b/src/bin/server/e_compositor.c @@ -48,6 +48,7 @@ struct _E_Surface E_Client_Hook *client_del_hook; + const char *role_name; struct wl_list frames; struct wl_listener destroy; @@ -547,11 +548,11 @@ e_surface_role_set(E_Surface *surface, const char *role_name, struct wl_resource EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(role_name, EINA_FALSE); - if ((surface->base.role_name == NULL) || - (surface->base.role_name == role_name) || - (strcmp(surface->base.role_name, role_name) == 0)) + if ((surface->role_name == NULL) || + (surface->role_name == role_name) || + (strcmp(surface->role_name, role_name) == 0)) { - surface->base.role_name = role_name; + surface->role_name = role_name; return EINA_TRUE; } @@ -561,9 +562,9 @@ e_surface_role_set(E_Surface *surface, const char *role_name, struct wl_resource "Cannot assign role %s to wl_surface@%d," " already has role %s\n", role_name, - surface->base.wl_surface ? - wl_resource_get_id(surface->base.wl_surface) : -1, - surface->base.role_name); + surface->ds_surface ? + wl_resource_get_id(ds_surface_get_wl_resource(surface->ds_surface)) : -1, + surface->role_name); } return EINA_FALSE; @@ -575,7 +576,7 @@ e_surface_role_unset(E_Surface *surface) { EINA_SAFETY_ON_NULL_RETURN(surface); - surface->base.role_name = NULL; + surface->role_name = NULL; } EINTERN void @@ -1510,8 +1511,7 @@ _e_subsurface_create(struct ds_subsurface *ds_subsurface, E_Surface *parent_surf return NULL; } - if (!e_comp_wl_surface_role_set(surface->ec, e_comp_wl_subsurface_role_name, - NULL, 0)) + if (!e_surface_role_set(surface, e_comp_wl_subsurface_role_name, NULL, 0)) { free(sub); return NULL; diff --git a/src/bin/server/e_foreign_shell.c b/src/bin/server/e_foreign_shell.c index 2a0e1af653..6c7c241045 100644 --- a/src/bin/server/e_foreign_shell.c +++ b/src/bin/server/e_foreign_shell.c @@ -5,6 +5,7 @@ #include "e_pixmap_intern.h" #include "e_view_intern.h" #include "e_view_client_intern.h" +#include "e_compositor_intern.h" #include @@ -208,8 +209,8 @@ e_foreign_shell_import(struct wl_resource *importer, struct wl_resource *resourc return EINA_FALSE; } - if (!e_comp_wl_surface_role_set(ec, e_foreign_shell_role_name, - importer, WTZ_IMPORTER_ERROR_ROLE)) + if (!e_surface_role_set(e_surface_from_ec(ec), e_foreign_shell_role_name, + importer, WTZ_IMPORTER_ERROR_ROLE)) return EINA_FALSE; fs = _e_foreign_shell_create(resource, ec, es); diff --git a/src/include/e_comp_wl.h b/src/include/e_comp_wl.h index 00f0d315d7..2f1aae349d 100644 --- a/src/include/e_comp_wl.h +++ b/src/include/e_comp_wl.h @@ -506,7 +506,7 @@ struct _E_Comp_Wl_Client_Data struct wl_resource *res_role; /* zxdg_toplevel_v6 or zxdg_popup_v6 */ } E_DEPRECATED sh_v6; - const char *role_name; + E_DEPRECATED const char *role_name; Eina_Bool wtz_surface_assigned; struct wl_list pointer_constraints; -- 2.34.1