diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 224ed4aa1..b0ebe6b64 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1559,7 +1559,7 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state) ec->want_focus |= ec->icccm.accepts_focus && (!ec->override); } } - else if (ec->comp_data->need_xdg6_configure && ec->comp_data->shell.surface) + else if (ec->comp_data->need_xdg_configure && ec->comp_data->shell.surface) _e_comp_wl_configure_send(ec, 0); state->sx = 0; @@ -1663,6 +1663,11 @@ _e_comp_wl_surface_cb_attach(struct wl_client *client EINA_UNUSED, struct wl_res if (!(ec = wl_resource_get_user_data(resource))) return; if (e_object_is_del(E_OBJECT(ec))) return; + if (ec->comp_data->need_xdg_configure) + { + ec->comp_data->shell.buffer_attach_error(ec); + return; + } if (buffer_resource) { diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 5235508c2..406a85d97 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -314,6 +314,7 @@ struct _E_Comp_Wl_Client_Data void (*ping)(struct wl_resource *resource); void (*map)(struct wl_resource *resource); void (*unmap)(struct wl_resource *resource); + void (*buffer_attach_error)(E_Client *ec); Eina_Rectangle window; E_Shell_Data *data; struct @@ -372,7 +373,7 @@ struct _E_Comp_Wl_Client_Data Eina_Bool is_xdg_surface E_BITFIELD; Eina_Bool grab E_BITFIELD; Eina_Bool buffer_commit E_BITFIELD; - Eina_Bool need_xdg6_configure E_BITFIELD; + Eina_Bool need_xdg_configure E_BITFIELD; Eina_Bool maximize_anims_disabled E_BITFIELD; Eina_Bool ssd_mouse_in E_BITFIELD; Eina_Bool need_center E_BITFIELD; diff --git a/src/modules/wl_desktop_shell/xdg6.c b/src/modules/wl_desktop_shell/xdg6.c index 4b5ea7cac..976ed13d7 100644 --- a/src/modules/wl_desktop_shell/xdg6.c +++ b/src/modules/wl_desktop_shell/xdg6.c @@ -374,7 +374,7 @@ _xdg_shell_surface_send_configure(struct wl_resource *resource, Eina_Bool fullsc zxdg_surface_v6_send_configure(shd->surface, serial); wl_array_release(&states); - ec->comp_data->need_xdg6_configure = 0; + ec->comp_data->need_xdg_configure = 0; } static void @@ -400,7 +400,7 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges serial = wl_display_next_serial(e_comp_wl->wl.disp); zxdg_popup_v6_send_configure(resource, ec->x - ec->parent->x, ec->y - ec->parent->y, width ?: ec->w, height ?: ec->h); zxdg_surface_v6_send_configure(shd->surface, serial); - ec->comp_data->need_xdg6_configure = 0; + ec->comp_data->need_xdg_configure = 0; return; } @@ -942,7 +942,7 @@ _e_xdg_surface_cb_popup_get(struct wl_client *client, struct wl_resource *resour cdata->shell.configure = _e_xdg_shell_surface_configure; cdata->shell.map = _e_xdg_shell_surface_map; cdata->shell.unmap = _e_xdg_shell_surface_unmap; - cdata->need_xdg6_configure = 1; + cdata->need_xdg_configure = 1; if (!ec->internal) ec->borderless = !ec->internal_elm_win; @@ -1245,7 +1245,7 @@ _e_xdg_surface_cb_toplevel_get(struct wl_client *client EINA_UNUSED, struct wl_r cdata->shell.configure = _e_xdg_shell_surface_configure; cdata->shell.map = _e_xdg_shell_surface_map; cdata->shell.unmap = _e_xdg_shell_surface_unmap; - cdata->need_xdg6_configure = 1; + cdata->need_xdg_configure = 1; /* set toplevel client properties */ ec->icccm.accepts_focus = 1; @@ -1291,6 +1291,14 @@ _e_xdg_shell_surface_cb_destroy(struct wl_resource *resource) e_shell_surface_cb_destroy(resource); } +static void +_e_xdg_shell_surface_buffer_attach_error(E_Client *ec) +{ + wl_resource_post_error(ec->comp_data->surface, + ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER, + "buffer attached/committed before configure"); +} + static void _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { @@ -1351,6 +1359,7 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resour e_object_ref(E_OBJECT(ec)); cdata->shell.ping = _e_xdg_shell_surface_ping; + cdata->shell.buffer_attach_error = _e_xdg_shell_surface_buffer_attach_error; cdata->is_xdg_surface = EINA_TRUE; if (!ec->internal)