EAPI Eina_Inlist *ecore_wl_outputs_get(void);
+/**
+ * @ingroup Ecore_Wl_Input_Group
+ * @since 1.12
+ */
+EAPI void ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size);
+
/**
* Retrieves the Wayland Globals Interface list used for the current Wayland connection.
*
{
ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
- /* FIXME: We should not hard-code a cursor size here, and we should
- * also import the theme name from a config or env variable */
- ewd->cursor_theme = wl_cursor_theme_load(NULL, 32, ewd->wl.shm);
+ /* FIXME: we should import the theme name from a config or env variable */
+ if (ewd->input)
+ ewd->cursor_theme = wl_cursor_theme_load(NULL, ewd->input->cursor_size,
+ ewd->wl.shm);
+ else
+ ewd->cursor_theme = wl_cursor_theme_load(NULL, ECORE_WL_DEFAULT_CURSOR_SIZE,
+ ewd->wl.shm);
}
else if (!strcmp(interface, "wl_data_device_manager"))
{
surface, hot_x, hot_y);
}
+EAPI void
+ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!input) return;
+
+ input->cursor_size = size;
+ input->display->cursor_theme = wl_cursor_theme_load(NULL, input->cursor_size,
+ input->display->wl.shm);
+}
+
static Eina_Bool
_ecore_wl_input_cursor_update(void *data)
{
_ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
{
Ecore_Wl_Input *input;
+ char *temp;
+ unsigned int cursor_size;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
input->keyboard_focus = NULL;
input->touch_focus = NULL;
+ temp = getenv("ECORE_WL_CURSOR_SIZE");
+ if (temp)
+ cursor_size = atoi(temp);
+ else
+ cursor_size = ECORE_WL_DEFAULT_CURSOR_SIZE;
+ ecore_wl_input_cursor_size_set(input, cursor_size);
+
input->seat =
wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input));
# endif
# define CRI(...) EINA_LOG_DOM_CRIT(_ecore_wl_log_dom, __VA_ARGS__)
+# ifdef ECORE_WL_DEFAULT_CURSOR_SIZE
+# undef ECORE_WL_DEFAULT_CURSOR_SIZE
+# endif
+# define ECORE_WL_DEFAULT_CURSOR_SIZE 32
+
typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
struct _Ecore_Wl_Display
struct wl_callback *cursor_frame_cb;
Ecore_Timer *cursor_timer;
unsigned int cursor_current_index;
+ unsigned int cursor_size;
struct wl_data_device *data_device;
struct wl_data_source *data_source;