forked from AuroraMiddleware/gtk
wayland: Load cursor theme using new Wayland cursor library
This requires the SHM object be initialised - therefore this is the most logical (if slightly ugly place.) We also need to make sure that we do something clever to load the correct cursor theme.
This commit is contained in:
parent
2928ffc7b1
commit
b1a5b19b4a
@ -38,6 +38,8 @@
|
||||
#include "gdkkeysprivate.h"
|
||||
#include "gdkprivate-wayland.h"
|
||||
|
||||
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display);
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandDisplay, _gdk_wayland_display, GDK_TYPE_DISPLAY)
|
||||
|
||||
static void
|
||||
@ -129,6 +131,9 @@ gdk_display_handle_global(struct wl_display *display, uint32_t id,
|
||||
wl_display_bind(display, id, &wl_compositor_interface);
|
||||
} else if (strcmp(interface, "wl_shm") == 0) {
|
||||
display_wayland->shm = wl_display_bind(display, id, &wl_shm_interface);
|
||||
|
||||
/* SHM interface is prerequisite */
|
||||
_gdk_wayland_display_load_cursor_theme(display_wayland);
|
||||
} else if (strcmp(interface, "wl_shell") == 0) {
|
||||
display_wayland->shell = wl_display_bind(display, id, &wl_shell_interface);
|
||||
} else if (strcmp(interface, "wl_output") == 0) {
|
||||
@ -615,3 +620,20 @@ _gdk_wayland_display_init (GdkWaylandDisplay *display)
|
||||
_gdk_wayland_display_manager_add_display (gdk_display_manager_get (),
|
||||
GDK_DISPLAY (display));
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
|
||||
{
|
||||
guint w, h;
|
||||
gchar *theme_name = NULL; /* FIXME: Do something here */
|
||||
|
||||
g_assert (wayland_display);
|
||||
g_assert (wayland_display->shm);
|
||||
|
||||
_gdk_wayland_display_get_default_cursor_size (GDK_DISPLAY (wayland_display),
|
||||
&w, &h);
|
||||
|
||||
wayland_display->cursor_theme = wl_cursor_theme_load (theme_name,
|
||||
w,
|
||||
wayland_display->shm);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <config.h>
|
||||
#include <stdint.h>
|
||||
#include <wayland-client.h>
|
||||
#include <wayland-cursor.h>
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
#include <wayland-egl.h>
|
||||
@ -80,6 +81,9 @@ struct _GdkWaylandDisplay
|
||||
struct wl_output *output;
|
||||
struct wl_input_device *input_device;
|
||||
struct wl_data_device_manager *data_device_manager;
|
||||
|
||||
struct wl_cursor_theme *cursor_theme;
|
||||
|
||||
GSource *event_source;
|
||||
|
||||
#ifdef GDK_WAYLAND_USE_EGL
|
||||
|
Loading…
Reference in New Issue
Block a user