/* setup compositor shell interface functions */
_e_wl_comp->shell_interface.shell = shell;
+ _e_wl_comp->shell_interface.shell_surface_create =
+ _e_wl_shell_shell_surface_create;
/* try to add this shell to the display's global list */
if (!(gshell =
if (!(ptr = data)) return;
+ if (!ptr->focus) return;
+
/* try to cast the current pointer focus to a wayland surface */
- if (!(ews = (E_Wayland_Surface *)ptr->focus)) return;
+ if (!(ews = wl_resource_get_user_data(ptr->focus)))
+ return;
/* if this surface has a shell_surface and it is not active, then we
* should set the busy cursor on it */
- if ((ews->shell_surface) && (!ews->shell_surface->active))
+ if ((ews->mapped) && (ews->shell_surface) && (!ews->shell_surface->active))
{
E_Wayland_Shell_Grab *grab = NULL;
/* shell interface functions */
static void
-_e_wl_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *resource, unsigned int id, struct wl_resource *surface_resource)
+_e_wl_shell_cb_shell_surface_get(struct wl_client *client, struct wl_resource *resource EINA_UNUSED, unsigned int id, struct wl_resource *surface_resource)
{
E_Wayland_Surface *ews = NULL;
E_Wayland_Shell_Surface *ewss = NULL;
/* try to create a shell surface for this surface */
if (!(ewss = _e_wl_shell_shell_surface_create(NULL, ews, NULL)))
{
- wl_resource_post_no_memory(resource);
+ wl_resource_post_no_memory(surface_resource);
return;
}
{
E_Wayland_Shell_Surface *ewss = NULL;
+ if (!ews) return NULL;
+
/* try to allocate space for our shell surface structure */
if (!(ewss = E_NEW(E_Wayland_Shell_Surface, 1)))
return NULL;
ewss->wl.surface_destroy.notify = _e_wl_shell_shell_surface_cb_destroy;
wl_signal_add(&ews->wl.destroy_signal, &ewss->wl.surface_destroy);
+ /* wl_list_init(&ewss->wl.surface_destroy.link); */
+
wl_list_init(&ewss->wl.link);
/* set some defaults on this shell surface */
E_Wayland_Shell_Surface *ewss = NULL;
Eina_Bool changed_type = EINA_FALSE;
- if ((ews->configure == _e_wl_shell_shell_surface_configure))
- {
- if (!(ewss = ews->shell_surface)) return;
- }
- else
- return;
+ ewss = ews->shell_surface;
+
+ /* FIXME */
+ /* if ((!ews->mapped) && */
+ /* (!wl_list_empty(&ewss->popup.grab_link)) */
+ /* { */
+
+ /* } */
+
+ if (w == 0) return;
+
+ /* if ((ews->configure == _e_wl_shell_shell_surface_configure)) */
+ /* { */
+ /* if (!(ewss = ews->shell_surface)) return; */
+ /* } */
+ /* else */
+ /* return; */
/* handle shell_surface type change */
if ((ewss->next_type != E_WAYLAND_SHELL_SURFACE_TYPE_NONE) &&
if (ewss->wl.resource)
wl_resource_destroy(ewss->wl.resource);
else
- wl_signal_emit(&ewss->wl.destroy_signal, ewss->wl.resource);
+ {
+ E_Wayland_Ping_Timer *tmr = NULL;
+
+ wl_signal_emit(&ewss->wl.destroy_signal, ewss);
+
+ /* TODO: FIXME: Popup->grab_link */
+
+ wl_list_remove(&ewss->wl.surface_destroy.link);
+ ewss->surface->configure = NULL;
+
+ /* destroy the ping timer */
+ if ((tmr = (E_Wayland_Ping_Timer *)ewss->ping_timer))
+ {
+ if (tmr->source) wl_event_source_remove(tmr->source);
+ E_FREE(tmr);
+ ewss->ping_timer = NULL;
+ }
+
+ free(ewss->title);
+ wl_list_remove(&ewss->wl.link);
+ free(ewss);
+ }
}
static int
client = wl_resource_get_client(ewss->surface->wl.surface);
- if ((surface) && (surface->client == client))
+ if ((surface) && (wl_resource_get_client(surface) == client))
{
wl_pointer_set_focus(ptr, surface, x, y);
grab->focus = surface;
struct wl_display *disp;
unsigned int serial;
- disp = wl_client_get_display(res->client);
+ disp = wl_client_get_display(wl_resource_get_client(res));
serial = wl_display_get_serial(disp);
wl_pointer_send_button(res, serial, timestamp, button, state);