1
0
Fork 0

configure: Conditionalize libinput and gbm too

This commit is contained in:
Jasper St. Pierre 2014-08-27 08:25:09 -04:00
parent 3d37b5d696
commit 9063e4568c
5 changed files with 27 additions and 6 deletions

View file

@ -79,7 +79,6 @@ MUTTER_PC_MODULES="
$CLUTTER_PACKAGE >= 1.19.5
clutter-egl-1.0
cogl-1.0 >= 1.17.1
libinput
upower-glib >= 0.99.0
gnome-desktop-3.0
xcomposite >= 0.2
@ -196,7 +195,7 @@ AC_SUBST(XWAYLAND_PATH)
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
AC_DEFINE([HAVE_NATIVE_BACKEND],[1],[Define if you want to enable the native (KMS) backend based on systemd])
fi

View file

@ -25,11 +25,15 @@
#include "meta-cursor.h"
#include <cogl/cogl.h>
#ifdef HAVE_NATIVE_BACKEND
#include <gbm.h>
#endif
typedef struct {
CoglTexture2D *texture;
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *bo;
#endif
int hot_x, hot_y;
} MetaCursorImage;
@ -44,8 +48,10 @@ CoglTexture *meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor
int *hot_x,
int *hot_y);
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
int *hot_x,
int *hot_y);
#endif
#endif /* META_CURSOR_PRIVATE_H */

View file

@ -30,8 +30,6 @@
#include <meta/screen.h>
#include "meta-cursor.h"
#include <gbm.h>
#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_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_CURSOR_RENDERER, MetaCursorRendererClass))

View file

@ -362,6 +362,7 @@ meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor,
return COGL_TEXTURE (cursor->image.texture);
}
#ifdef HAVE_NATIVE_BACKEND
struct gbm_bo *
meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
int *hot_x,
@ -373,6 +374,7 @@ meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
*hot_y = cursor->image.hot_y;
return cursor->image.bo;
}
#endif
MetaCursor
meta_cursor_reference_get_meta_cursor (MetaCursorReference *cursor)

View file

@ -32,6 +32,10 @@
#include "meta-surface-actor-wayland.h"
#include "meta-wayland-private.h"
#ifdef HAVE_NATIVE_BACKEND
#include "backends/native/meta-backend-native.h"
#endif
struct _MetaWaylandTouchSurface
{
MetaWaylandSurface *surface;
@ -472,6 +476,7 @@ meta_wayland_touch_cancel (MetaWaylandTouch *touch)
g_list_free (surfaces);
}
#ifdef HAVE_NATIVE_BACKEND
static gboolean
evdev_filter_func (struct libinput_event *event,
gpointer data)
@ -508,6 +513,7 @@ evdev_filter_func (struct libinput_event *event,
return CLUTTER_EVENT_PROPAGATE;
}
#endif
void
meta_wayland_touch_init (MetaWaylandTouch *touch,
@ -527,13 +533,23 @@ meta_wayland_touch_init (MetaWaylandTouch *touch,
manager = clutter_device_manager_get_default ();
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
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->touches, (GDestroyNotify) g_hash_table_unref);
touch->display = NULL;