forked from enlightenment/enlightenment
Merge branch 'devs/devilhorns/e_comp_wl'
This merges new wayland compositor code which fixes Several issues including crashes on module dialog close, pixmap garbage on resize, and various other issues. This is a much more solid wayland compositor now, however it does require updated wayland libraries (1.6) and xdg_shell 1.6 is supported also. @fix
This commit is contained in:
commit
57fa2d1365
3653
src/bin/e_comp_wl.c
3653
src/bin/e_comp_wl.c
File diff suppressed because it is too large
Load Diff
|
@ -13,10 +13,10 @@
|
||||||
|
|
||||||
# include <xkbcommon/xkbcommon.h>
|
# include <xkbcommon/xkbcommon.h>
|
||||||
|
|
||||||
# ifdef HAVE_WAYLAND_EGL
|
/* # ifdef HAVE_WAYLAND_EGL */
|
||||||
# include <EGL/egl.h>
|
/* # include <EGL/egl.h> */
|
||||||
# define GL_GLEXT_PROTOTYPES
|
/* # define GL_GLEXT_PROTOTYPES */
|
||||||
# endif
|
/* # endif */
|
||||||
|
|
||||||
# ifdef __linux__
|
# ifdef __linux__
|
||||||
# include <linux/input.h>
|
# include <linux/input.h>
|
||||||
|
@ -188,7 +188,6 @@ struct _E_Comp_Wl_Data
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
int32_t width, height;
|
|
||||||
uint32_t edges;
|
uint32_t edges;
|
||||||
} resize;
|
} resize;
|
||||||
|
|
||||||
|
@ -241,10 +240,9 @@ struct _E_Comp_Wl_Client_Data
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int32_t x, y, w, h;
|
int32_t x, y, w, h;
|
||||||
E_Comp_Wl_Buffer *buffer;
|
struct wl_resource *buffer;
|
||||||
struct wl_listener buffer_destroy;
|
|
||||||
Eina_Bool new_attach : 1;
|
Eina_Bool new_attach : 1;
|
||||||
Eina_Tiler *damage;
|
Eina_List *damages;
|
||||||
Eina_Tiler *input;
|
Eina_Tiler *input;
|
||||||
Eina_Tiler *opaque;
|
Eina_Tiler *opaque;
|
||||||
} pending;
|
} pending;
|
||||||
|
@ -271,9 +269,10 @@ EINTERN void e_comp_wl_shutdown(void);
|
||||||
|
|
||||||
EINTERN struct wl_resource *e_comp_wl_surface_create(struct wl_client *client, int version, uint32_t id);
|
EINTERN struct wl_resource *e_comp_wl_surface_create(struct wl_client *client, int version, uint32_t id);
|
||||||
EINTERN void e_comp_wl_surface_destroy(struct wl_resource *resource);
|
EINTERN void e_comp_wl_surface_destroy(struct wl_resource *resource);
|
||||||
|
EINTERN Eina_Bool e_comp_wl_surface_commit(E_Client *ec);
|
||||||
EINTERN void e_comp_wl_buffer_reference(E_Comp_Wl_Buffer_Ref *ref, E_Comp_Wl_Buffer *buffer);
|
EINTERN void e_comp_wl_buffer_reference(E_Comp_Wl_Buffer_Ref *ref, E_Comp_Wl_Buffer *buffer);
|
||||||
|
|
||||||
EAPI struct wl_signal e_comp_wl_surface_signal_get(E_Comp *comp);
|
EAPI struct wl_signal e_comp_wl_surface_create_signal_get(E_Comp *comp);
|
||||||
|
|
||||||
static inline uint64_t
|
static inline uint64_t
|
||||||
e_comp_wl_id_get(uint32_t client, uint32_t surface)
|
e_comp_wl_id_get(uint32_t client, uint32_t surface)
|
||||||
|
|
|
@ -393,7 +393,7 @@ _e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resour
|
||||||
E_Comp_Data *cdata;
|
E_Comp_Data *cdata;
|
||||||
struct wl_resource *res;
|
struct wl_resource *res;
|
||||||
|
|
||||||
DBG("Data Manager Device Get");
|
/* DBG("Data Manager Device Get"); */
|
||||||
|
|
||||||
/* try to get the compositor data */
|
/* try to get the compositor data */
|
||||||
if (!(cdata = wl_resource_get_user_data(seat_resource))) return;
|
if (!(cdata = wl_resource_get_user_data(seat_resource))) return;
|
||||||
|
@ -661,10 +661,7 @@ _e_comp_wl_clipboard_selection_set(struct wl_listener *listener EINA_UNUSED, voi
|
||||||
cdata->selection.serial, p[0]);
|
cdata->selection.serial, p[0]);
|
||||||
|
|
||||||
if (!cdata->clipboard.source)
|
if (!cdata->clipboard.source)
|
||||||
{
|
close(p[0]);
|
||||||
close(p[0]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -619,12 +619,12 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache)
|
||||||
wl_callback_send_done(cb, (ecore_loop_time_get() * 1000));
|
wl_callback_send_done(cb, (ecore_loop_time_get() * 1000));
|
||||||
wl_resource_destroy(cb);
|
wl_resource_destroy(cb);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* post a buffer release */
|
if (cache)
|
||||||
/* TODO: FIXME: We need a way to determine if the client wants to
|
{
|
||||||
* keep the buffer or not. If so, then we should Not be setting NULL
|
if (cp->resource) wl_buffer_send_release(cp->resource);
|
||||||
* here as this will essentially release the buffer */
|
cp->resource = NULL;
|
||||||
e_comp_wl_buffer_reference(&cd->buffer_ref, NULL);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -224,10 +224,10 @@ _e_shell_surface_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_resou
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBG("Comp Resize Edges Set: %d", edges);
|
||||||
|
|
||||||
cdata->resize.resource = resource;
|
cdata->resize.resource = resource;
|
||||||
cdata->resize.edges = edges;
|
cdata->resize.edges = edges;
|
||||||
cdata->resize.width = ec->client.w;
|
|
||||||
cdata->resize.height = ec->client.h;
|
|
||||||
cdata->ptr.grab_x = cdata->ptr.x;
|
cdata->ptr.grab_x = cdata->ptr.x;
|
||||||
cdata->ptr.grab_y = cdata->ptr.y;
|
cdata->ptr.grab_y = cdata->ptr.y;
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ _e_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_Coor
|
||||||
ec->changes.pos = EINA_TRUE;
|
ec->changes.pos = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ec->client.w != w) || (ec->client.h != h))
|
// if ((ec->client.w != w) || (ec->client.h != h))
|
||||||
{
|
{
|
||||||
ec->client.w = w;
|
ec->client.w = w;
|
||||||
ec->client.h = h;
|
ec->client.h = h;
|
||||||
|
@ -641,8 +641,8 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
|
||||||
uint32_t *s;
|
uint32_t *s;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
|
|
||||||
DBG("XDG_SHELL: Surface Configure Send: %d \t%d %d",
|
DBG("XDG_SHELL: Surface Configure Send: %d \t%d %d\tEdges: %d",
|
||||||
wl_resource_get_id(resource), width, height);
|
wl_resource_get_id(resource), width, height, edges);
|
||||||
|
|
||||||
/* get the client for this resource */
|
/* get the client for this resource */
|
||||||
if (!(ec = wl_resource_get_user_data(resource)))
|
if (!(ec = wl_resource_get_user_data(resource)))
|
||||||
|
@ -668,7 +668,6 @@ _e_xdg_shell_surface_configure_send(struct wl_resource *resource, uint32_t edges
|
||||||
|
|
||||||
if (edges != 0)
|
if (edges != 0)
|
||||||
{
|
{
|
||||||
DBG("\tResizing");
|
|
||||||
s = wl_array_add(&states, sizeof(*s));
|
s = wl_array_add(&states, sizeof(*s));
|
||||||
*s = XDG_SURFACE_STATE_RESIZING;
|
*s = XDG_SURFACE_STATE_RESIZING;
|
||||||
}
|
}
|
||||||
|
@ -828,7 +827,8 @@ _e_xdg_shell_surface_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_r
|
||||||
E_Comp_Data *cdata;
|
E_Comp_Data *cdata;
|
||||||
E_Binding_Event_Mouse_Button ev;
|
E_Binding_Event_Mouse_Button ev;
|
||||||
|
|
||||||
/* DBG("XDG_SHELL: Surface Resize"); */
|
DBG("XDG_SHELL: Surface Resize: %d\tEdges: %d",
|
||||||
|
wl_resource_get_id(resource), edges);
|
||||||
|
|
||||||
/* get the client for this resource */
|
/* get the client for this resource */
|
||||||
if (!(ec = wl_resource_get_user_data(resource)))
|
if (!(ec = wl_resource_get_user_data(resource)))
|
||||||
|
@ -855,8 +855,6 @@ _e_xdg_shell_surface_cb_resize(struct wl_client *client EINA_UNUSED, struct wl_r
|
||||||
|
|
||||||
cdata->resize.resource = resource;
|
cdata->resize.resource = resource;
|
||||||
cdata->resize.edges = edges;
|
cdata->resize.edges = edges;
|
||||||
cdata->resize.width = ec->client.w;
|
|
||||||
cdata->resize.height = ec->client.h;
|
|
||||||
cdata->ptr.grab_x = cdata->ptr.x;
|
cdata->ptr.grab_x = cdata->ptr.x;
|
||||||
cdata->ptr.grab_y = cdata->ptr.y;
|
cdata->ptr.grab_y = cdata->ptr.y;
|
||||||
|
|
||||||
|
@ -1032,8 +1030,8 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_
|
||||||
{
|
{
|
||||||
E_Client *ec;
|
E_Client *ec;
|
||||||
|
|
||||||
/* DBG("XDG_SHELL: Surface Configure: %d \t%d %d %d %d", */
|
DBG("XDG_SHELL: Surface Configure: %d \t%d %d %d %d",
|
||||||
/* wl_resource_get_id(resource), x, y, w, h); */
|
wl_resource_get_id(resource), x, y, w, h);
|
||||||
|
|
||||||
/* get the client for this resource */
|
/* get the client for this resource */
|
||||||
if (!(ec = wl_resource_get_user_data(resource)))
|
if (!(ec = wl_resource_get_user_data(resource)))
|
||||||
|
@ -1044,6 +1042,8 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBG("\tClient Size: %d %d", ec->client.w, ec->client.h);
|
||||||
|
|
||||||
if (ec->parent)
|
if (ec->parent)
|
||||||
{
|
{
|
||||||
if ((ec->netwm.type == E_WINDOW_TYPE_MENU) ||
|
if ((ec->netwm.type == E_WINDOW_TYPE_MENU) ||
|
||||||
|
@ -1064,7 +1064,7 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_
|
||||||
ec->changes.pos = EINA_TRUE;
|
ec->changes.pos = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ec->client.w != w) || (ec->client.h != h))
|
// if ((ec->client.w != w) || (ec->client.h != h))
|
||||||
{
|
{
|
||||||
ec->client.w = w;
|
ec->client.w = w;
|
||||||
ec->client.h = h;
|
ec->client.h = h;
|
||||||
|
@ -1073,7 +1073,10 @@ _e_xdg_shell_surface_configure(struct wl_resource *resource, Evas_Coord x, Evas_
|
||||||
ec->changes.size = EINA_TRUE;
|
ec->changes.size = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ec->changes.pos) EC_CHANGED(ec);
|
/* TODO: ack configure ?? */
|
||||||
|
|
||||||
|
if ((ec->changes.pos) || (ec->changes.size))
|
||||||
|
EC_CHANGED(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue