wayland: remove xdg5 support

this has not been used or tested since last year and there are no major
compositors which lack xdg6 support
This commit is contained in:
Mike Blumenkrantz 2017-08-11 18:43:15 -04:00
parent 398ffe40a3
commit f00a49835d
6 changed files with 8 additions and 284 deletions

View File

@ -24,8 +24,6 @@ lib/ecore_wl2/teamwork-protocol.c \
lib/ecore_wl2/teamwork-client-protocol.h \
lib/ecore_wl2/session-recovery-client-protocol.h \
lib/ecore_wl2/session-recovery-protocol.c \
lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c \
lib/ecore_wl2/www-client-protocol.h \
lib/ecore_wl2/www-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
@ -51,8 +49,6 @@ lib/ecore_wl2/efl-aux-hints-client-protocol.h \
lib/ecore_wl2/teamwork-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h \
lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \
lib/ecore_wl2/session-recovery-protocol.c \

View File

@ -45,17 +45,6 @@ _ecore_wl2_display_signal_exit(void)
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, ev, NULL, NULL);
}
static void
_xdg_shell_cb_ping(void *data EINA_UNUSED, struct xdg_shell *shell, uint32_t serial)
{
xdg_shell_pong(shell, serial);
}
static const struct xdg_shell_listener _xdg_shell_listener =
{
_xdg_shell_cb_ping
};
static void
_dmabuf_cb_format(void *data EINA_UNUSED, struct zwp_linux_dmabuf_v1 *dmabuf EINA_UNUSED, uint32_t format EINA_UNUSED)
{
@ -440,7 +429,6 @@ _ecore_wl2_display_globals_cleanup(Ecore_Wl2_Display *ewd)
zwp_e_session_recovery_destroy(ewd->wl.session_recovery);
if (ewd->wl.www) www_destroy(ewd->wl.www);
if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell);
if (ewd->wl.xdg_shell) xdg_shell_destroy(ewd->wl.xdg_shell);
if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm);
if (ewd->wl.data_device_manager)
wl_data_device_manager_destroy(ewd->wl.data_device_manager);
@ -487,7 +475,9 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd)
_ecore_wl2_subsurf_unmap(subsurf);
_ecore_wl2_window_semi_free(window);
window->configure_serial = 0;
window->configure_ack = NULL;
window->zxdg_configure_ack = NULL;
window->zxdg_set_min_size = NULL;
window->zxdg_set_max_size = NULL;
}
ewd->recovery_timer =
@ -615,7 +605,6 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
const char *shells[] =
{
"zxdg_shell_v6",
"xdg_shell",
NULL
};
@ -630,27 +619,7 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
if (!global) return;
if ((!strcmp(global->interface, "xdg_shell")) &&
(!getenv("EFL_WAYLAND_DONT_USE_XDG_SHELL")))
{
Ecore_Wl2_Window *window;
ewd->wl.xdg_shell =
wl_registry_bind(ewd->wl.registry, global->id,
&xdg_shell_interface, 1);
xdg_shell_use_unstable_version(ewd->wl.xdg_shell,
XDG_V5_UNSTABLE_VERSION);
xdg_shell_add_listener(ewd->wl.xdg_shell, &_xdg_shell_listener, NULL);
ewd->shell_done = EINA_TRUE;
EINA_INLIST_FOREACH(ewd->windows, window)
if ((window->type != ECORE_WL2_WINDOW_TYPE_DND) &&
(window->type != ECORE_WL2_WINDOW_TYPE_NONE))
_ecore_wl2_window_shell_surface_init(window);
else
window->pending.configure = EINA_FALSE;
}
else if (!strcmp(global->interface, "zxdg_shell_v6"))
if (!strcmp(global->interface, "zxdg_shell_v6"))
{
ewd->wl.zxdg_shell =
wl_registry_bind(ewd->wl.registry, global->id,

View File

@ -10,9 +10,6 @@
#define EFL_TEAMWORK_VERSION 2
# include "teamwork-client-protocol.h"
# include "xdg-shell-unstable-v5-client-protocol.h"
# define XDG_V5_UNSTABLE_VERSION 5
# include "session-recovery-client-protocol.h"
# include "xdg-shell-unstable-v6-client-protocol.h"
@ -90,7 +87,6 @@ struct _Ecore_Wl2_Display
int data_device_manager_version;
struct wl_shm *shm;
struct zwp_linux_dmabuf_v1 *dmabuf;
struct xdg_shell *xdg_shell;
struct zxdg_shell_v6 *zxdg_shell;
struct www *www;
struct zwp_e_session_recovery *session_recovery;
@ -159,8 +155,6 @@ struct _Ecore_Wl2_Window
const char *role;
struct wl_surface *surface;
struct xdg_surface *xdg_surface;
struct xdg_popup *xdg_popup;
struct www_surface *www_surface;
struct zxdg_surface_v6 *zxdg_surface;
struct zxdg_toplevel_v6 *zxdg_toplevel;
@ -169,7 +163,6 @@ struct _Ecore_Wl2_Window
Eina_Stringshare *uuid;
uint32_t configure_serial;
void (*configure_ack)(struct xdg_surface *surface, uint32_t serial);
void (*zxdg_configure_ack)(struct zxdg_surface_v6 *surface, uint32_t serial);
void (*zxdg_set_min_size)(struct zxdg_toplevel_v6 *toplevel, int32_t w, int32_t h);
void (*zxdg_set_max_size)(struct zxdg_toplevel_v6 *toplevel, int32_t w, int32_t h);

View File

@ -17,12 +17,6 @@ _ecore_wl2_window_semi_free(Ecore_Wl2_Window *window)
if (window->zxdg_surface) zxdg_surface_v6_destroy(window->zxdg_surface);
window->zxdg_surface = NULL;
if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface);
window->xdg_surface = NULL;
if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup);
window->xdg_popup = NULL;
if (window->www_surface)
www_surface_destroy(window->www_surface);
window->www_surface = NULL;
@ -84,95 +78,6 @@ _ecore_wl2_window_deactivate_send(Ecore_Wl2_Window *window)
ecore_event_add(ECORE_WL2_EVENT_WINDOW_DEACTIVATE, ev, NULL, NULL);
}
static void
_xdg_popup_cb_done(void *data, struct xdg_popup *xdg_popup EINA_UNUSED)
{
Ecore_Wl2_Window *win;
win = data;
if (!win) return;
if (win->grab) _ecore_wl2_input_ungrab(win->grab);
}
static const struct xdg_popup_listener _xdg_popup_listener =
{
_xdg_popup_cb_done,
};
static void
_xdg_surface_cb_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSED, int32_t w, int32_t h, struct wl_array *states, uint32_t serial)
{
Ecore_Wl2_Window *win = data;
uint32_t *s;
Eina_Bool fs, max;
if ((!win->maximized) && (!win->fullscreen))
win->saved = win->geometry;
fs = win->fullscreen;
max = win->maximized;
win->minimized = EINA_FALSE;
win->maximized = EINA_FALSE;
win->fullscreen = EINA_FALSE;
win->focused = EINA_FALSE;
win->resizing = EINA_FALSE;
wl_array_for_each(s, states)
{
switch (*s)
{
case XDG_SURFACE_STATE_MAXIMIZED:
win->maximized = EINA_TRUE;
break;
case XDG_SURFACE_STATE_FULLSCREEN:
win->fullscreen = EINA_TRUE;
break;
case XDG_SURFACE_STATE_RESIZING:
win->resizing = EINA_TRUE;
break;
case XDG_SURFACE_STATE_ACTIVATED:
win->focused = EINA_TRUE;
win->minimized = EINA_FALSE;
default:
break;
}
}
win->configure_serial = serial;
if ((win->geometry.w == w) && (win->geometry.h == h))
w = h = 0;
else if ((!w) && (!h) && (!win->fullscreen) && (!win->maximized) &&
((win->fullscreen != fs) || (win->maximized != max)))
w = win->saved.w, h = win->saved.h;
_ecore_wl2_window_configure_send(win, w, h, !!win->resizing,
win->fullscreen, win->maximized);
if (win->focused)
_ecore_wl2_window_activate_send(win);
else
_ecore_wl2_window_deactivate_send(win);
}
static void
_xdg_surface_cb_delete(void *data, struct xdg_surface *xdg_surface EINA_UNUSED)
{
Ecore_Wl2_Window *win;
win = data;
if (!win) return;
ecore_wl2_window_free(win);
}
static const struct xdg_surface_listener _xdg_surface_listener =
{
_xdg_surface_cb_configure,
_xdg_surface_cb_delete,
};
static void
_zxdg_surface_cb_configure(void *data, struct zxdg_surface_v6 *zxdg_surface EINA_UNUSED, uint32_t serial)
{
@ -323,54 +228,6 @@ _ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
wl_surface_commit(win->surface);
}
static void
_ecore_wl2_window_type_set(Ecore_Wl2_Window *win)
{
switch (win->type)
{
case ECORE_WL2_WINDOW_TYPE_MENU:
{
if (win->zxdg_surface)
_ecore_wl2_window_zxdg_popup_create(win);
else if (win->xdg_surface)
{
EINA_SAFETY_ON_TRUE_RETURN(!win->parent);
EINA_SAFETY_ON_TRUE_RETURN(!win->grab);
win->xdg_popup =
xdg_shell_get_xdg_popup(win->display->wl.xdg_shell,
win->surface, win->parent->surface,
win->grab->wl.seat,
wl_display_get_serial(win->display->wl.display),
win->geometry.x, win->geometry.y);
if (!win->xdg_popup)
{
ERR("Could not create xdg popup");
return;
}
xdg_popup_set_user_data(win->xdg_popup, win);
xdg_popup_add_listener(win->xdg_popup,
&_xdg_popup_listener, win);
}
}
break;
case ECORE_WL2_WINDOW_TYPE_TOPLEVEL:
if (win->zxdg_surface)
{
struct zxdg_toplevel_v6 *ptop = NULL;
if (win->parent)
ptop = win->parent->zxdg_toplevel;
if (ptop)
zxdg_toplevel_v6_set_parent(win->zxdg_toplevel, ptop);
}
break;
default:
break;
}
}
static void
_www_surface_end_drag(void *data, struct www_surface *www_surface EINA_UNUSED)
{
@ -490,31 +347,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
wl_surface_commit(window->surface);
}
else if ((window->display->wl.xdg_shell) && (!window->xdg_surface))
{
window->xdg_surface =
xdg_shell_get_xdg_surface(window->display->wl.xdg_shell,
window->surface);
if (!window->xdg_surface) goto surf_err;
if (window->title)
xdg_surface_set_title(window->xdg_surface, window->title);
if (window->class)
xdg_surface_set_app_id(window->xdg_surface, window->class);
xdg_surface_set_user_data(window->xdg_surface, window);
xdg_surface_add_listener(window->xdg_surface,
&_xdg_surface_listener, window);
window->configure_ack = xdg_surface_ack_configure;
window->pending.configure = EINA_FALSE;
if (window->maximized)
xdg_surface_set_maximized(window->xdg_surface);
if (window->fullscreen)
xdg_surface_set_fullscreen(window->xdg_surface, NULL);
_ecore_wl2_window_type_set(window);
}
if (window->display->wl.session_recovery)
{
@ -528,12 +360,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
window->geometry.y,
window->geometry.w,
window->geometry.h);
else if (window->xdg_surface)
xdg_surface_set_window_geometry(window->xdg_surface,
window->geometry.x,
window->geometry.y,
window->geometry.w,
window->geometry.h);
ecore_wl2_window_opaque_region_set(window,
window->opaque.x,
@ -544,11 +370,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
else
zwp_e_session_recovery_get_uuid(window->display->wl.session_recovery, window->surface);
}
return;
surf_err:
ERR("Failed to create surface for window");
}
void
@ -717,7 +538,9 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
}
window->configure_serial = 0;
window->configure_ack = NULL;
window->zxdg_configure_ack = NULL;
window->zxdg_set_min_size = NULL;
window->zxdg_set_max_size = NULL;
}
static void
@ -781,9 +604,6 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat,
window->display->serial);
else if (window->xdg_surface)
xdg_surface_move(window->xdg_surface, input->wl.seat,
window->display->serial);
}
EAPI void
@ -797,9 +617,6 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
if (window->zxdg_toplevel)
zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat,
window->display->serial, location);
else if (window->xdg_surface)
xdg_surface_resize(window->xdg_surface, input->wl.seat,
window->display->serial, location);
}
EAPI void
@ -820,19 +637,6 @@ ecore_wl2_window_raise(Ecore_Wl2_Window *window)
window->geometry.h, &states);
wl_array_release(&states);
}
else if (window->xdg_surface)
{
struct wl_array states;
uint32_t *s;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
_xdg_surface_cb_configure(window, window->xdg_surface,
window->geometry.w, window->geometry.h,
&states, 0);
wl_array_release(&states);
}
}
EAPI Eina_Bool
@ -1046,15 +850,11 @@ ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
else if (window->xdg_surface)
xdg_surface_set_maximized(window->xdg_surface);
}
else
{
if (window->zxdg_toplevel)
zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
else if (window->xdg_surface)
xdg_surface_unset_maximized(window->xdg_surface);
}
}
@ -1086,15 +886,11 @@ ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
else if (window->xdg_surface)
xdg_surface_set_fullscreen(window->xdg_surface, NULL);
}
else
{
if (window->zxdg_toplevel)
zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
else if (window->xdg_surface)
xdg_surface_unset_fullscreen(window->xdg_surface);
}
}
@ -1124,8 +920,6 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
else if (window->xdg_surface)
xdg_surface_set_title(window->xdg_surface, window->title);
}
EAPI void
@ -1138,8 +932,6 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
else if (window->xdg_surface)
xdg_surface_set_app_id(window->xdg_surface, window->class);
}
EAPI void
@ -1169,8 +961,6 @@ ecore_wl2_window_geometry_set(Ecore_Wl2_Window *window, int x, int y, int w, int
if (window->zxdg_toplevel)
zxdg_surface_v6_set_window_geometry(window->zxdg_surface, x, y, w, h);
else if (window->xdg_surface)
xdg_surface_set_window_geometry(window->xdg_surface, x, y, w, h);
}
EAPI Eina_Bool
@ -1198,8 +988,6 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
{
if (window->zxdg_toplevel)
zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel);
else if (window->xdg_surface)
xdg_surface_set_minimized(window->xdg_surface);
}
else
{
@ -1216,19 +1004,6 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
window->geometry.h, &states);
wl_array_release(&states);
}
else if (window->xdg_surface)
{
struct wl_array states;
uint32_t *s;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
_xdg_surface_cb_configure(window, window->xdg_surface,
window->geometry.w, window->geometry.h,
&states, 0);
wl_array_release(&states);
}
}
}
@ -1260,7 +1035,7 @@ ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return (window->xdg_surface || window->zxdg_surface);
return !!window->zxdg_surface;
}
EAPI Eina_Bool

