#include "e.h"
+#ifdef HAVE_WAYLAND_CLIENTS
+#include "e_comp_wl.h"
+#endif
//#define INOUTDEBUG_MOUSE 1
//#define INOUTDEBUG_FOCUS 1
if ((bd) && (!e_object_is_del(E_OBJECT(bd))) &&
(bd->client.win == win))
return bd;
+#ifdef HAVE_WAYLAND_CLIENTS
+ bd = e_comp_wl_border_surface_find(win);
+ if (bd && (!e_object_is_del(E_OBJECT(bd)))) return bd;
+#endif
return NULL;
}
bd = eina_hash_find(borders_hash, e_util_winid_str_get(win));
if ((bd) && (bd->client.win == win))
return bd;
+#ifdef HAVE_WAYLAND_CLIENTS
+ return e_comp_wl_border_surface_find(win);
+#endif
return NULL;
}
/* local variables */
static Ecore_Idler *_module_idler = NULL;
+static Eina_Hash *_e_wl_border_hash = NULL;
+
/* external variables */
EAPI E_Wayland_Compositor *_e_wl_comp;
E_FREE(_e_wl_comp);
}
+ E_FREE_FUNC(_e_wl_border_hash, eina_hash_free);
+
/* disable the loaded shell module */
/* TODO: we should have a config variable somewhere to store which
* shell we want to unload (tablet, mobile, etc) */
e_module_disable(mod);
}
+EAPI void
+e_comp_wl_border_surface_add(Ecore_Window win, const E_Border *bd)
+{
+ if (!_e_wl_border_hash)
+ _e_wl_border_hash = eina_hash_int32_new(NULL);
+ eina_hash_add(_e_wl_border_hash, &win, bd);
+}
+
+EAPI void
+e_comp_wl_border_surface_del(Ecore_Window win)
+{
+ if (!_e_wl_border_hash) return;
+ eina_hash_del_by_key(_e_wl_border_hash, &win);
+}
+
+EAPI E_Border *
+e_comp_wl_border_surface_find(Ecore_Window win)
+{
+ if (!_e_wl_border_hash) return NULL;
+ return eina_hash_find(_e_wl_border_hash, &win);
+}
+
EAPI void
wl_seat_init(struct wl_seat *seat)
{
wl_resource_post_no_memory(resource);
return;
}
+ ews->id = id;
/* initialize the destroy signal */
wl_signal_init(&ews->wl.destroy_signal);
struct _E_Wayland_Surface
{
EINA_INLIST;
+ Ecore_Window id;
struct
{
struct wl_resource *surface;
EINTERN Eina_Bool e_comp_wl_init(void);
EINTERN void e_comp_wl_shutdown(void);
+EAPI void e_comp_wl_border_surface_add(Ecore_Window win, const E_Border *bd);
+EAPI void e_comp_wl_border_surface_del(Ecore_Window win);
+EAPI E_Border *e_comp_wl_border_surface_find(Ecore_Window win);
+
EAPI void wl_seat_init(struct wl_seat *seat);
EAPI void wl_seat_release(struct wl_seat *seat);
default:
break;
}
+ if (ews->bd)
+ e_comp_wl_border_surface_add(ews->id, ews->bd);
}
static void
evas_object_del(ews->obj);
}
- if (ews->bd) e_object_del(E_OBJECT(ews->bd));
+ if (ews->bd)
+ {
+ e_comp_wl_border_surface_del(ews->id);
+ e_object_del(E_OBJECT(ews->bd));
+ }
ews->mapped = EINA_FALSE;
}