}
void
-e_mod_comp_wl_comp_repick(struct wl_input_device *device, uint32_t timestamp)
+e_mod_comp_wl_comp_repick(struct wl_input_device *device, uint32_t timestamp __UNUSED__)
{
Wayland_Surface *ws, *focus;
const struct wl_pointer_grab_interface *interface;
interface = device->pointer_grab->interface;
- interface->focus(device->pointer_grab, timestamp, &ws->surface,
+ interface->focus(device->pointer_grab, &ws->surface,
device->current_x, device->current_y);
device->current = &ws->surface;
}
{
timestamp = e_mod_comp_wl_time_get();
wl_input_device_set_keyboard_focus(&input->input_device,
- &ws->surface, timestamp);
+ &ws->surface);
wl_data_device_set_keyboard_focus(&input->input_device);
break;
}
ev = event;
input = e_mod_comp_wl_input_get();
timestamp = e_mod_comp_wl_time_get();
- wl_input_device_set_keyboard_focus(&input->input_device, NULL, timestamp);
+ wl_input_device_set_keyboard_focus(&input->input_device, NULL);
wl_data_device_set_keyboard_focus(&input->input_device);
return ECORE_CALLBACK_PASS_ON;
/* local function prototypes */
static void _e_mod_comp_wl_input_bind(struct wl_client *client, void *data, uint32_t version __UNUSED__, uint32_t id);
static void _e_mod_comp_wl_input_unbind(struct wl_resource *resource);
-static void _e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t timestamp, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y);
+static void _e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y);
/* wayland interfaces */
static const struct wl_input_device_interface _wl_input_interface =
}
static void
-_e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t timestamp, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y)
+_e_mod_comp_wl_input_attach(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *buffer_resource __UNUSED__, int32_t x, int32_t y)
{
Wayland_Input *wi;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
wi = resource->data;
- if (timestamp < wi->input_device.pointer_focus_time) return;
+ if (serial < wi->input_device.pointer_focus_serial) return;
if (!wi->input_device.pointer_focus) return;
if (wi->input_device.pointer_focus->resource.client != client) return;
wi->hotspot_x = x;
void
e_mod_comp_wl_region_destroy(struct wl_client *client __UNUSED__, struct wl_resource *resource)
{
- wl_resource_destroy(resource, e_mod_comp_wl_time_get());
+ wl_resource_destroy(resource);
}
void
static void _e_mod_comp_wl_shell_activate(Wayland_Shell *base, Wayland_Surface *surface, uint32_t timestamp);
static void _e_mod_comp_wl_shell_shell_surface_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource);
+static void _e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial);
static void _e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp);
static void _e_mod_comp_wl_shell_surface_resize(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp, uint32_t edges);
static void _e_mod_comp_wl_shell_surface_set_toplevel(struct wl_client *client __UNUSED__, struct wl_resource *resource);
static void _e_mod_comp_wl_shell_surface_set_popup(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource __UNUSED__, uint32_t timestamp __UNUSED__, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags __UNUSED__);
static void _e_mod_comp_wl_shell_surface_set_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource __UNUSED__);
-static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp);
+static void _e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__);
static Wayland_Shell_Surface *_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws);
static void _e_mod_comp_wl_shell_surface_destroy(struct wl_resource *resource);
};
static const struct wl_shell_surface_interface _wl_shell_surface_interface =
{
+ _e_mod_comp_wl_shell_surface_pong,
_e_mod_comp_wl_shell_surface_move,
_e_mod_comp_wl_shell_surface_resize,
_e_mod_comp_wl_shell_surface_set_toplevel,
wss->resource.data = wss;
wss->surface = ws;
- wss->surface_destroy_listener.func =
+ wss->surface_destroy_listener.notify =
_e_mod_comp_wl_shell_surface_destroy_handle;
- wl_list_insert(ws->surface.resource.destroy_listener_list.prev,
- &wss->surface_destroy_listener.link);
+ wl_signal_add(&ws->surface.resource.destroy_signal,
+ &wss->surface_destroy_listener);
wl_list_init(&wss->link);
}
static void
+_e_mod_comp_wl_shell_surface_pong(struct wl_client *client __UNUSED__, struct wl_resource *resource, unsigned int serial)
+{
+ Wayland_Shell_Surface *wss;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ wss = resource->data;
+ /* TODO: handle ping timer */
+}
+
+static void
_e_mod_comp_wl_shell_surface_move(struct wl_client *client __UNUSED__, struct wl_resource *resource, struct wl_resource *input_resource, uint32_t timestamp)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
}
static void
-_e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp)
+_e_mod_comp_wl_shell_surface_destroy_handle(struct wl_listener *listener, void *data __UNUSED__)
{
Wayland_Shell_Surface *wss;
wss = container_of(listener, Wayland_Shell_Surface, surface_destroy_listener);
wss->surface = NULL;
- wl_resource_destroy(&wss->resource, timestamp);
+ wl_resource_destroy(&wss->resource);
}
static Wayland_Shell_Surface *
_e_mod_comp_wl_shell_get_shell_surface(Wayland_Surface *ws)
{
- struct wl_list *list;
struct wl_listener *listener;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- list = &ws->surface.resource.destroy_listener_list;
- wl_list_for_each(listener, list, link)
- {
- if (listener->func == _e_mod_comp_wl_shell_surface_destroy_handle)
- return container_of(listener, Wayland_Shell_Surface,
- surface_destroy_listener);
- }
+ listener =
+ wl_signal_get(&ws->surface.resource.destroy_signal,
+ _e_mod_comp_wl_shell_surface_destroy_handle);
+ if (listener)
+ return container_of(listener, Wayland_Shell_Surface,
+ surface_destroy_listener);
return NULL;
}
#endif
/* local function prototypes */
-static void _e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp __UNUSED__);
+static void _e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__);
static void _e_mod_comp_wl_surface_raise(Wayland_Surface *ws);
static void _e_mod_comp_wl_surface_damage_rectangle(Wayland_Surface *ws, int32_t x, int32_t y, int32_t width, int32_t height);
static void _e_mod_comp_wl_surface_frame_destroy_callback(struct wl_resource *resource);
wl_list_init(&ws->frame_callbacks);
- ws->buffer_destroy_listener.func =
+ ws->buffer_destroy_listener.notify =
_e_mod_comp_wl_surface_buffer_destroy_handle;
/* ws->transform = NULL; */
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- wl_resource_destroy(resource, e_mod_comp_wl_time_get());
+ wl_resource_destroy(resource);
}
void
buffer->busy_count++;
ws->buffer = buffer;
- wl_list_insert(ws->buffer->resource.destroy_listener_list.prev,
- &ws->buffer_destroy_listener.link);
+ wl_signal_add(&ws->buffer->resource.destroy_signal,
+ &ws->buffer_destroy_listener);
if (!ws->visual)
shell->shell.map(&shell->shell, ws, buffer->width, buffer->height);
}
void
-e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp)
+e_mod_comp_wl_surface_activate(Wayland_Surface *ws, Wayland_Input *wi, uint32_t timestamp __UNUSED__)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
}
_e_mod_comp_wl_surface_raise(ws);
- wl_input_device_set_keyboard_focus(&wi->input_device, &ws->surface, timestamp);
+ wl_input_device_set_keyboard_focus(&wi->input_device, &ws->surface);
wl_data_device_set_keyboard_focus(&wi->input_device);
}
/* local functions */
static void
-_e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, struct wl_resource *resource __UNUSED__, uint32_t timestamp __UNUSED__)
+_e_mod_comp_wl_surface_buffer_destroy_handle(struct wl_listener *listener, void *data __UNUSED__)
{
Wayland_Surface *ws;