forked from enlightenment/efl
wayland: add xdg-shell vfinal support for client-side
@feature
This commit is contained in:
parent
79ca67d8a5
commit
ffa276fce3
|
@ -2141,7 +2141,7 @@ AC_ARG_ENABLE([wayland],
|
|||
[want_wayland="no"])
|
||||
|
||||
if test "${want_wayland}" = "yes"; then
|
||||
EFL_PKG_CHECK_STRICT([wayland-client >= 1.11.0 wayland-scanner >= 1.11.0 wayland-protocols >= 1.9])
|
||||
EFL_PKG_CHECK_STRICT([wayland-client >= 1.11.0 wayland-scanner >= 1.11.0 wayland-protocols >= 1.12])
|
||||
PKG_CHECK_MODULES([WAYLAND], [wayland-scanner >= 1.11.0],
|
||||
[
|
||||
AC_ARG_VAR([wayland_scanner], [The wayland-scanner executable])
|
||||
|
|
|
@ -40,6 +40,8 @@ lib/ecore_wl2/www-client-protocol.h \
|
|||
lib/ecore_wl2/www-protocol.c \
|
||||
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
|
||||
lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h \
|
||||
lib/ecore_wl2/xdg-shell-client-protocol.h \
|
||||
lib/ecore_wl2/xdg-shell-protocol.c \
|
||||
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
|
||||
lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
|
||||
lib/ecore_wl2/text-input-unstable-v1-client-protocol.h \
|
||||
|
@ -59,6 +61,8 @@ lib/ecore_wl2/efl-aux-hints-client-protocol.h \
|
|||
lib/ecore_wl2/www-protocol.c \
|
||||
lib/ecore_wl2/teamwork-protocol.c \
|
||||
lib/ecore_wl2/teamwork-client-protocol.h \
|
||||
lib/ecore_wl2/xdg-shell-client-protocol.h \
|
||||
lib/ecore_wl2/xdg-shell-protocol.c \
|
||||
lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h \
|
||||
lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c \
|
||||
lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c \
|
||||
|
@ -70,4 +74,6 @@ lib/ecore_wl2/efl-aux-hints-client-protocol.h \
|
|||
lib/ecore_wl2/efl-hints-client-protocol.h \
|
||||
lib/ecore_wl2/efl-hints-protocol.c
|
||||
|
||||
EXTRA_DIST2 += lib/ecore_wl2/window_v6.x
|
||||
|
||||
endif
|
||||
|
|
|
@ -58,6 +58,17 @@ static const struct zwp_linux_dmabuf_v1_listener _dmabuf_listener =
|
|||
_dmabuf_cb_format
|
||||
};
|
||||
|
||||
static void
|
||||
_xdg_shell_cb_ping(void *data EINA_UNUSED, struct xdg_wm_base *shell, uint32_t serial)
|
||||
{
|
||||
xdg_wm_base_pong(shell, serial);
|
||||
}
|
||||
|
||||
static const struct xdg_wm_base_listener _xdg_shell_listener =
|
||||
{
|
||||
_xdg_shell_cb_ping,
|
||||
};
|
||||
|
||||
static void
|
||||
_zxdg_shell_cb_ping(void *data EINA_UNUSED, struct zxdg_shell_v6 *shell, uint32_t serial)
|
||||
{
|
||||
|
@ -337,13 +348,13 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
|
|||
ewd->wl.efl_hints = wl_registry_bind(registry, id, &efl_hints_interface, MIN(version, 2));
|
||||
EINA_INLIST_FOREACH(ewd->windows, window)
|
||||
{
|
||||
if (!window->zxdg_surface) continue;
|
||||
if (!window->xdg_surface) continue;
|
||||
if (window->aspect.set)
|
||||
efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_surface,
|
||||
efl_hints_set_aspect(window->display->wl.efl_hints, window->xdg_surface,
|
||||
window->aspect.w, window->aspect.h, window->aspect.aspect);
|
||||
if (window->weight.set)
|
||||
efl_hints_set_weight(window->display->wl.efl_hints,
|
||||
window->zxdg_surface, window->weight.w, window->weight.h);
|
||||
window->xdg_surface, window->weight.w, window->weight.h);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -438,6 +449,7 @@ _ecore_wl2_display_globals_cleanup(Ecore_Wl2_Display *ewd)
|
|||
if (ewd->wl.session_recovery)
|
||||
zwp_e_session_recovery_destroy(ewd->wl.session_recovery);
|
||||
if (ewd->wl.www) www_destroy(ewd->wl.www);
|
||||
if (ewd->wl.xdg_wm_base) xdg_wm_base_destroy(ewd->wl.xdg_wm_base);
|
||||
if (ewd->wl.zxdg_shell) zxdg_shell_v6_destroy(ewd->wl.zxdg_shell);
|
||||
if (ewd->wl.shm) wl_shm_destroy(ewd->wl.shm);
|
||||
if (ewd->wl.data_device_manager)
|
||||
|
@ -488,6 +500,9 @@ _recovery_timer_add(Ecore_Wl2_Display *ewd)
|
|||
_ecore_wl2_window_semi_free(window);
|
||||
window->set_config.serial = 0;
|
||||
window->req_config.serial = 0;
|
||||
window->xdg_configure_ack = NULL;
|
||||
window->xdg_set_min_size = NULL;
|
||||
window->xdg_set_max_size = NULL;
|
||||
window->zxdg_configure_ack = NULL;
|
||||
window->zxdg_set_min_size = NULL;
|
||||
window->zxdg_set_max_size = NULL;
|
||||
|
@ -611,6 +626,7 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
|
|||
const char **itr;
|
||||
const char *shells[] =
|
||||
{
|
||||
"xdg_wm_base",
|
||||
"zxdg_shell_v6",
|
||||
NULL
|
||||
};
|
||||
|
@ -626,7 +642,16 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
|
|||
|
||||
if (!global) return;
|
||||
|
||||
if (!strcmp(global->interface, "zxdg_shell_v6"))
|
||||
if (!strcmp(global->interface, "xdg_wm_base"))
|
||||
{
|
||||
ewd->wl.xdg_wm_base =
|
||||
wl_registry_bind(ewd->wl.registry, global->id,
|
||||
&xdg_wm_base_interface, 1);
|
||||
xdg_wm_base_add_listener(ewd->wl.xdg_wm_base,
|
||||
&_xdg_shell_listener, NULL);
|
||||
ewd->shell_done = EINA_TRUE;
|
||||
}
|
||||
else if (!strcmp(global->interface, "zxdg_shell_v6"))
|
||||
{
|
||||
ewd->wl.zxdg_shell =
|
||||
wl_registry_bind(ewd->wl.registry, global->id,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
# include "session-recovery-client-protocol.h"
|
||||
|
||||
# include "xdg-shell-client-protocol.h"
|
||||
# include "xdg-shell-unstable-v6-client-protocol.h"
|
||||
# include "efl-aux-hints-client-protocol.h"
|
||||
|
||||
|
@ -88,6 +89,7 @@ struct _Ecore_Wl2_Display
|
|||
struct wl_shm *shm;
|
||||
struct zwp_linux_dmabuf_v1 *dmabuf;
|
||||
struct zxdg_shell_v6 *zxdg_shell;
|
||||
struct xdg_wm_base *xdg_wm_base;
|
||||
struct www *www;
|
||||
struct zwp_e_session_recovery *session_recovery;
|
||||
struct efl_aux_hints *efl_aux_hints;
|
||||
|
@ -181,12 +183,20 @@ struct _Ecore_Wl2_Window
|
|||
void *buffer;
|
||||
struct wl_callback *callback;
|
||||
struct www_surface *www_surface;
|
||||
struct xdg_surface *xdg_surface;
|
||||
struct xdg_toplevel *xdg_toplevel;
|
||||
struct xdg_popup *xdg_popup;
|
||||
|
||||
struct zxdg_surface_v6 *zxdg_surface;
|
||||
struct zxdg_toplevel_v6 *zxdg_toplevel;
|
||||
struct zxdg_popup_v6 *zxdg_popup;
|
||||
|
||||
Eina_Stringshare *uuid;
|
||||
|
||||
void (*xdg_configure_ack)(struct xdg_surface *surface, uint32_t serial);
|
||||
void (*xdg_set_min_size)(struct xdg_toplevel *toplevel, int32_t w, int32_t h);
|
||||
void (*xdg_set_max_size)(struct xdg_toplevel *toplevel, int32_t w, int32_t h);
|
||||
|
||||
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);
|
||||
|
|
|
@ -8,6 +8,15 @@
|
|||
void
|
||||
_ecore_wl2_window_semi_free(Ecore_Wl2_Window *window)
|
||||
{
|
||||
if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup);
|
||||
window->xdg_popup = NULL;
|
||||
|
||||
if (window->xdg_toplevel) xdg_toplevel_destroy(window->xdg_toplevel);
|
||||
window->xdg_toplevel = NULL;
|
||||
|
||||
if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface);
|
||||
window->xdg_surface = NULL;
|
||||
|
||||
if (window->zxdg_popup) zxdg_popup_v6_destroy(window->zxdg_popup);
|
||||
window->zxdg_popup = NULL;
|
||||
|
||||
|
@ -109,143 +118,7 @@ _configure_complete(Ecore_Wl2_Window *window)
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
_zxdg_surface_cb_configure(void *data, struct zxdg_surface_v6 *zxdg_surface EINA_UNUSED, uint32_t serial)
|
||||
{
|
||||
Ecore_Wl2_Window *window;
|
||||
|
||||
window = data;
|
||||
window->def_config.serial = serial;
|
||||
|
||||
if (window->pending.configure)
|
||||
{
|
||||
window->saved.w = window->set_config.geometry.w;
|
||||
window->saved.h = window->set_config.geometry.h;
|
||||
_configure_complete(window);
|
||||
}
|
||||
if (window->pending.configure && window->updating)
|
||||
ERR("Window shouldn't be rendering before initial configure");
|
||||
|
||||
if (!window->updating)
|
||||
_ecore_wl2_window_configure_send(window);
|
||||
}
|
||||
|
||||
static const struct zxdg_surface_v6_listener _zxdg_surface_listener =
|
||||
{
|
||||
_zxdg_surface_cb_configure,
|
||||
};
|
||||
|
||||
static void
|
||||
_zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states)
|
||||
{
|
||||
Ecore_Wl2_Window *win = data;
|
||||
uint32_t *s;
|
||||
|
||||
win->def_config.minimized = EINA_FALSE;
|
||||
win->def_config.maximized = EINA_FALSE;
|
||||
win->def_config.fullscreen = EINA_FALSE;
|
||||
win->def_config.focused = EINA_FALSE;
|
||||
win->def_config.resizing = EINA_FALSE;
|
||||
win->def_config.geometry.w = width;
|
||||
win->def_config.geometry.h = height;
|
||||
|
||||
wl_array_for_each(s, states)
|
||||
{
|
||||
switch (*s)
|
||||
{
|
||||
case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
|
||||
win->def_config.maximized = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
|
||||
win->def_config.fullscreen = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
|
||||
win->def_config.resizing = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
|
||||
win->def_config.focused = EINA_TRUE;
|
||||
win->def_config.minimized = EINA_FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_zxdg_toplevel_cb_close(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED)
|
||||
{
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = data;
|
||||
if (!win) return;
|
||||
|
||||
ecore_wl2_window_free(win);
|
||||
}
|
||||
|
||||
static const struct zxdg_toplevel_v6_listener _zxdg_toplevel_listener =
|
||||
{
|
||||
_zxdg_toplevel_cb_configure,
|
||||
_zxdg_toplevel_cb_close,
|
||||
};
|
||||
|
||||
static void
|
||||
_zxdg_popup_cb_configure(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t width, int32_t height)
|
||||
{
|
||||
Ecore_Wl2_Window *win = data;
|
||||
win->def_config.geometry.w = width;
|
||||
win->def_config.geometry.h = height;
|
||||
}
|
||||
|
||||
static void
|
||||
_zxdg_popup_cb_done(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED)
|
||||
{
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = data;
|
||||
if (!win) return;
|
||||
|
||||
if (win->grab) _ecore_wl2_input_ungrab(win->grab);
|
||||
}
|
||||
|
||||
static const struct zxdg_popup_v6_listener _zxdg_popup_listener =
|
||||
{
|
||||
_zxdg_popup_cb_configure,
|
||||
_zxdg_popup_cb_done,
|
||||
};
|
||||
|
||||
static void
|
||||
_ecore_wl2_window_zxdg_popup_create(Ecore_Wl2_Window *win)
|
||||
{
|
||||
struct zxdg_positioner_v6 *pos;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
||||
pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
|
||||
if (!pos) return;
|
||||
|
||||
zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x,
|
||||
win->set_config.geometry.y,
|
||||
1, 1);
|
||||
zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w,
|
||||
win->set_config.geometry.h);
|
||||
zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
|
||||
ZXDG_POSITIONER_V6_ANCHOR_LEFT);
|
||||
zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
||||
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
|
||||
|
||||
win->zxdg_popup = zxdg_surface_v6_get_popup(win->zxdg_surface,
|
||||
win->parent->zxdg_surface, pos);
|
||||
|
||||
zxdg_positioner_v6_destroy(pos);
|
||||
if (win->grab)
|
||||
zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
|
||||
wl_display_get_serial(win->display->wl.display));
|
||||
zxdg_popup_v6_set_user_data(win->zxdg_popup, win);
|
||||
zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win);
|
||||
|
||||
win->pending.configure = EINA_TRUE;
|
||||
|
||||
ecore_wl2_window_commit(win, EINA_TRUE);
|
||||
}
|
||||
#include "window_v6.x"
|
||||
|
||||
static void
|
||||
_www_surface_end_drag(void *data, struct www_surface *www_surface EINA_UNUSED)
|
||||
|
@ -310,73 +183,222 @@ _ecore_wl2_window_www_surface_init(Ecore_Wl2_Window *window)
|
|||
window);
|
||||
}
|
||||
|
||||
void
|
||||
_ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
|
||||
{
|
||||
if (!window->surface) return;
|
||||
if ((window->display->wl.zxdg_shell) && (!window->zxdg_surface))
|
||||
{
|
||||
window->zxdg_surface =
|
||||
zxdg_shell_v6_get_xdg_surface(window->display->wl.zxdg_shell,
|
||||
window->surface);
|
||||
zxdg_surface_v6_set_user_data(window->zxdg_surface, window);
|
||||
zxdg_surface_v6_add_listener(window->zxdg_surface,
|
||||
&_zxdg_surface_listener, window);
|
||||
|
||||
window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
|
||||
static void
|
||||
_xdg_surface_cb_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSED, uint32_t serial)
|
||||
{
|
||||
Ecore_Wl2_Window *window;
|
||||
|
||||
window = data;
|
||||
window->def_config.serial = serial;
|
||||
|
||||
if (window->pending.configure)
|
||||
{
|
||||
window->saved.w = window->set_config.geometry.w;
|
||||
window->saved.h = window->set_config.geometry.h;
|
||||
_configure_complete(window);
|
||||
}
|
||||
if (window->pending.configure && window->updating)
|
||||
ERR("Window shouldn't be rendering before initial configure");
|
||||
|
||||
if (!window->updating)
|
||||
_ecore_wl2_window_configure_send(window);
|
||||
}
|
||||
|
||||
static const struct xdg_surface_listener _xdg_surface_listener =
|
||||
{
|
||||
_xdg_surface_cb_configure,
|
||||
};
|
||||
|
||||
static void
|
||||
_xdg_toplevel_cb_configure(void *data, struct xdg_toplevel *xdg_toplevel EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states)
|
||||
{
|
||||
Ecore_Wl2_Window *win = data;
|
||||
uint32_t *s;
|
||||
|
||||
win->def_config.minimized = EINA_FALSE;
|
||||
win->def_config.maximized = EINA_FALSE;
|
||||
win->def_config.fullscreen = EINA_FALSE;
|
||||
win->def_config.focused = EINA_FALSE;
|
||||
win->def_config.resizing = EINA_FALSE;
|
||||
win->def_config.geometry.w = width;
|
||||
win->def_config.geometry.h = height;
|
||||
|
||||
wl_array_for_each(s, states)
|
||||
{
|
||||
switch (*s)
|
||||
{
|
||||
case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
|
||||
win->def_config.maximized = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
|
||||
win->def_config.fullscreen = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
|
||||
win->def_config.resizing = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
|
||||
win->def_config.focused = EINA_TRUE;
|
||||
win->def_config.minimized = EINA_FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_xdg_toplevel_cb_close(void *data, struct xdg_toplevel *xdg_toplevel EINA_UNUSED)
|
||||
{
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = data;
|
||||
if (!win) return;
|
||||
|
||||
ecore_wl2_window_free(win);
|
||||
}
|
||||
|
||||
static const struct xdg_toplevel_listener _xdg_toplevel_listener =
|
||||
{
|
||||
_xdg_toplevel_cb_configure,
|
||||
_xdg_toplevel_cb_close,
|
||||
};
|
||||
|
||||
static void
|
||||
_xdg_popup_cb_configure(void *data, struct xdg_popup *xdg_popup EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t width, int32_t height)
|
||||
{
|
||||
Ecore_Wl2_Window *win = data;
|
||||
win->def_config.geometry.w = width;
|
||||
win->def_config.geometry.h = height;
|
||||
}
|
||||
|
||||
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_configure,
|
||||
_xdg_popup_cb_done,
|
||||
};
|
||||
|
||||
static void
|
||||
_ecore_wl2_window_xdg_popup_create(Ecore_Wl2_Window *win)
|
||||
{
|
||||
struct xdg_positioner *pos;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
||||
pos = xdg_wm_base_create_positioner(win->display->wl.xdg_wm_base);
|
||||
if (!pos) return;
|
||||
|
||||
xdg_positioner_set_anchor_rect(pos, win->set_config.geometry.x,
|
||||
win->set_config.geometry.y,
|
||||
1, 1);
|
||||
xdg_positioner_set_size(pos, win->set_config.geometry.w,
|
||||
win->set_config.geometry.h);
|
||||
xdg_positioner_set_anchor(pos, XDG_POSITIONER_ANCHOR_TOP_LEFT);
|
||||
xdg_positioner_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
||||
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
|
||||
|
||||
win->xdg_popup = xdg_surface_get_popup(win->xdg_surface,
|
||||
win->parent->xdg_surface, pos);
|
||||
|
||||
xdg_positioner_destroy(pos);
|
||||
if (win->grab)
|
||||
xdg_popup_grab(win->xdg_popup, win->grab->wl.seat,
|
||||
wl_display_get_serial(win->display->wl.display));
|
||||
xdg_popup_set_user_data(win->xdg_popup, win);
|
||||
xdg_popup_add_listener(win->xdg_popup, &_xdg_popup_listener, win);
|
||||
|
||||
win->pending.configure = EINA_TRUE;
|
||||
|
||||
ecore_wl2_window_commit(win, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_window_shell_surface_create(Ecore_Wl2_Window *window)
|
||||
{
|
||||
if (window->xdg_surface) return;
|
||||
window->xdg_surface =
|
||||
xdg_wm_base_get_xdg_surface(window->display->wl.xdg_wm_base,
|
||||
window->surface);
|
||||
xdg_surface_set_user_data(window->xdg_surface, window);
|
||||
xdg_surface_add_listener(window->xdg_surface,
|
||||
&_xdg_surface_listener, window);
|
||||
|
||||
window->xdg_configure_ack = xdg_surface_ack_configure;
|
||||
window->pending.configure = EINA_TRUE;
|
||||
if (window->display->wl.efl_hints)
|
||||
{
|
||||
if (window->aspect.set)
|
||||
efl_hints_set_aspect(window->display->wl.efl_hints, window->zxdg_surface,
|
||||
efl_hints_set_aspect(window->display->wl.efl_hints, window->xdg_surface,
|
||||
window->aspect.w, window->aspect.h, window->aspect.aspect);
|
||||
if (window->weight.set)
|
||||
efl_hints_set_weight(window->display->wl.efl_hints, window->zxdg_surface,
|
||||
efl_hints_set_weight(window->display->wl.efl_hints, window->xdg_surface,
|
||||
window->weight.w, window->weight.h);
|
||||
}
|
||||
|
||||
if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
|
||||
_ecore_wl2_window_zxdg_popup_create(window);
|
||||
_ecore_wl2_window_xdg_popup_create(window);
|
||||
else
|
||||
{
|
||||
struct zxdg_toplevel_v6 *ptop = NULL;
|
||||
struct xdg_toplevel *ptop = NULL;
|
||||
|
||||
window->zxdg_toplevel =
|
||||
zxdg_surface_v6_get_toplevel(window->zxdg_surface);
|
||||
zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
|
||||
zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
|
||||
&_zxdg_toplevel_listener, window);
|
||||
window->xdg_toplevel =
|
||||
xdg_surface_get_toplevel(window->xdg_surface);
|
||||
xdg_toplevel_set_user_data(window->xdg_toplevel, window);
|
||||
xdg_toplevel_add_listener(window->xdg_toplevel,
|
||||
&_xdg_toplevel_listener, window);
|
||||
|
||||
if (window->title)
|
||||
zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
|
||||
xdg_toplevel_set_title(window->xdg_toplevel, window->title);
|
||||
if (window->class)
|
||||
zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
|
||||
xdg_toplevel_set_app_id(window->xdg_toplevel, window->class);
|
||||
|
||||
window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
|
||||
window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
|
||||
window->xdg_set_min_size = xdg_toplevel_set_min_size;
|
||||
window->xdg_set_max_size = xdg_toplevel_set_max_size;
|
||||
|
||||
if (window->parent)
|
||||
ptop = window->parent->zxdg_toplevel;
|
||||
ptop = window->parent->xdg_toplevel;
|
||||
|
||||
if (ptop)
|
||||
zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
|
||||
xdg_toplevel_set_parent(window->xdg_toplevel, ptop);
|
||||
|
||||
if (window->set_config.maximized)
|
||||
zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
|
||||
xdg_toplevel_set_maximized(window->xdg_toplevel);
|
||||
|
||||
if (window->set_config.fullscreen)
|
||||
zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
|
||||
xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL);
|
||||
}
|
||||
|
||||
ecore_wl2_window_commit(window, EINA_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
_ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
|
||||
{
|
||||
if (!window->surface) return;
|
||||
if (window->display->wl.xdg_wm_base) _window_shell_surface_create(window);
|
||||
if (window->display->wl.zxdg_shell) _window_v6_shell_surface_create(window);
|
||||
|
||||
if (window->display->wl.session_recovery)
|
||||
{
|
||||
if (window->uuid)
|
||||
{
|
||||
zwp_e_session_recovery_set_uuid(window->display->wl.session_recovery,
|
||||
window->surface, window->uuid);
|
||||
if (window->xdg_surface)
|
||||
xdg_surface_set_window_geometry(window->xdg_surface,
|
||||
window->set_config.geometry.x,
|
||||
window->set_config.geometry.y,
|
||||
window->set_config.geometry.w,
|
||||
window->set_config.geometry.h);
|
||||
if (window->zxdg_surface)
|
||||
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
|
||||
window->set_config.geometry.x,
|
||||
|
@ -571,6 +593,9 @@ ecore_wl2_window_hide(Ecore_Wl2_Window *window)
|
|||
window->req_config.serial = 0;
|
||||
window->def_config.serial = 0;
|
||||
window->zxdg_configure_ack = NULL;
|
||||
window->xdg_configure_ack = NULL;
|
||||
window->xdg_set_min_size = NULL;
|
||||
window->xdg_set_max_size = NULL;
|
||||
window->zxdg_set_min_size = NULL;
|
||||
window->zxdg_set_max_size = NULL;
|
||||
}
|
||||
|
@ -637,6 +662,9 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
|
|||
|
||||
window->moving = EINA_TRUE;
|
||||
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_move(window->xdg_toplevel, input->wl.seat,
|
||||
window->display->serial);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat,
|
||||
window->display->serial);
|
||||
|
@ -651,6 +679,9 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
|
|||
if (!input)
|
||||
input = EINA_INLIST_CONTAINER_GET(window->display->inputs, Ecore_Wl2_Input);
|
||||
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_resize(window->xdg_toplevel, input->wl.seat,
|
||||
window->display->serial, location);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat,
|
||||
window->display->serial, location);
|
||||
|
@ -847,11 +878,15 @@ ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool maximized)
|
|||
if (!window->set_config.fullscreen)
|
||||
window->saved = window->set_config.geometry;
|
||||
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_maximized(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_unset_maximized(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
|
||||
}
|
||||
|
@ -889,11 +924,15 @@ ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
|
|||
if (!window->set_config.maximized)
|
||||
window->saved = window->set_config.geometry;
|
||||
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_unset_fullscreen(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
|
||||
}
|
||||
|
@ -924,6 +963,8 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
|
|||
eina_stringshare_replace(&window->title, title);
|
||||
if (!window->title) return;
|
||||
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_title(window->xdg_toplevel, window->title);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
|
||||
}
|
||||
|
@ -936,6 +977,8 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
|
|||
eina_stringshare_replace(&window->class, clas);
|
||||
if (!window->class) return;
|
||||
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_app_id(window->xdg_toplevel, window->class);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
|
||||
}
|
||||
|
@ -992,11 +1035,26 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
|
|||
|
||||
if (iconified)
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_minimized(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
{
|
||||
struct wl_array states;
|
||||
uint32_t *s;
|
||||
|
||||
wl_array_init(&states);
|
||||
s = wl_array_add(&states, sizeof(*s));
|
||||
*s = XDG_TOPLEVEL_STATE_ACTIVATED;
|
||||
_xdg_toplevel_cb_configure(window, window->xdg_toplevel,
|
||||
window->set_config.geometry.w,
|
||||
window->set_config.geometry.h, &states);
|
||||
wl_array_release(&states);
|
||||
}
|
||||
if (window->zxdg_toplevel)
|
||||
{
|
||||
struct wl_array states;
|
||||
|
@ -1044,7 +1102,7 @@ EAPI Eina_Bool
|
|||
ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *window)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
|
||||
return !!window->zxdg_surface;
|
||||
return !!window->zxdg_surface || !!window->xdg_surface;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
@ -1352,9 +1410,9 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int
|
|||
window->aspect.aspect = aspect;
|
||||
window->aspect.set = 1;
|
||||
if (!window->display->wl.efl_hints) return;
|
||||
if (window->zxdg_surface)
|
||||
if (window->xdg_surface)
|
||||
efl_hints_set_aspect(window->display->wl.efl_hints,
|
||||
window->zxdg_surface, w, h, aspect);
|
||||
window->xdg_surface, w, h, aspect);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -1373,9 +1431,9 @@ ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h)
|
|||
window->weight.h = hh;
|
||||
window->weight.set = 1;
|
||||
if (!window->display->wl.efl_hints) return;
|
||||
if (window->zxdg_surface)
|
||||
if (window->xdg_surface)
|
||||
efl_hints_set_weight(window->display->wl.efl_hints,
|
||||
window->zxdg_surface, ww, hh);
|
||||
window->xdg_surface, ww, hh);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1401,30 +1459,46 @@ static struct wl_callback_listener _frame_listener =
|
|||
static void
|
||||
_maximized_set(Ecore_Wl2_Window *window)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(window->zxdg_toplevel);
|
||||
EINA_SAFETY_ON_FALSE_RETURN(window->zxdg_toplevel || window->xdg_toplevel);
|
||||
|
||||
if (window->set_config.maximized)
|
||||
{
|
||||
window->saved = window->set_config.geometry;
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_maximized(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_unset_maximized(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_fullscreen_set(Ecore_Wl2_Window *window)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(window->zxdg_toplevel);
|
||||
EINA_SAFETY_ON_FALSE_RETURN(window->zxdg_toplevel || window->xdg_toplevel);
|
||||
|
||||
if (window->set_config.fullscreen)
|
||||
{
|
||||
window->saved = window->set_config.geometry;
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_set_fullscreen(window->xdg_toplevel, NULL);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
xdg_toplevel_unset_fullscreen(window->xdg_toplevel);
|
||||
if (window->zxdg_toplevel)
|
||||
zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_input_set(Ecore_Wl2_Window *window)
|
||||
|
@ -1493,12 +1567,21 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
|
|||
window->callback = wl_surface_frame(window->surface);
|
||||
wl_callback_add_listener(window->callback, &_frame_listener, window);
|
||||
/* Dispatch any state we've been saving along the way */
|
||||
if (window->pending.geom && window->zxdg_toplevel)
|
||||
if (window->pending.geom)
|
||||
{
|
||||
if (window->xdg_toplevel)
|
||||
xdg_surface_set_window_geometry(window->xdg_surface,
|
||||
window->set_config.geometry.x,
|
||||
window->set_config.geometry.y,
|
||||
window->set_config.geometry.w,
|
||||
window->set_config.geometry.h);
|
||||
if (window->zxdg_surface)
|
||||
zxdg_surface_v6_set_window_geometry(window->zxdg_surface,
|
||||
window->set_config.geometry.x,
|
||||
window->set_config.geometry.y,
|
||||
window->set_config.geometry.w,
|
||||
window->set_config.geometry.h);
|
||||
}
|
||||
if (window->pending.opaque)
|
||||
_opaque_set(window);
|
||||
|
||||
|
@ -1520,6 +1603,9 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
|
|||
|
||||
if (window->req_config.serial != window->set_config.serial)
|
||||
{
|
||||
if (window->xdg_configure_ack)
|
||||
window->xdg_configure_ack(window->xdg_surface,
|
||||
window->req_config.serial);
|
||||
if (window->zxdg_configure_ack)
|
||||
window->zxdg_configure_ack(window->zxdg_surface,
|
||||
window->req_config.serial);
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
|
||||
static void
|
||||
_zxdg_surface_cb_configure(void *data, struct zxdg_surface_v6 *zxdg_surface EINA_UNUSED, uint32_t serial)
|
||||
{
|
||||
Ecore_Wl2_Window *window;
|
||||
|
||||
window = data;
|
||||
window->def_config.serial = serial;
|
||||
|
||||
if (window->pending.configure)
|
||||
{
|
||||
window->saved.w = window->set_config.geometry.w;
|
||||
window->saved.h = window->set_config.geometry.h;
|
||||
_configure_complete(window);
|
||||
}
|
||||
if (window->pending.configure && window->updating)
|
||||
ERR("Window shouldn't be rendering before initial configure");
|
||||
|
||||
if (!window->updating)
|
||||
_ecore_wl2_window_configure_send(window);
|
||||
}
|
||||
|
||||
static const struct zxdg_surface_v6_listener _zxdg_surface_listener =
|
||||
{
|
||||
_zxdg_surface_cb_configure,
|
||||
};
|
||||
|
||||
static void
|
||||
_zxdg_toplevel_cb_configure(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states)
|
||||
{
|
||||
Ecore_Wl2_Window *win = data;
|
||||
uint32_t *s;
|
||||
|
||||
win->def_config.minimized = EINA_FALSE;
|
||||
win->def_config.maximized = EINA_FALSE;
|
||||
win->def_config.fullscreen = EINA_FALSE;
|
||||
win->def_config.focused = EINA_FALSE;
|
||||
win->def_config.resizing = EINA_FALSE;
|
||||
win->def_config.geometry.w = width;
|
||||
win->def_config.geometry.h = height;
|
||||
|
||||
wl_array_for_each(s, states)
|
||||
{
|
||||
switch (*s)
|
||||
{
|
||||
case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED:
|
||||
win->def_config.maximized = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN:
|
||||
win->def_config.fullscreen = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_RESIZING:
|
||||
win->def_config.resizing = EINA_TRUE;
|
||||
break;
|
||||
case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED:
|
||||
win->def_config.focused = EINA_TRUE;
|
||||
win->def_config.minimized = EINA_FALSE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_zxdg_toplevel_cb_close(void *data, struct zxdg_toplevel_v6 *zxdg_toplevel EINA_UNUSED)
|
||||
{
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = data;
|
||||
if (!win) return;
|
||||
|
||||
ecore_wl2_window_free(win);
|
||||
}
|
||||
|
||||
static const struct zxdg_toplevel_v6_listener _zxdg_toplevel_listener =
|
||||
{
|
||||
_zxdg_toplevel_cb_configure,
|
||||
_zxdg_toplevel_cb_close,
|
||||
};
|
||||
|
||||
static void
|
||||
_zxdg_popup_cb_configure(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED, int32_t x EINA_UNUSED, int32_t y EINA_UNUSED, int32_t width, int32_t height)
|
||||
{
|
||||
Ecore_Wl2_Window *win = data;
|
||||
win->def_config.geometry.w = width;
|
||||
win->def_config.geometry.h = height;
|
||||
}
|
||||
|
||||
static void
|
||||
_zxdg_popup_cb_done(void *data, struct zxdg_popup_v6 *zxdg_popup EINA_UNUSED)
|
||||
{
|
||||
Ecore_Wl2_Window *win;
|
||||
|
||||
win = data;
|
||||
if (!win) return;
|
||||
|
||||
if (win->grab) _ecore_wl2_input_ungrab(win->grab);
|
||||
}
|
||||
|
||||
static const struct zxdg_popup_v6_listener _zxdg_popup_listener =
|
||||
{
|
||||
_zxdg_popup_cb_configure,
|
||||
_zxdg_popup_cb_done,
|
||||
};
|
||||
|
||||
static void
|
||||
_window_v6_popup_create(Ecore_Wl2_Window *win)
|
||||
{
|
||||
struct zxdg_positioner_v6 *pos;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(win->parent);
|
||||
pos = zxdg_shell_v6_create_positioner(win->display->wl.zxdg_shell);
|
||||
if (!pos) return;
|
||||
|
||||
zxdg_positioner_v6_set_anchor_rect(pos, win->set_config.geometry.x,
|
||||
win->set_config.geometry.y,
|
||||
1, 1);
|
||||
zxdg_positioner_v6_set_size(pos, win->set_config.geometry.w,
|
||||
win->set_config.geometry.h);
|
||||
zxdg_positioner_v6_set_anchor(pos, ZXDG_POSITIONER_V6_ANCHOR_TOP |
|
||||
ZXDG_POSITIONER_V6_ANCHOR_LEFT);
|
||||
zxdg_positioner_v6_set_gravity(pos, ZXDG_POSITIONER_V6_ANCHOR_BOTTOM |
|
||||
ZXDG_POSITIONER_V6_ANCHOR_RIGHT);
|
||||
|
||||
win->zxdg_popup = zxdg_surface_v6_get_popup(win->zxdg_surface,
|
||||
win->parent->zxdg_surface, pos);
|
||||
|
||||
zxdg_positioner_v6_destroy(pos);
|
||||
if (win->grab)
|
||||
zxdg_popup_v6_grab(win->zxdg_popup, win->grab->wl.seat,
|
||||
wl_display_get_serial(win->display->wl.display));
|
||||
zxdg_popup_v6_set_user_data(win->zxdg_popup, win);
|
||||
zxdg_popup_v6_add_listener(win->zxdg_popup, &_zxdg_popup_listener, win);
|
||||
|
||||
win->pending.configure = EINA_TRUE;
|
||||
|
||||
ecore_wl2_window_commit(win, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_window_v6_shell_surface_create(Ecore_Wl2_Window *window)
|
||||
{
|
||||
if (window->zxdg_surface) return;
|
||||
window->zxdg_surface =
|
||||
zxdg_shell_v6_get_xdg_surface(window->display->wl.zxdg_shell,
|
||||
window->surface);
|
||||
zxdg_surface_v6_set_user_data(window->zxdg_surface, window);
|
||||
zxdg_surface_v6_add_listener(window->zxdg_surface,
|
||||
&_zxdg_surface_listener, window);
|
||||
|
||||
window->zxdg_configure_ack = zxdg_surface_v6_ack_configure;
|
||||
window->pending.configure = EINA_TRUE;
|
||||
|
||||
if (window->type == ECORE_WL2_WINDOW_TYPE_MENU)
|
||||
_window_v6_popup_create(window);
|
||||
else
|
||||
{
|
||||
struct zxdg_toplevel_v6 *ptop = NULL;
|
||||
|
||||
window->zxdg_toplevel =
|
||||
zxdg_surface_v6_get_toplevel(window->zxdg_surface);
|
||||
zxdg_toplevel_v6_set_user_data(window->zxdg_toplevel, window);
|
||||
zxdg_toplevel_v6_add_listener(window->zxdg_toplevel,
|
||||
&_zxdg_toplevel_listener, window);
|
||||
|
||||
if (window->title)
|
||||
zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
|
||||
if (window->class)
|
||||
zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
|
||||
|
||||
window->zxdg_set_min_size = zxdg_toplevel_v6_set_min_size;
|
||||
window->zxdg_set_max_size = zxdg_toplevel_v6_set_max_size;
|
||||
|
||||
if (window->parent)
|
||||
ptop = window->parent->zxdg_toplevel;
|
||||
|
||||
if (ptop)
|
||||
zxdg_toplevel_v6_set_parent(window->zxdg_toplevel, ptop);
|
||||
|
||||
if (window->set_config.maximized)
|
||||
zxdg_toplevel_v6_set_maximized(window->zxdg_toplevel);
|
||||
|
||||
if (window->set_config.fullscreen)
|
||||
zxdg_toplevel_v6_set_fullscreen(window->zxdg_toplevel, NULL);
|
||||
}
|
||||
|
||||
ecore_wl2_window_commit(window, EINA_TRUE);
|
||||
}
|
|
@ -4176,7 +4176,10 @@ _elm_win_frame_cb_menu(void *data,
|
|||
EINA_ITERATOR_FOREACH(it, input) break;
|
||||
eina_iterator_free(it);
|
||||
}
|
||||
if (sd->wl.win->zxdg_toplevel)
|
||||
if (sd->wl.win->xdg_toplevel)
|
||||
xdg_toplevel_show_window_menu(sd->wl.win->xdg_toplevel,
|
||||
ecore_wl2_input_seat_get(input), 0, x, y);
|
||||
else 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
|
||||
|
|
|
@ -241,6 +241,17 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
|
|||
ee->w = w;
|
||||
ee->h = h;
|
||||
|
||||
if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min)
|
||||
{
|
||||
wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h);
|
||||
wdata->win->pending.min = 0;
|
||||
}
|
||||
if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max)
|
||||
{
|
||||
wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h);
|
||||
wdata->win->pending.max = 0;
|
||||
}
|
||||
|
||||
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
|
||||
{
|
||||
wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h);
|
||||
|
@ -524,6 +535,9 @@ _ecore_evas_wl_common_cb_window_configure(void *data EINA_UNUSED, int type EINA_
|
|||
wdata->win->req_config.serial && wdata->win->surface &&
|
||||
((!state_change) || ((pfw == fw) && (pfh == fh))))
|
||||
{
|
||||
if (wdata->win->xdg_configure_ack)
|
||||
wdata->win->xdg_configure_ack(wdata->win->xdg_surface,
|
||||
wdata->win->req_config.serial);
|
||||
if (wdata->win->zxdg_configure_ack)
|
||||
wdata->win->zxdg_configure_ack(wdata->win->zxdg_surface,
|
||||
wdata->win->req_config.serial);
|
||||
|
@ -1558,6 +1572,11 @@ _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
|
|||
ee->prop.min.w = w;
|
||||
ee->prop.min.h = h;
|
||||
wdata = ee->engine.data;
|
||||
if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel)
|
||||
{
|
||||
wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, w, h);
|
||||
wdata->win->pending.min = 0;
|
||||
}
|
||||
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel)
|
||||
{
|
||||
wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, w, h);
|
||||
|
@ -1581,6 +1600,11 @@ _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
|
|||
ee->prop.max.w = w;
|
||||
ee->prop.max.h = h;
|
||||
wdata = ee->engine.data;
|
||||
if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel)
|
||||
{
|
||||
wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, w, h);
|
||||
wdata->win->pending.max = 0;
|
||||
}
|
||||
if (wdata->win->zxdg_set_max_size && wdata->win->zxdg_toplevel)
|
||||
{
|
||||
wdata->win->zxdg_set_max_size(wdata->win->zxdg_toplevel, w, h);
|
||||
|
@ -2067,6 +2091,16 @@ _ecore_evas_wl_common_show(Ecore_Evas *ee)
|
|||
{
|
||||
int fw, fh;
|
||||
|
||||
if (wdata->win->xdg_set_min_size && wdata->win->xdg_toplevel && wdata->win->pending.min)
|
||||
{
|
||||
wdata->win->xdg_set_min_size(wdata->win->xdg_toplevel, ee->prop.min.w, ee->prop.min.h);
|
||||
wdata->win->pending.min = 0;
|
||||
}
|
||||
if (wdata->win->xdg_set_max_size && wdata->win->xdg_toplevel && wdata->win->pending.max)
|
||||
{
|
||||
wdata->win->xdg_set_max_size(wdata->win->xdg_toplevel, ee->prop.max.w, ee->prop.max.h);
|
||||
wdata->win->pending.max = 0;
|
||||
}
|
||||
if (wdata->win->zxdg_set_min_size && wdata->win->zxdg_toplevel && wdata->win->pending.min)
|
||||
{
|
||||
wdata->win->zxdg_set_min_size(wdata->win->zxdg_toplevel, ee->prop.min.w, ee->prop.min.h);
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
<entry name="both" value="4"/>
|
||||
</enum>
|
||||
<request name="set_aspect">
|
||||
<arg name="surface" type="object" interface="zxdg_surface_v6"/>
|
||||
<arg name="surface" type="object" interface="xdg_surface"/>
|
||||
<arg name="width" type="uint"/>
|
||||
<arg name="height" type="uint"/>
|
||||
<arg name="aspect" type="uint" enum="aspect"/>
|
||||
</request>
|
||||
<request name="set_weight">
|
||||
<arg name="surface" type="object" interface="zxdg_surface_v6"/>
|
||||
<arg name="surface" type="object" interface="xdg_surface"/>
|
||||
<arg name="width" type="int"/>
|
||||
<arg name="height" type="int"/>
|
||||
</request>
|
||||
|
|
Loading…
Reference in New Issue