configure: Conditionalize libinput and gbm too
This commit is contained in:
parent
3d37b5d696
commit
9063e4568c
@ -79,7 +79,6 @@ MUTTER_PC_MODULES="
|
|||||||
$CLUTTER_PACKAGE >= 1.19.5
|
$CLUTTER_PACKAGE >= 1.19.5
|
||||||
clutter-egl-1.0
|
clutter-egl-1.0
|
||||||
cogl-1.0 >= 1.17.1
|
cogl-1.0 >= 1.17.1
|
||||||
libinput
|
|
||||||
upower-glib >= 0.99.0
|
upower-glib >= 0.99.0
|
||||||
gnome-desktop-3.0
|
gnome-desktop-3.0
|
||||||
xcomposite >= 0.2
|
xcomposite >= 0.2
|
||||||
@ -196,7 +195,7 @@ AC_SUBST(XWAYLAND_PATH)
|
|||||||
|
|
||||||
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
|
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
|
||||||
|
|
||||||
PKG_CHECK_MODULES(MUTTER_NATIVE_BACKEND, [libdrm libsystemd], [have_native_backend=yes], [have_native_backend=no])
|
PKG_CHECK_MODULES(MUTTER_NATIVE_BACKEND, [libdrm libsystemd libinput], [have_native_backend=yes], [have_native_backend=no])
|
||||||
if test $have_native_backend = yes; then
|
if test $have_native_backend = yes; then
|
||||||
AC_DEFINE([HAVE_NATIVE_BACKEND],[1],[Define if you want to enable the native (KMS) backend based on systemd])
|
AC_DEFINE([HAVE_NATIVE_BACKEND],[1],[Define if you want to enable the native (KMS) backend based on systemd])
|
||||||
fi
|
fi
|
||||||
|
@ -25,11 +25,15 @@
|
|||||||
#include "meta-cursor.h"
|
#include "meta-cursor.h"
|
||||||
|
|
||||||
#include <cogl/cogl.h>
|
#include <cogl/cogl.h>
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
#include <gbm.h>
|
#include <gbm.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CoglTexture2D *texture;
|
CoglTexture2D *texture;
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
struct gbm_bo *bo;
|
struct gbm_bo *bo;
|
||||||
|
#endif
|
||||||
int hot_x, hot_y;
|
int hot_x, hot_y;
|
||||||
} MetaCursorImage;
|
} MetaCursorImage;
|
||||||
|
|
||||||
@ -44,8 +48,10 @@ CoglTexture *meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor
|
|||||||
int *hot_x,
|
int *hot_x,
|
||||||
int *hot_y);
|
int *hot_y);
|
||||||
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
struct gbm_bo *meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
|
struct gbm_bo *meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
|
||||||
int *hot_x,
|
int *hot_x,
|
||||||
int *hot_y);
|
int *hot_y);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* META_CURSOR_PRIVATE_H */
|
#endif /* META_CURSOR_PRIVATE_H */
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#include <meta/screen.h>
|
#include <meta/screen.h>
|
||||||
#include "meta-cursor.h"
|
#include "meta-cursor.h"
|
||||||
|
|
||||||
#include <gbm.h>
|
|
||||||
|
|
||||||
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
|
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
|
||||||
#define META_CURSOR_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_CURSOR_RENDERER, MetaCursorRenderer))
|
#define META_CURSOR_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_CURSOR_RENDERER, MetaCursorRenderer))
|
||||||
#define META_CURSOR_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_CURSOR_RENDERER, MetaCursorRendererClass))
|
#define META_CURSOR_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_CURSOR_RENDERER, MetaCursorRendererClass))
|
||||||
|
@ -362,6 +362,7 @@ meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor,
|
|||||||
return COGL_TEXTURE (cursor->image.texture);
|
return COGL_TEXTURE (cursor->image.texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
struct gbm_bo *
|
struct gbm_bo *
|
||||||
meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
|
meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
|
||||||
int *hot_x,
|
int *hot_x,
|
||||||
@ -373,6 +374,7 @@ meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
|
|||||||
*hot_y = cursor->image.hot_y;
|
*hot_y = cursor->image.hot_y;
|
||||||
return cursor->image.bo;
|
return cursor->image.bo;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MetaCursor
|
MetaCursor
|
||||||
meta_cursor_reference_get_meta_cursor (MetaCursorReference *cursor)
|
meta_cursor_reference_get_meta_cursor (MetaCursorReference *cursor)
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
#include "meta-surface-actor-wayland.h"
|
#include "meta-surface-actor-wayland.h"
|
||||||
#include "meta-wayland-private.h"
|
#include "meta-wayland-private.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
|
#include "backends/native/meta-backend-native.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _MetaWaylandTouchSurface
|
struct _MetaWaylandTouchSurface
|
||||||
{
|
{
|
||||||
MetaWaylandSurface *surface;
|
MetaWaylandSurface *surface;
|
||||||
@ -472,6 +476,7 @@ meta_wayland_touch_cancel (MetaWaylandTouch *touch)
|
|||||||
g_list_free (surfaces);
|
g_list_free (surfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
static gboolean
|
static gboolean
|
||||||
evdev_filter_func (struct libinput_event *event,
|
evdev_filter_func (struct libinput_event *event,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
@ -508,6 +513,7 @@ evdev_filter_func (struct libinput_event *event,
|
|||||||
|
|
||||||
return CLUTTER_EVENT_PROPAGATE;
|
return CLUTTER_EVENT_PROPAGATE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_touch_init (MetaWaylandTouch *touch,
|
meta_wayland_touch_init (MetaWaylandTouch *touch,
|
||||||
@ -527,13 +533,23 @@ meta_wayland_touch_init (MetaWaylandTouch *touch,
|
|||||||
|
|
||||||
manager = clutter_device_manager_get_default ();
|
manager = clutter_device_manager_get_default ();
|
||||||
touch->device = clutter_device_manager_get_core_device (manager, CLUTTER_TOUCHSCREEN_DEVICE);
|
touch->device = clutter_device_manager_get_core_device (manager, CLUTTER_TOUCHSCREEN_DEVICE);
|
||||||
clutter_evdev_add_filter (evdev_filter_func, touch, NULL);
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
if (META_IS_BACKEND_NATIVE (backend))
|
||||||
|
clutter_evdev_add_filter (evdev_filter_func, touch, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_touch_release (MetaWaylandTouch *touch)
|
meta_wayland_touch_release (MetaWaylandTouch *touch)
|
||||||
{
|
{
|
||||||
clutter_evdev_remove_filter (evdev_filter_func, touch);
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
if (META_IS_BACKEND_NATIVE (backend))
|
||||||
|
clutter_evdev_remove_filter (evdev_filter_func, touch);
|
||||||
|
#endif
|
||||||
|
|
||||||
g_clear_pointer (&touch->touch_surfaces, (GDestroyNotify) g_hash_table_unref);
|
g_clear_pointer (&touch->touch_surfaces, (GDestroyNotify) g_hash_table_unref);
|
||||||
g_clear_pointer (&touch->touches, (GDestroyNotify) g_hash_table_unref);
|
g_clear_pointer (&touch->touches, (GDestroyNotify) g_hash_table_unref);
|
||||||
touch->display = NULL;
|
touch->display = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user