* Fixed bug in ecore-file monitoring with inotify where watching a file
that was deleted broke the world.
+
+2012-06-15 Rob Bradford
+
+ * Ecore_Wayland: Port to latest Wayland protocol. The cursor for a
+ pointer is now a surface rather than a buffer.
+
+2012-06-15 Rob Bradford
+
+ * Ecore_Wayland: Drop unused timestamp from configure event. Rationale:
+ - timestamp isn't used by the handler for this event
+ - configure event we receive from the compositor doesn't have a timestamp
+ - ecore_wl_window_maximized_set and ecore_wl_window_fullscreen_set had
+ an implicit requirement that the window had keyboard focus to retrieve
+ a timestamp that wasn't used. This removes that requirement and fixes
+ ticket #1030.
struct wl_keyboard *keyboard;
struct wl_touch *touch;
+ struct wl_surface *cursor_surface;
+
struct wl_data_device *data_device;
Ecore_Wl_Window *pointer_focus;
unsigned int win;
unsigned int event_win;
int x, y, w, h;
- unsigned int timestamp;
};
struct _Ecore_Wl_Event_Dnd_Enter
EAPI void ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button);
EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input);
-EAPI void ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_buffer *buffer, int hot_x, int hot_y);
+EAPI void ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_surface *surface, int hot_x, int hot_y);
EAPI void ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_name);
EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input);
EAPI struct wl_shell_surface *ecore_wl_window_shell_surface_get(Ecore_Wl_Window *win);
EAPI Ecore_Wl_Window *ecore_wl_window_find(unsigned int id);
EAPI void ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type);
-EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_buffer *buffer, int hot_x, int hot_y);
+EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, int hot_x, int hot_y);
EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name);
EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win);
EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent);
}
EAPI void
-ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_buffer *buffer, int hot_x, int hot_y)
+ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_surface *surface, int hot_x, int hot_y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (input)
- wl_pointer_attach(input->pointer, input->pointer_enter_serial,
- buffer, hot_x, hot_y);
+ wl_pointer_set_cursor(input->pointer, input->pointer_enter_serial,
+ surface, hot_x, hot_y);
}
EAPI void
cursor_image = cursor->images[0];
if ((buffer = wl_cursor_image_get_buffer(cursor_image)))
- ecore_wl_input_pointer_set(input, buffer,
- cursor_image->hotspot_x,
- cursor_image->hotspot_y);
+ {
+ ecore_wl_input_pointer_set(input, input->cursor_surface,
+ cursor_image->hotspot_x,
+ cursor_image->hotspot_y);
+ wl_surface_attach(input->cursor_surface, buffer, 0, 0);
+ wl_surface_damage(input->cursor_surface, 0, 0,
+ cursor_image->width, cursor_image->height);
+ }
}
EAPI void
input->seat);
wl_data_device_add_listener(input->data_device,
&_ecore_wl_data_listener, input);
+ input->cursor_surface =
+ wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
+
ewd->input = input;
}
xkb_state_unref(input->xkb.state);
if (input->xkb.keymap)
xkb_map_unref(input->xkb.keymap);
+ if (input->cursor_surface)
+ wl_surface_destroy(input->cursor_surface);
+
free(input);
}
_ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard __UNUSED__, unsigned int serial __UNUSED__, unsigned int depressed, unsigned int latched, unsigned int locked, unsigned int group)
{
Ecore_Wl_Input *input;
- xkb_mod_mask_t mask;
+ xkb_mod_mask_t mask = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(input = data)) return;
- xkb_state_update_mask(input->xkb.state, depressed, latched,
- locked, 0, 0, group);
+ if (input->xkb.state)
+ {
+ xkb_state_update_mask(input->xkb.state, depressed, latched,
+ locked, 0, 0, group);
- mask = xkb_state_serialize_mods(input->xkb.state,
+ mask =
+ xkb_state_serialize_mods(input->xkb.state,
(XKB_STATE_DEPRESSED | XKB_STATE_LATCHED));
+ }
+
input->modifiers = 0;
/* The Ecore_Event_Modifiers don't quite match the X mask bits */
static void _ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface __UNUSED__);
static void _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output);
static void _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct wl_output *output);
-static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, unsigned int timestamp);
+static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h);
static char *_ecore_wl_window_id_str_get(unsigned int win_id);
/* local variables */
}
else
{
- Ecore_Wl_Input *input;
-
- input = win->keyboard_device;
-
if (win->shell_surface)
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
win->allocation = win->saved_allocation;
_ecore_wl_window_configure_send(win, win->allocation.w,
- win->allocation.h, input->timestamp);
+ win->allocation.h);
}
}
}
else
{
- Ecore_Wl_Input *input;
-
- input = win->keyboard_device;
-
if (win->shell_surface)
wl_shell_surface_set_toplevel(win->shell_surface);
win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
win->allocation = win->saved_allocation;
_ecore_wl_window_configure_send(win, win->allocation.w,
- win->allocation.h, input->timestamp);
+ win->allocation.h);
}
}
}
EAPI void
-ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_buffer *buffer, int hot_x, int hot_y)
+ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, int hot_x, int hot_y)
{
Ecore_Wl_Input *input;
if (!win) return;
if ((input = win->pointer_device))
- ecore_wl_input_pointer_set(input, buffer, hot_x, hot_y);
+ ecore_wl_input_pointer_set(input, surface, hot_x, hot_y);
}
EAPI void
if (win->region.opaque) wl_region_destroy(win->region.opaque);
win->region.opaque = NULL;
- /* FIXME: 0 timestamp here may not work. need to test */
- _ecore_wl_window_configure_send(win, w, h, 0);
+ _ecore_wl_window_configure_send(win, w, h);
}
}
}
static void
-_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, unsigned int timestamp)
+_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h)
{
Ecore_Wl_Event_Window_Configure *ev;
ev->y = win->allocation.y;
ev->w = w;
ev->h = h;
- ev->timestamp = timestamp;
ecore_event_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, ev, NULL, NULL);
}