mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
wayland: Use pointer gestures protocol from wayand-protocols
Remove our own copy of the pointer gestures protocol, and us the one installed by wayland-protocols. This also means the new fixed unstable naming conventions are used for the new version of the protocol, which is reflected in the change. No functional changes were made, it is only a rename. https://bugzilla.gnome.org/show_bug.cgi?id=758633
This commit is contained in:
parent
c625d2ee9d
commit
2ee1c5fa61
4
.gitignore
vendored
4
.gitignore
vendored
@ -66,8 +66,8 @@ src/gtk-shell-protocol.c
|
||||
src/gtk-shell-server-protocol.h
|
||||
src/xdg-shell-protocol.c
|
||||
src/xdg-shell-server-protocol.h
|
||||
src/pointer-gestures-protocol.c
|
||||
src/pointer-gestures-server-protocol.h
|
||||
src/pointer-gestures-unstable-v1-protocol.c
|
||||
src/pointer-gestures-unstable-v1-server-protocol.h
|
||||
src/xserver-protocol.c
|
||||
src/xserver-server-protocol.h
|
||||
src/meta/meta-version.h
|
||||
|
@ -46,6 +46,7 @@ IT_PROG_INTLTOOL([0.41])
|
||||
AC_PROG_CC
|
||||
AC_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_SED
|
||||
AC_HEADER_STDC
|
||||
PKG_PROG_PKG_CONFIG([0.21])
|
||||
|
||||
@ -219,6 +220,10 @@ AS_IF([test "$have_wayland" = "yes"], [
|
||||
[AC_MSG_ERROR([Could not find wayland-scanner in your PATH, required for parsing wayland extension protocols])])
|
||||
AC_SUBST([WAYLAND_SCANNER])
|
||||
AC_DEFINE([HAVE_WAYLAND],[1],[Define if you want to enable Wayland support])
|
||||
|
||||
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.0],
|
||||
[ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
|
||||
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_WAYLAND],[test "$have_wayland" = "yes"])
|
||||
|
||||
|
@ -45,8 +45,8 @@ mutter_built_sources = \
|
||||
|
||||
if HAVE_WAYLAND
|
||||
mutter_built_sources += \
|
||||
pointer-gestures-protocol.c \
|
||||
pointer-gestures-server-protocol.h \
|
||||
pointer-gestures-unstable-v1-protocol.c \
|
||||
pointer-gestures-unstable-v1-server-protocol.h \
|
||||
gtk-shell-protocol.c \
|
||||
gtk-shell-server-protocol.h \
|
||||
xdg-shell-protocol.c \
|
||||
@ -55,7 +55,6 @@ mutter_built_sources += \
|
||||
endif
|
||||
|
||||
wayland_protocols = \
|
||||
wayland/protocol/pointer-gestures.xml \
|
||||
wayland/protocol/gtk-shell.xml \
|
||||
wayland/protocol/xdg-shell.xml \
|
||||
$(NULL)
|
||||
@ -481,6 +480,20 @@ $(dbus_login1_built_sources) : Makefile.am org.freedesktop.login1.xml
|
||||
--generate-c-code meta-dbus-login1 \
|
||||
$(srcdir)/org.freedesktop.login1.xml
|
||||
|
||||
.SECONDEXPANSION:
|
||||
|
||||
define protostability
|
||||
$(shell echo $1 | sed 's/.*\(\<unstable\>\|\<stable\>\).*/\1/')
|
||||
endef
|
||||
|
||||
define protoname
|
||||
$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
|
||||
endef
|
||||
|
||||
%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
|
||||
%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
|
||||
%-protocol.c : $(srcdir)/wayland/protocol/%.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
|
||||
%-server-protocol.h : $(srcdir)/wayland/protocol/%.xml
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "meta-wayland-pointer-gesture-pinch.h"
|
||||
#include "meta-wayland-pointer.h"
|
||||
#include "meta-wayland-surface.h"
|
||||
#include "pointer-gestures-server-protocol.h"
|
||||
#include "pointer-gestures-unstable-v1-server-protocol.h"
|
||||
|
||||
static void
|
||||
handle_pinch_begin (MetaWaylandPointer *pointer,
|
||||
@ -45,10 +45,10 @@ handle_pinch_begin (MetaWaylandPointer *pointer,
|
||||
|
||||
wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
|
||||
{
|
||||
_wl_pointer_gesture_pinch_send_begin (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
pointer->focus_surface->resource,
|
||||
2);
|
||||
zwp_pointer_gesture_pinch_v1_send_begin (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
pointer->focus_surface->resource,
|
||||
2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,12 +67,12 @@ handle_pinch_update (MetaWaylandPointer *pointer,
|
||||
|
||||
wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
|
||||
{
|
||||
_wl_pointer_gesture_pinch_send_update (resource,
|
||||
clutter_event_get_time (event),
|
||||
wl_fixed_from_double (dx),
|
||||
wl_fixed_from_double (dy),
|
||||
wl_fixed_from_double (scale),
|
||||
wl_fixed_from_double (rotation));
|
||||
zwp_pointer_gesture_pinch_v1_send_update (resource,
|
||||
clutter_event_get_time (event),
|
||||
wl_fixed_from_double (dx),
|
||||
wl_fixed_from_double (dy),
|
||||
wl_fixed_from_double (scale),
|
||||
wl_fixed_from_double (rotation));
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,9 +93,9 @@ handle_pinch_end (MetaWaylandPointer *pointer,
|
||||
|
||||
wl_resource_for_each (resource, &pointer_client->pinch_gesture_resources)
|
||||
{
|
||||
_wl_pointer_gesture_pinch_send_end (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
cancelled);
|
||||
zwp_pointer_gesture_pinch_v1_send_end (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
cancelled);
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ pointer_gesture_pinch_destroy (struct wl_client *client,
|
||||
wl_resource_destroy (resource);
|
||||
}
|
||||
|
||||
static const struct _wl_pointer_gesture_pinch_interface pointer_gesture_pinch_interface = {
|
||||
static const struct zwp_pointer_gesture_pinch_v1_interface pointer_gesture_pinch_interface = {
|
||||
pointer_gesture_pinch_destroy
|
||||
};
|
||||
|
||||
@ -151,7 +151,7 @@ meta_wayland_pointer_gesture_pinch_create_new_resource (MetaWaylandPointer *poin
|
||||
pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client);
|
||||
g_return_if_fail (pointer_client != NULL);
|
||||
|
||||
res = wl_resource_create (client, &_wl_pointer_gesture_pinch_interface,
|
||||
res = wl_resource_create (client, &zwp_pointer_gesture_pinch_v1_interface,
|
||||
wl_resource_get_version (gestures_resource), id);
|
||||
wl_resource_set_implementation (res, &pointer_gesture_pinch_interface, pointer,
|
||||
meta_wayland_pointer_unbind_pointer_client_resource);
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "meta-wayland-pointer-gesture-swipe.h"
|
||||
#include "meta-wayland-pointer.h"
|
||||
#include "meta-wayland-surface.h"
|
||||
#include "pointer-gestures-server-protocol.h"
|
||||
#include "pointer-gestures-unstable-v1-server-protocol.h"
|
||||
|
||||
static void
|
||||
handle_swipe_begin (MetaWaylandPointer *pointer,
|
||||
@ -46,10 +46,10 @@ handle_swipe_begin (MetaWaylandPointer *pointer,
|
||||
|
||||
wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
|
||||
{
|
||||
_wl_pointer_gesture_swipe_send_begin (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
pointer->focus_surface->resource,
|
||||
fingers);
|
||||
zwp_pointer_gesture_swipe_v1_send_begin (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
pointer->focus_surface->resource,
|
||||
fingers);
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,10 +66,10 @@ handle_swipe_update (MetaWaylandPointer *pointer,
|
||||
|
||||
wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
|
||||
{
|
||||
_wl_pointer_gesture_swipe_send_update (resource,
|
||||
clutter_event_get_time (event),
|
||||
wl_fixed_from_double (dx),
|
||||
wl_fixed_from_double (dy));
|
||||
zwp_pointer_gesture_swipe_v1_send_update (resource,
|
||||
clutter_event_get_time (event),
|
||||
wl_fixed_from_double (dx),
|
||||
wl_fixed_from_double (dy));
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,9 +90,9 @@ handle_swipe_end (MetaWaylandPointer *pointer,
|
||||
|
||||
wl_resource_for_each (resource, &pointer_client->swipe_gesture_resources)
|
||||
{
|
||||
_wl_pointer_gesture_swipe_send_end (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
cancelled);
|
||||
zwp_pointer_gesture_swipe_v1_send_end (resource, serial,
|
||||
clutter_event_get_time (event),
|
||||
cancelled);
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ pointer_gesture_swipe_release (struct wl_client *client,
|
||||
wl_resource_destroy (resource);
|
||||
}
|
||||
|
||||
static const struct _wl_pointer_gesture_swipe_interface pointer_gesture_swipe_interface = {
|
||||
static const struct zwp_pointer_gesture_swipe_v1_interface pointer_gesture_swipe_interface = {
|
||||
pointer_gesture_swipe_release
|
||||
};
|
||||
|
||||
@ -147,7 +147,7 @@ meta_wayland_pointer_gesture_swipe_create_new_resource (MetaWaylandPointer *poin
|
||||
pointer_client = meta_wayland_pointer_get_pointer_client (pointer, client);
|
||||
g_return_if_fail (pointer_client != NULL);
|
||||
|
||||
res = wl_resource_create (client, &_wl_pointer_gesture_swipe_interface,
|
||||
res = wl_resource_create (client, &zwp_pointer_gesture_swipe_v1_interface,
|
||||
wl_resource_get_version (pointer_resource), id);
|
||||
wl_resource_set_implementation (res, &pointer_gesture_swipe_interface, pointer,
|
||||
meta_wayland_pointer_unbind_pointer_client_resource);
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
#include "meta-wayland-pointer-gestures.h"
|
||||
#include "pointer-gestures-server-protocol.h"
|
||||
#include "pointer-gestures-unstable-v1-server-protocol.h"
|
||||
#include "meta-wayland-versions.h"
|
||||
#include "meta-wayland-private.h"
|
||||
|
||||
@ -53,7 +53,7 @@ gestures_get_pinch (struct wl_client *client,
|
||||
meta_wayland_pointer_gesture_pinch_create_new_resource (pointer, client, resource, id);
|
||||
}
|
||||
|
||||
static const struct _wl_pointer_gestures_interface pointer_gestures_interface = {
|
||||
static const struct zwp_pointer_gestures_v1_interface pointer_gestures_interface = {
|
||||
gestures_get_swipe,
|
||||
gestures_get_pinch
|
||||
};
|
||||
@ -66,16 +66,8 @@ bind_pointer_gestures (struct wl_client *client,
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &_wl_pointer_gestures_interface, version, id);
|
||||
|
||||
if (version != META__WL_POINTER_GESTURES_VERSION)
|
||||
{
|
||||
wl_resource_post_error (resource,
|
||||
_WL_POINTER_GESTURES_ERROR_VERSION_MISMATCH,
|
||||
"The client bound a non-supported version");
|
||||
return;
|
||||
}
|
||||
|
||||
resource = wl_resource_create (client, &zwp_pointer_gestures_v1_interface,
|
||||
version, id);
|
||||
wl_resource_set_implementation (resource, &pointer_gestures_interface,
|
||||
NULL, NULL);
|
||||
}
|
||||
@ -84,7 +76,7 @@ void
|
||||
meta_wayland_pointer_gestures_init (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
wl_global_create (compositor->wayland_display,
|
||||
&_wl_pointer_gestures_interface,
|
||||
META__WL_POINTER_GESTURES_VERSION,
|
||||
&zwp_pointer_gestures_v1_interface,
|
||||
META_ZWP_POINTER_GESTURES_V1_VERSION,
|
||||
NULL, bind_pointer_gestures);
|
||||
}
|
||||
|
@ -44,6 +44,6 @@
|
||||
#define META_XSERVER_VERSION 1
|
||||
#define META_GTK_SHELL_VERSION 2
|
||||
#define META_WL_SUBCOMPOSITOR_VERSION 1
|
||||
#define META__WL_POINTER_GESTURES_VERSION 1
|
||||
#define META_ZWP_POINTER_GESTURES_V1_VERSION 1
|
||||
|
||||
#endif
|
||||
|
@ -1,176 +0,0 @@
|
||||
<protocol name="pointer_gestures">
|
||||
<interface name="_wl_pointer_gestures" version="1">
|
||||
<description summary="touchpad gestures">
|
||||
A global interface to provide semantic touchpad gestures for a given
|
||||
pointer.
|
||||
|
||||
Two gestures are currently supported: swipe and zoom/rotate.
|
||||
All gestures follow a three-stage cycle: begin, update, end and
|
||||
are identified by a unique id.
|
||||
|
||||
Warning! The protocol described in this file is experimental. Each
|
||||
version of this protocol should be considered incompatible with any
|
||||
other version, and a client binding to a version different to the one
|
||||
advertised will be terminated. Once the protocol is declared stable,
|
||||
compatibility is guaranteed, the '_' prefix will be removed from the
|
||||
name and the version will be reset to 1.
|
||||
</description>
|
||||
|
||||
<enum name="error">
|
||||
<entry name="version_mismatch" value="0"/>
|
||||
</enum>
|
||||
|
||||
<request name="get_swipe_gesture">
|
||||
<description summary="get swipe gesture">
|
||||
Create a swipe gesture object. See the
|
||||
wl_pointer_gesture_swipe interface for details.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="_wl_pointer_gesture_swipe"/>
|
||||
<arg name="pointer" type="object" interface="wl_pointer"/>
|
||||
</request>
|
||||
|
||||
<request name="get_pinch_gesture">
|
||||
<description summary="get pinch gesture">
|
||||
Create a pinch gesture object. See the
|
||||
wl_pointer_gesture_pinch interface for details.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="_wl_pointer_gesture_pinch"/>
|
||||
<arg name="pointer" type="object" interface="wl_pointer"/>
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
<interface name="_wl_pointer_gesture_swipe" version="1">
|
||||
<description summary="a swipe gesture object">
|
||||
A swipe gesture object notifies a client about a multi-finger swipe
|
||||
gesture detected on an indirect input device such as a touchpad.
|
||||
The gesture is usually initiated by multiple fingers moving in the
|
||||
same direction but once initiated the direction may change.
|
||||
The precise conditions of when such a gesture is detected are
|
||||
implementation-dependent.
|
||||
|
||||
A gesture consists of three stages: begin, update (optional) and end.
|
||||
There cannot be multiple simultaneous pinch or swipe gestures on a
|
||||
same pointer/seat, how compositors prevent these situations is
|
||||
implementation-dependent.
|
||||
|
||||
A gesture may be cancelled by the compositor or the hardware.
|
||||
Clients should not consider performing permanent or irreversible
|
||||
actions until the end of a gesture has been received.
|
||||
</description>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="destroy the pointer swipe gesture object"/>
|
||||
</request>
|
||||
|
||||
<event name="begin">
|
||||
<description summary="multi-finger swipe begin">
|
||||
This event is sent when a multi-finger swipe gesture is detected
|
||||
on the device.
|
||||
</description>
|
||||
<arg name="serial" type="uint"/>
|
||||
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
<arg name="fingers" type="uint" summary="number of fingers"/>
|
||||
</event>
|
||||
|
||||
<event name="update">
|
||||
<description summary="multi-finger swipe motion">
|
||||
This event is sent when a multi-finger swipe gesture changes the
|
||||
position of the logical center.
|
||||
|
||||
The dx and dy coordinates are relative coordinates of the logical
|
||||
center of the gesture compared to the previous event.
|
||||
</description>
|
||||
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
|
||||
<arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
|
||||
<arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
|
||||
</event>
|
||||
|
||||
<event name="end">
|
||||
<description summary="multi-finger swipe end">
|
||||
This event is sent when a multi-finger swipe gesture ceases to
|
||||
be valid. This may happen when one or more finger is lifted or
|
||||
the gesture is cancelled.
|
||||
|
||||
When a gesture is cancelled, the client should undo state changes
|
||||
caused by this gesture. What causes a gesture to be cancelled is
|
||||
implementation-dependent.
|
||||
</description>
|
||||
<arg name="serial" type="uint"/>
|
||||
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
|
||||
<arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
|
||||
</event>
|
||||
</interface>
|
||||
|
||||
<interface name="_wl_pointer_gesture_pinch" version="1">
|
||||
<description summary="a pinch gesture object">
|
||||
A pinch gesture object notifies a client about a multi-finger pinch
|
||||
gesture detected on an indirect input device such as a touchpad.
|
||||
The gesture is usually initiated by multiple fingers moving towards
|
||||
each other or away from each other, or by two or more fingers rotating
|
||||
around a logical center of gravity. The precise conditions of when
|
||||
such a gesture is detected are implementation-dependent.
|
||||
|
||||
A gesture consists of three stages: begin, update (optional) and end.
|
||||
There cannot be multiple simultaneous pinch or swipe gestures on a
|
||||
same pointer/seat, how compositors prevent these situations is
|
||||
implementation-dependent.
|
||||
|
||||
A gesture may be cancelled by the compositor or the hardware.
|
||||
Clients should not consider performing permanent or irreversible
|
||||
actions until the end of a gesture has been received.
|
||||
</description>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="destroy the pinch gesture object"/>
|
||||
</request>
|
||||
|
||||
<event name="begin">
|
||||
<description summary="multi-finger pinch begin">
|
||||
This event is sent when a multi-finger pinch gesture is detected
|
||||
on the device.
|
||||
</description>
|
||||
<arg name="serial" type="uint"/>
|
||||
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
<arg name="fingers" type="uint" summary="number of fingers"/>
|
||||
</event>
|
||||
|
||||
<event name="update">
|
||||
<description summary="multi-finger pinch motion">
|
||||
This event is sent when a multi-finger pinch gesture changes the
|
||||
position of the logical center, the rotation or the relative scale.
|
||||
|
||||
The dx and dy coordinates are relative coordinates in the
|
||||
surface coordinate space of the logical center of the gesture.
|
||||
|
||||
The scale factor is an absolute scale compared to the
|
||||
pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
|
||||
are now twice as far apart as on pointer_gesture_pinch.begin.
|
||||
|
||||
The rotation is the relative angle in degrees clockwise compared to the previous
|
||||
pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
|
||||
</description>
|
||||
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
|
||||
<arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
|
||||
<arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
|
||||
<arg name="scale" type="fixed" summary="scale relative to the initial finger position"/>
|
||||
<arg name="rotation" type="fixed" summary="angle in degrees cw relative to the previous event"/>
|
||||
</event>
|
||||
|
||||
<event name="end">
|
||||
<description summary="multi-finger pinch end">
|
||||
This event is sent when a multi-finger pinch gesture ceases to
|
||||
be valid. This may happen when one or more finger is lifted or
|
||||
the gesture is cancelled.
|
||||
|
||||
When a gesture is cancelled, the client should undo state changes
|
||||
caused by this gesture. What causes a gesture to be cancelled is
|
||||
implementation-dependent.
|
||||
</description>
|
||||
<arg name="serial" type="uint"/>
|
||||
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
|
||||
<arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
|
||||
</event>
|
||||
</interface>
|
||||
</protocol>
|
Loading…
Reference in New Issue
Block a user