View File

@ -4161,9 +4161,6 @@ _elm_win_frame_cb_menu(void *data,
if (sd->wl.win->zxdg_toplevel)
zxdg_toplevel_v6_show_window_menu(sd->wl.win->zxdg_toplevel,
ecore_wl2_input_seat_get(input), 0, x, y);
else if (sd->wl.win->xdg_surface)
xdg_surface_show_window_menu(sd->wl.win->xdg_surface,
ecore_wl2_input_seat_get(input), 0, x, y);
#else
(void)sd;
#endif

View File

@ -463,9 +463,6 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
if (wdata->win->zxdg_configure_ack)
wdata->win->zxdg_configure_ack(wdata->win->zxdg_surface,
wdata->win->configure_serial);
else if (wdata->win->configure_ack)
wdata->win->configure_ack(wdata->win->xdg_surface,
wdata->win->configure_serial);
wdata->win->configure_serial = 0;
wl_surface_commit(wdata->win->surface);
}
@ -1662,9 +1659,6 @@ _ecore_evas_wl_common_render_flush_pre(void *data, Evas *evas, void *event EINA_
if (wdata->win->zxdg_configure_ack && wdata->win->configure_serial)
wdata->win->zxdg_configure_ack(wdata->win->zxdg_surface,
wdata->win->configure_serial);
else if (wdata->win->configure_ack && wdata->win->configure_serial)
wdata->win->configure_ack(wdata->win->xdg_surface,
wdata->win->configure_serial);
wdata->win->configure_serial = 0;
/* Surviving bits of WWW - track interesting state we might want