Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d455de32a0 | ||
![]() |
e7390cff83 | ||
![]() |
49ea6486e2 | ||
![]() |
996aeaef41 | ||
![]() |
a27b2597b9 | ||
![]() |
0e8ca1a042 | ||
![]() |
f5f26c9cff | ||
![]() |
91ac69382d | ||
![]() |
8cc345fcf5 | ||
![]() |
96b5042dda | ||
![]() |
428c687b5a | ||
![]() |
82bdd1e353 | ||
![]() |
4bebc5e5fa | ||
![]() |
be5643cee7 | ||
![]() |
2ee1c5fa61 | ||
![]() |
c625d2ee9d | ||
![]() |
3078f70f90 | ||
![]() |
7309b20c25 | ||
![]() |
c16a5ec1cf |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -64,12 +64,10 @@ src/meta-dbus-idle-monitor.[ch]
|
||||
src/meta-dbus-login1.[ch]
|
||||
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/xserver-protocol.c
|
||||
src/xserver-server-protocol.h
|
||||
src/xdg-shell-unstable-v*-protocol.c
|
||||
src/xdg-shell-unstable-v*-server-protocol.h
|
||||
src/pointer-gestures-unstable-v*-protocol.c
|
||||
src/pointer-gestures-unstable-v*-server-protocol.h
|
||||
src/meta/meta-version.h
|
||||
doc/reference/*.args
|
||||
doc/reference/*.bak
|
||||
|
17
NEWS
17
NEWS
@@ -1,3 +1,20 @@
|
||||
3.19.3
|
||||
======
|
||||
* Correct refresh rate units on KMS/Wayland [Daniel; #758653]
|
||||
* Fix crash when initial cursor position is not on a monitor [Marek; #756698]
|
||||
* Fix crash when more CRTs are enabled than outputs connected [Rui; #751638]
|
||||
* Fix touch pointer emulation on wayland [Carlos; #756754]
|
||||
* Allow minimizing windows that don't advertise supporting it [Jasper; #758186]
|
||||
* Force 2-finger scroll by default if available [Bastien; #759304]
|
||||
* Fix crash during XWayland initialization [Marek; #751845]
|
||||
* Ensure to send a ConfigureNotify to just mapped windows [Rui; #759492]
|
||||
* Misc. bug fixes and cleanups [Carlos, Jonas, Lionel; #758239, #758633,
|
||||
#755503, #759374]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Marek Chalupa, Carlos Garnacho, Lionel Landwerlin, Rui Matos,
|
||||
Bastien Nocera, Daniel Stone, Jasper St. Pierre
|
||||
|
||||
3.19.2
|
||||
======
|
||||
* Fix crash on monitor unplug [Rui; #756796]
|
||||
|
11
configure.ac
11
configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [19])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
m4_define([mutter_micro_version], [3])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
@@ -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])
|
||||
|
||||
@@ -62,8 +63,8 @@ MUTTER_PC_MODULES="
|
||||
gio-unix-2.0 >= 2.35.1
|
||||
pango >= 1.2.0
|
||||
cairo >= 1.10.0
|
||||
gsettings-desktop-schemas >= 3.15.92
|
||||
$CLUTTER_PACKAGE >= 1.23.4
|
||||
gsettings-desktop-schemas >= 3.19.3
|
||||
$CLUTTER_PACKAGE >= 1.25.1
|
||||
cogl-1.0 >= 1.17.1
|
||||
upower-glib >= 0.99.0
|
||||
gnome-desktop-3.0
|
||||
@@ -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,19 +45,17 @@ 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 \
|
||||
xdg-shell-server-protocol.h \
|
||||
xdg-shell-unstable-v5-protocol.c \
|
||||
xdg-shell-unstable-v5-server-protocol.h \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
wayland_protocols = \
|
||||
wayland/protocol/pointer-gestures.xml \
|
||||
wayland/protocol/gtk-shell.xml \
|
||||
wayland/protocol/xdg-shell.xml \
|
||||
$(NULL)
|
||||
|
||||
libmutter_la_SOURCES = \
|
||||
@@ -481,6 +479,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
|
||||
|
@@ -27,6 +27,8 @@
|
||||
#include "meta-cursor-renderer.h"
|
||||
|
||||
#include <meta/meta-backend.h>
|
||||
#include <backends/meta-backend-private.h>
|
||||
#include <backends/meta-monitor-manager-private.h>
|
||||
#include <meta/util.h>
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
@@ -116,6 +118,14 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
|
||||
};
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_cursor_in_monitors_area (int x, int y)
|
||||
{
|
||||
MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (meta_get_backend ());
|
||||
return meta_monitor_manager_get_monitor_at_point (monitor_manager,
|
||||
(gfloat) x, (gfloat) y) >= 0;
|
||||
}
|
||||
|
||||
static void
|
||||
update_cursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
@@ -124,6 +134,11 @@ update_cursor (MetaCursorRenderer *renderer,
|
||||
gboolean handled_by_backend;
|
||||
gboolean should_redraw = FALSE;
|
||||
|
||||
/* do not render cursor if it is not on any monitor. Such situation
|
||||
* can occur e. g. after monitor hot-plug */
|
||||
if (!is_cursor_in_monitors_area (priv->current_x, priv->current_y))
|
||||
return;
|
||||
|
||||
if (cursor_sprite)
|
||||
meta_cursor_sprite_prepare_at (cursor_sprite,
|
||||
priv->current_x,
|
||||
|
@@ -63,9 +63,9 @@ struct _MetaInputSettingsClass
|
||||
void (* set_invert_scroll) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean inverted);
|
||||
void (* set_scroll_method) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
GDesktopTouchpadScrollMethod mode);
|
||||
void (* set_edge_scroll) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean enabled);
|
||||
void (* set_scroll_button) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
guint button);
|
||||
|
@@ -395,11 +395,11 @@ update_touchpad_tap_enabled (MetaInputSettings *input_settings,
|
||||
}
|
||||
|
||||
static void
|
||||
update_touchpad_scroll_method (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device)
|
||||
update_touchpad_edge_scroll (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
MetaInputSettingsClass *input_settings_class;
|
||||
GDesktopTouchpadScrollMethod method;
|
||||
gboolean edge_scroll_enabled;
|
||||
MetaInputSettingsPrivate *priv;
|
||||
|
||||
if (device &&
|
||||
@@ -408,19 +408,19 @@ update_touchpad_scroll_method (MetaInputSettings *input_settings,
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
method = g_settings_get_enum (priv->touchpad_settings, "scroll-method");
|
||||
edge_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings, "edge-scrolling-enabled");
|
||||
|
||||
if (device)
|
||||
{
|
||||
settings_device_set_uint_setting (input_settings, device,
|
||||
input_settings_class->set_scroll_method,
|
||||
method);
|
||||
settings_device_set_bool_setting (input_settings, device,
|
||||
input_settings_class->set_edge_scroll,
|
||||
edge_scroll_enabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
settings_set_uint_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
|
||||
(ConfigUintFunc) input_settings_class->set_scroll_method,
|
||||
method);
|
||||
settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
|
||||
(ConfigBoolFunc) input_settings_class->set_edge_scroll,
|
||||
edge_scroll_enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ update_touchpad_click_method (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
MetaInputSettingsClass *input_settings_class;
|
||||
GDesktopTouchpadScrollMethod method;
|
||||
GDesktopTouchpadClickMethod method;
|
||||
MetaInputSettingsPrivate *priv;
|
||||
|
||||
if (device &&
|
||||
@@ -645,8 +645,8 @@ meta_input_settings_changed_cb (GSettings *settings,
|
||||
update_touchpad_tap_enabled (input_settings, NULL);
|
||||
else if (strcmp (key, "send-events") == 0)
|
||||
update_touchpad_send_events (input_settings, NULL);
|
||||
else if (strcmp (key, "scroll-method") == 0)
|
||||
update_touchpad_scroll_method (input_settings, NULL);
|
||||
else if (strcmp (key, "edge-scrolling-enabled") == 0)
|
||||
update_touchpad_edge_scroll (input_settings, NULL);
|
||||
else if (strcmp (key, "click-method") == 0)
|
||||
update_touchpad_click_method (input_settings, NULL);
|
||||
}
|
||||
@@ -771,7 +771,7 @@ apply_device_settings (MetaInputSettings *input_settings,
|
||||
update_device_natural_scroll (input_settings, device);
|
||||
update_touchpad_tap_enabled (input_settings, device);
|
||||
update_touchpad_send_events (input_settings, device);
|
||||
update_touchpad_scroll_method (input_settings, device);
|
||||
update_touchpad_edge_scroll (input_settings, device);
|
||||
update_touchpad_click_method (input_settings, device);
|
||||
|
||||
update_trackball_scroll_button (input_settings, device);
|
||||
|
@@ -178,7 +178,7 @@ make_logical_config (MetaMonitorManager *manager)
|
||||
unsigned int i, j;
|
||||
|
||||
monitor_infos = g_array_sized_new (FALSE, TRUE, sizeof (MetaMonitorInfo),
|
||||
manager->n_outputs);
|
||||
manager->n_crtcs);
|
||||
|
||||
/* Walk the list of MetaCRTCs, and build a MetaMonitorInfo
|
||||
for each of them, unless they reference a rectangle that
|
||||
|
@@ -154,30 +154,30 @@ device_set_click_method (struct libinput_device *libinput_device,
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_native_set_scroll_method (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
GDesktopTouchpadScrollMethod mode)
|
||||
meta_input_settings_native_set_edge_scroll (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean edge_scrolling_enabled)
|
||||
{
|
||||
enum libinput_config_scroll_method scroll_method = 0;
|
||||
struct libinput_device *libinput_device;
|
||||
enum libinput_config_scroll_method supported;
|
||||
|
||||
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
|
||||
supported = libinput_device_config_scroll_get_methods (libinput_device);
|
||||
|
||||
switch (mode)
|
||||
if (supported & LIBINPUT_CONFIG_SCROLL_2FG)
|
||||
{
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_DISABLED:
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING:
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE;
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING:
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (supported & LIBINPUT_CONFIG_SCROLL_EDGE &&
|
||||
edge_scrolling_enabled)
|
||||
{
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
|
||||
}
|
||||
|
||||
device_set_scroll_method (libinput_device, scroll_method);
|
||||
}
|
||||
@@ -252,7 +252,7 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
|
||||
input_settings_class->set_left_handed = meta_input_settings_native_set_left_handed;
|
||||
input_settings_class->set_tap_enabled = meta_input_settings_native_set_tap_enabled;
|
||||
input_settings_class->set_invert_scroll = meta_input_settings_native_set_invert_scroll;
|
||||
input_settings_class->set_scroll_method = meta_input_settings_native_set_scroll_method;
|
||||
input_settings_class->set_edge_scroll = meta_input_settings_native_set_edge_scroll;
|
||||
input_settings_class->set_scroll_button = meta_input_settings_native_set_scroll_button;
|
||||
input_settings_class->set_click_method = meta_input_settings_native_set_click_method;
|
||||
input_settings_class->set_keyboard_repeat = meta_input_settings_native_set_keyboard_repeat;
|
||||
|
@@ -496,8 +496,18 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
|
||||
meta_mode->name = g_strndup (mode->name, DRM_DISPLAY_MODE_LEN);
|
||||
meta_mode->width = mode->hdisplay;
|
||||
meta_mode->height = mode->vdisplay;
|
||||
meta_mode->refresh_rate = (1000 * mode->clock /
|
||||
((float)mode->htotal * mode->vtotal));
|
||||
|
||||
/* Calculate refresh rate in milliHz first for extra precision. */
|
||||
meta_mode->refresh_rate = (mode->clock * 1000000LL) / mode->htotal;
|
||||
meta_mode->refresh_rate += (mode->vtotal / 2);
|
||||
meta_mode->refresh_rate /= mode->vtotal;
|
||||
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
|
||||
meta_mode->refresh_rate *= 2;
|
||||
if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
|
||||
meta_mode->refresh_rate /= 2;
|
||||
if (mode->vscan > 1)
|
||||
meta_mode->refresh_rate /= mode->vscan;
|
||||
meta_mode->refresh_rate /= 1000.0;
|
||||
|
||||
meta_mode->driver_private = g_slice_dup (drmModeModeInfo, mode);
|
||||
meta_mode->driver_notify = (GDestroyNotify)meta_monitor_mode_destroy_notify;
|
||||
|
@@ -199,9 +199,9 @@ meta_input_settings_x11_set_invert_scroll (MetaInputSettings *settings,
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_x11_set_scroll_method (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
GDesktopTouchpadScrollMethod mode)
|
||||
meta_input_settings_x11_set_edge_scroll (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean edge_scroll_enabled)
|
||||
{
|
||||
guchar values[3] = { 0 }; /* 2fg, edge, button. The last value is unused */
|
||||
guchar *available;
|
||||
@@ -211,26 +211,21 @@ meta_input_settings_x11_set_scroll_method (MetaInputSettings *setting
|
||||
if (!available)
|
||||
return;
|
||||
|
||||
switch (mode)
|
||||
if (available[0])
|
||||
{
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_DISABLED:
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING:
|
||||
values[1] = 1;
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING:
|
||||
values[0] = 1;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
else if (available[1] && edge_scroll_enabled)
|
||||
{
|
||||
values[1] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Disabled */
|
||||
}
|
||||
|
||||
if ((values[0] && !available[0]) || (values[1] && !available[1]))
|
||||
g_warning ("Device '%s' does not support scroll mode %d\n",
|
||||
clutter_input_device_get_device_name (device), mode);
|
||||
else
|
||||
change_property (device, "libinput Scroll Method Enabled",
|
||||
XA_INTEGER, 8, &values, 3);
|
||||
change_property (device, "libinput Scroll Method Enabled",
|
||||
XA_INTEGER, 8, &values, 3);
|
||||
|
||||
meta_XFree (available);
|
||||
}
|
||||
@@ -321,7 +316,7 @@ meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
|
||||
input_settings_class->set_left_handed = meta_input_settings_x11_set_left_handed;
|
||||
input_settings_class->set_tap_enabled = meta_input_settings_x11_set_tap_enabled;
|
||||
input_settings_class->set_invert_scroll = meta_input_settings_x11_set_invert_scroll;
|
||||
input_settings_class->set_scroll_method = meta_input_settings_x11_set_scroll_method;
|
||||
input_settings_class->set_edge_scroll = meta_input_settings_x11_set_edge_scroll;
|
||||
input_settings_class->set_scroll_button = meta_input_settings_x11_set_scroll_button;
|
||||
input_settings_class->set_click_method = meta_input_settings_x11_set_click_method;
|
||||
input_settings_class->set_keyboard_repeat = meta_input_settings_x11_set_keyboard_repeat;
|
||||
|
@@ -255,6 +255,31 @@ get_actor_private (MetaWindowActor *actor)
|
||||
return priv;
|
||||
}
|
||||
|
||||
static ClutterTimeline *
|
||||
actor_animate (ClutterActor *actor,
|
||||
ClutterAnimationMode mode,
|
||||
guint duration,
|
||||
const gchar *first_property,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
ClutterTransition *transition;
|
||||
|
||||
clutter_actor_save_easing_state (actor);
|
||||
clutter_actor_set_easing_mode (actor, mode);
|
||||
clutter_actor_set_easing_duration (actor, duration);
|
||||
|
||||
va_start (args, first_property);
|
||||
g_object_set_valist (G_OBJECT (actor), first_property, args);
|
||||
va_end (args);
|
||||
|
||||
transition = clutter_actor_get_transition (actor, first_property);
|
||||
|
||||
clutter_actor_restore_easing_state (actor);
|
||||
|
||||
return CLUTTER_TIMELINE (transition);
|
||||
}
|
||||
|
||||
static void
|
||||
on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
||||
{
|
||||
@@ -271,7 +296,10 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
|
||||
|
||||
if (apriv->orig_parent)
|
||||
{
|
||||
clutter_actor_reparent (a, apriv->orig_parent);
|
||||
g_object_ref (a);
|
||||
clutter_actor_remove_child (clutter_actor_get_parent (a), a);
|
||||
clutter_actor_add_child (apriv->orig_parent, a);
|
||||
g_object_unref (a);
|
||||
apriv->orig_parent = NULL;
|
||||
}
|
||||
|
||||
@@ -360,11 +388,10 @@ switch_workspace (MetaPlugin *plugin,
|
||||
MetaScreen *screen;
|
||||
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||
GList *l;
|
||||
ClutterActor *workspace0 = clutter_group_new ();
|
||||
ClutterActor *workspace1 = clutter_group_new ();
|
||||
ClutterActor *workspace0 = clutter_actor_new ();
|
||||
ClutterActor *workspace1 = clutter_actor_new ();
|
||||
ClutterActor *stage;
|
||||
int screen_width, screen_height;
|
||||
ClutterAnimation *animation;
|
||||
|
||||
screen = meta_plugin_get_screen (plugin);
|
||||
stage = meta_get_stage_for_screen (screen);
|
||||
@@ -373,17 +400,15 @@ switch_workspace (MetaPlugin *plugin,
|
||||
&screen_width,
|
||||
&screen_height);
|
||||
|
||||
clutter_actor_set_anchor_point (workspace1,
|
||||
screen_width,
|
||||
screen_height);
|
||||
clutter_actor_set_pivot_point (workspace1, 1.0, 1.0);
|
||||
clutter_actor_set_position (workspace1,
|
||||
screen_width,
|
||||
screen_height);
|
||||
|
||||
clutter_actor_set_scale (workspace1, 0.0, 0.0);
|
||||
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), workspace1);
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), workspace0);
|
||||
clutter_actor_add_child (stage, workspace1);
|
||||
clutter_actor_add_child (stage, workspace0);
|
||||
|
||||
if (from == to)
|
||||
{
|
||||
@@ -406,12 +431,15 @@ switch_workspace (MetaPlugin *plugin,
|
||||
|
||||
if (win_workspace == to || win_workspace == from)
|
||||
{
|
||||
ClutterActor *parent = win_workspace == to ? workspace1 : workspace0;
|
||||
apriv->orig_parent = clutter_actor_get_parent (actor);
|
||||
|
||||
clutter_actor_reparent (actor,
|
||||
win_workspace == to ? workspace1 : workspace0);
|
||||
clutter_actor_show_all (actor);
|
||||
clutter_actor_raise_top (actor);
|
||||
g_object_ref (actor);
|
||||
clutter_actor_remove_child (clutter_actor_get_parent (actor), actor);
|
||||
clutter_actor_add_child (parent, actor);
|
||||
clutter_actor_show (actor);
|
||||
clutter_actor_set_child_below_sibling (parent, actor, NULL);
|
||||
g_object_unref (actor);
|
||||
}
|
||||
else if (win_workspace < 0)
|
||||
{
|
||||
@@ -431,23 +459,21 @@ switch_workspace (MetaPlugin *plugin,
|
||||
priv->desktop1 = workspace0;
|
||||
priv->desktop2 = workspace1;
|
||||
|
||||
animation = clutter_actor_animate (workspace0, CLUTTER_EASE_IN_SINE,
|
||||
SWITCH_TIMEOUT,
|
||||
"scale-x", 1.0,
|
||||
"scale-y", 1.0,
|
||||
NULL);
|
||||
priv->tml_switch_workspace1 = clutter_animation_get_timeline (animation);
|
||||
priv->tml_switch_workspace1 = actor_animate (workspace0, CLUTTER_EASE_IN_SINE,
|
||||
SWITCH_TIMEOUT,
|
||||
"scale-x", 1.0,
|
||||
"scale-y", 1.0,
|
||||
NULL);
|
||||
g_signal_connect (priv->tml_switch_workspace1,
|
||||
"completed",
|
||||
G_CALLBACK (on_switch_workspace_effect_complete),
|
||||
plugin);
|
||||
|
||||
animation = clutter_actor_animate (workspace1, CLUTTER_EASE_IN_SINE,
|
||||
SWITCH_TIMEOUT,
|
||||
"scale-x", 0.0,
|
||||
"scale-y", 0.0,
|
||||
NULL);
|
||||
priv->tml_switch_workspace2 = clutter_animation_get_timeline (animation);
|
||||
priv->tml_switch_workspace2 = actor_animate (workspace1, CLUTTER_EASE_IN_SINE,
|
||||
SWITCH_TIMEOUT,
|
||||
"scale-x", 0.0,
|
||||
"scale-y", 0.0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -504,19 +530,17 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
|
||||
if (type == META_WINDOW_NORMAL)
|
||||
{
|
||||
ClutterAnimation *animation;
|
||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||
|
||||
animation = clutter_actor_animate (actor,
|
||||
CLUTTER_EASE_IN_SINE,
|
||||
MINIMIZE_TIMEOUT,
|
||||
"scale-x", 0.0,
|
||||
"scale-y", 0.0,
|
||||
"x", (double)icon_geometry.x,
|
||||
"y", (double)icon_geometry.y,
|
||||
NULL);
|
||||
apriv->tml_minimize = clutter_animation_get_timeline (animation);
|
||||
apriv->tml_minimize = actor_animate (actor,
|
||||
CLUTTER_EASE_IN_SINE,
|
||||
MINIMIZE_TIMEOUT,
|
||||
"scale-x", 0.0,
|
||||
"scale-y", 0.0,
|
||||
"x", (double)icon_geometry.x,
|
||||
"y", (double)icon_geometry.y,
|
||||
NULL);
|
||||
data->plugin = plugin;
|
||||
data->actor = actor;
|
||||
g_signal_connect (apriv->tml_minimize, "completed",
|
||||
@@ -561,7 +585,6 @@ map (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
|
||||
if (type == META_WINDOW_NORMAL)
|
||||
{
|
||||
ClutterAnimation *animation;
|
||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||
|
||||
@@ -570,14 +593,13 @@ map (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
clutter_actor_set_scale (actor, 0.5, 0.5);
|
||||
clutter_actor_show (actor);
|
||||
|
||||
animation = clutter_actor_animate (actor,
|
||||
CLUTTER_EASE_OUT_QUAD,
|
||||
MAP_TIMEOUT,
|
||||
"opacity", 255,
|
||||
"scale-x", 1.0,
|
||||
"scale-y", 1.0,
|
||||
NULL);
|
||||
apriv->tml_map = clutter_animation_get_timeline (animation);
|
||||
apriv->tml_map = actor_animate (actor,
|
||||
CLUTTER_EASE_OUT_QUAD,
|
||||
MAP_TIMEOUT,
|
||||
"opacity", 255,
|
||||
"scale-x", 1.0,
|
||||
"scale-y", 1.0,
|
||||
NULL);
|
||||
data->actor = actor;
|
||||
data->plugin = plugin;
|
||||
g_signal_connect (apriv->tml_map, "completed",
|
||||
@@ -618,18 +640,16 @@ destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
|
||||
if (type == META_WINDOW_NORMAL)
|
||||
{
|
||||
ClutterAnimation *animation;
|
||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||
|
||||
animation = clutter_actor_animate (actor,
|
||||
CLUTTER_EASE_OUT_QUAD,
|
||||
DESTROY_TIMEOUT,
|
||||
"opacity", 0,
|
||||
"scale-x", 0.8,
|
||||
"scale-y", 0.8,
|
||||
NULL);
|
||||
apriv->tml_destroy = clutter_animation_get_timeline (animation);
|
||||
apriv->tml_destroy = actor_animate (actor,
|
||||
CLUTTER_EASE_OUT_QUAD,
|
||||
DESTROY_TIMEOUT,
|
||||
"opacity", 0,
|
||||
"scale-x", 0.8,
|
||||
"scale-y", 0.8,
|
||||
NULL);
|
||||
data->plugin = plugin;
|
||||
data->actor = actor;
|
||||
g_signal_connect (apriv->tml_destroy, "completed",
|
||||
@@ -702,7 +722,9 @@ show_tile_preview (MetaPlugin *plugin,
|
||||
clutter_actor_show (preview->actor);
|
||||
|
||||
window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
|
||||
clutter_actor_lower (preview->actor, window_actor);
|
||||
clutter_actor_set_child_below_sibling (clutter_actor_get_parent (preview->actor),
|
||||
preview->actor,
|
||||
window_actor);
|
||||
|
||||
preview->tile_rect = *tile_rect;
|
||||
}
|
||||
|
@@ -182,10 +182,25 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
sequence = clutter_event_get_event_sequence (event);
|
||||
|
||||
/* Set the pointer emulating sequence on touch begin, if eligible */
|
||||
if (event->type == CLUTTER_TOUCH_BEGIN &&
|
||||
!display->pointer_emulating_sequence &&
|
||||
sequence_is_pointer_emulated (display, event))
|
||||
display->pointer_emulating_sequence = sequence;
|
||||
if (event->type == CLUTTER_TOUCH_BEGIN)
|
||||
{
|
||||
if (sequence_is_pointer_emulated (display, event))
|
||||
{
|
||||
/* This is the new pointer emulating sequence */
|
||||
display->pointer_emulating_sequence = sequence;
|
||||
}
|
||||
else if (display->pointer_emulating_sequence == sequence)
|
||||
{
|
||||
/* This sequence was "pointer emulating" in a prior incarnation,
|
||||
* but now it isn't. We unset the pointer emulating sequence at
|
||||
* this point so the current sequence is not mistaken as pointer
|
||||
* emulating, while we've ensured that it's been deemed
|
||||
* "pointer emulating" throughout all of the event processing
|
||||
* of the previous incarnation.
|
||||
*/
|
||||
display->pointer_emulating_sequence = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
MetaWaylandCompositor *compositor = NULL;
|
||||
@@ -335,11 +350,6 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Unset the pointer emulating sequence after its end event is processed */
|
||||
if (event->type == CLUTTER_TOUCH_END &&
|
||||
display->pointer_emulating_sequence == sequence)
|
||||
display->pointer_emulating_sequence = NULL;
|
||||
|
||||
display->current_time = CurrentTime;
|
||||
return bypass_clutter;
|
||||
}
|
||||
|
@@ -5302,6 +5302,11 @@ meta_window_recalc_features (MetaWindow *window)
|
||||
|
||||
meta_window_recalc_skip_features (window);
|
||||
|
||||
/* To prevent users from losing windows, let's prevent users from
|
||||
* minimizing skip-taskbar windows through the window decorations. */
|
||||
if (window->skip_taskbar)
|
||||
window->has_minimize_func = FALSE;
|
||||
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Window %s decorated = %d border_only = %d has_close = %d has_minimize = %d has_maximize = %d has_move = %d has_shade = %d skip_taskbar = %d skip_pager = %d\n",
|
||||
window->desc,
|
||||
@@ -7669,13 +7674,29 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
MetaDisplay *display = window->display;
|
||||
gboolean unmodified;
|
||||
gboolean is_window_grab;
|
||||
ClutterModifierType grab_mods, event_mods;
|
||||
gfloat x, y;
|
||||
guint button;
|
||||
|
||||
if (window->frame && meta_ui_frame_handle_event (window->frame->ui_frame, event))
|
||||
return;
|
||||
|
||||
if (event->type != CLUTTER_BUTTON_PRESS)
|
||||
if (event->type != CLUTTER_BUTTON_PRESS &&
|
||||
event->type != CLUTTER_TOUCH_BEGIN)
|
||||
return;
|
||||
|
||||
if (event->type == CLUTTER_TOUCH_BEGIN)
|
||||
{
|
||||
ClutterEventSequence *sequence;
|
||||
|
||||
button = 1;
|
||||
sequence = clutter_event_get_event_sequence (event);
|
||||
if (!meta_display_is_pointer_emulating_sequence (window->display, sequence))
|
||||
return;
|
||||
}
|
||||
else
|
||||
button = clutter_event_get_button (event);
|
||||
|
||||
if (display->grab_op != META_GRAB_OP_NONE)
|
||||
return;
|
||||
|
||||
@@ -7706,9 +7727,12 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
* care about. Just let the event through.
|
||||
*/
|
||||
|
||||
ClutterModifierType grab_mods = meta_display_get_window_grab_modifiers (display);
|
||||
unmodified = (event->button.modifier_state & grab_mods) == 0;
|
||||
is_window_grab = (event->button.modifier_state & grab_mods) == grab_mods;
|
||||
grab_mods = meta_display_get_window_grab_modifiers (display);
|
||||
event_mods = clutter_event_get_state (event);
|
||||
unmodified = (event_mods & grab_mods) == 0;
|
||||
is_window_grab = (event_mods & grab_mods) == grab_mods;
|
||||
|
||||
clutter_event_get_coords (event, &x, &y);
|
||||
|
||||
if (unmodified)
|
||||
{
|
||||
@@ -7725,7 +7749,7 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
{
|
||||
meta_topic (META_DEBUG_FOCUS,
|
||||
"Focusing %s due to unmodified button %u press (display.c)\n",
|
||||
window->desc, event->button.button);
|
||||
window->desc, button);
|
||||
meta_window_focus (window, event->any.time);
|
||||
}
|
||||
else
|
||||
@@ -7735,9 +7759,9 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
display->allow_terminal_deactivation = TRUE;
|
||||
|
||||
meta_verbose ("Allowing events time %u\n",
|
||||
(unsigned int)event->button.time);
|
||||
(unsigned int)event->any.time);
|
||||
}
|
||||
else if (is_window_grab && (int) event->button.button == meta_prefs_get_mouse_button_resize ())
|
||||
else if (is_window_grab && (int) button == meta_prefs_get_mouse_button_resize ())
|
||||
{
|
||||
if (window->has_resize_func)
|
||||
{
|
||||
@@ -7748,10 +7772,10 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
|
||||
meta_window_get_frame_rect (window, &frame_rect);
|
||||
|
||||
west = event->button.x < (frame_rect.x + 1 * frame_rect.width / 3);
|
||||
east = event->button.x > (frame_rect.x + 2 * frame_rect.width / 3);
|
||||
north = event->button.y < (frame_rect.y + 1 * frame_rect.height / 3);
|
||||
south = event->button.y > (frame_rect.y + 2 * frame_rect.height / 3);
|
||||
west = x < (frame_rect.x + 1 * frame_rect.width / 3);
|
||||
east = x > (frame_rect.x + 2 * frame_rect.width / 3);
|
||||
north = y < (frame_rect.y + 1 * frame_rect.height / 3);
|
||||
south = y > (frame_rect.y + 2 * frame_rect.height / 3);
|
||||
|
||||
if (west)
|
||||
op |= META_GRAB_OP_WINDOW_DIR_WEST;
|
||||
@@ -7769,23 +7793,21 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
op,
|
||||
TRUE,
|
||||
FALSE,
|
||||
event->button.button,
|
||||
button,
|
||||
0,
|
||||
event->any.time,
|
||||
event->button.x,
|
||||
event->button.y);
|
||||
x, y);
|
||||
}
|
||||
}
|
||||
else if (is_window_grab && (int) event->button.button == meta_prefs_get_mouse_button_menu ())
|
||||
else if (is_window_grab && (int) button == meta_prefs_get_mouse_button_menu ())
|
||||
{
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
meta_window_show_menu (window,
|
||||
META_WINDOW_MENU_WM,
|
||||
event->button.x,
|
||||
event->button.y);
|
||||
x, y);
|
||||
}
|
||||
else if (is_window_grab && (int) event->button.button == 1)
|
||||
else if (is_window_grab && (int) button == 1)
|
||||
{
|
||||
if (window->has_move_func)
|
||||
{
|
||||
@@ -7795,11 +7817,10 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
META_GRAB_OP_MOVING,
|
||||
TRUE,
|
||||
FALSE,
|
||||
event->button.button,
|
||||
button,
|
||||
0,
|
||||
event->any.time,
|
||||
event->button.x,
|
||||
event->button.y);
|
||||
x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -56,11 +56,16 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <clutter/evdev/clutter-evdev.h>
|
||||
|
||||
#include "backends/meta-backend-private.h"
|
||||
|
||||
#include "meta-wayland-private.h"
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
#include "backends/native/meta-backend-native.h"
|
||||
#endif
|
||||
|
||||
static void meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard);
|
||||
static void notify_modifiers (MetaWaylandKeyboard *keyboard);
|
||||
|
||||
@@ -452,6 +457,10 @@ meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
|
||||
{
|
||||
gboolean is_press = event->type == CLUTTER_KEY_PRESS;
|
||||
gboolean handled;
|
||||
guint32 code;
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
#endif
|
||||
|
||||
/* Synthetic key events are for autorepeat. Ignore those, as
|
||||
* autorepeat in Wayland is done on the client side. */
|
||||
@@ -462,7 +471,14 @@ meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
|
||||
is_press ? "press" : "release",
|
||||
event->hardware_keycode);
|
||||
|
||||
handled = notify_key (keyboard, event->time, evdev_code (event), is_press);
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
if (META_IS_BACKEND_NATIVE (backend))
|
||||
code = clutter_evdev_event_get_event_code ((const ClutterEvent *) event);
|
||||
else
|
||||
#endif
|
||||
code = evdev_code (event);
|
||||
|
||||
handled = notify_key (keyboard, event->time, code, is_press);
|
||||
|
||||
if (handled)
|
||||
meta_verbose ("Sent event to wayland client\n");
|
||||
|
@@ -99,7 +99,7 @@ bind_output (struct wl_client *client,
|
||||
mode_flags,
|
||||
(int)monitor_info->rect.width,
|
||||
(int)monitor_info->rect.height,
|
||||
(int)monitor_info->refresh_rate);
|
||||
(int)(monitor_info->refresh_rate * 1000));
|
||||
|
||||
if (version >= WL_OUTPUT_SCALE_SINCE_VERSION)
|
||||
wl_output_send_scale (resource, output->scale);
|
||||
@@ -160,7 +160,7 @@ wayland_output_update_for_output (MetaWaylandOutput *wayland_output,
|
||||
mode_flags,
|
||||
(int)monitor_info->rect.width,
|
||||
(int)monitor_info->rect.height,
|
||||
(int)monitor_info->refresh_rate);
|
||||
(int)(monitor_info->refresh_rate * 1000));
|
||||
}
|
||||
|
||||
/* It's very important that we change the output pointer here, as
|
||||
|
@@ -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,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <clutter/evdev/clutter-evdev.h>
|
||||
#include <cogl/cogl.h>
|
||||
#include <cogl/cogl-wayland-server.h>
|
||||
#include <linux/input.h>
|
||||
@@ -62,6 +63,10 @@
|
||||
#include "backends/meta-cursor-tracker-private.h"
|
||||
#include "backends/meta-cursor-renderer.h"
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
#include "backends/native/meta-backend-native.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int (10)
|
||||
@@ -277,26 +282,37 @@ meta_wayland_pointer_send_button (MetaWaylandPointer *pointer,
|
||||
uint32_t button;
|
||||
uint32_t serial;
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
if (META_IS_BACKEND_NATIVE (backend))
|
||||
button = clutter_evdev_event_get_event_code (event);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
button = clutter_event_get_button (event);
|
||||
switch (button)
|
||||
{
|
||||
case 1:
|
||||
button = BTN_LEFT;
|
||||
break;
|
||||
|
||||
/* The evdev input right and middle button numbers are swapped
|
||||
relative to how Clutter numbers them */
|
||||
case 2:
|
||||
button = BTN_MIDDLE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
button = BTN_RIGHT;
|
||||
break;
|
||||
|
||||
default:
|
||||
button = button + (BTN_LEFT - 1) + 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
time = clutter_event_get_time (event);
|
||||
|
||||
button = clutter_event_get_button (event);
|
||||
switch (button)
|
||||
{
|
||||
/* The evdev input right and middle button numbers are swapped
|
||||
relative to how Clutter numbers them */
|
||||
case 2:
|
||||
button = BTN_MIDDLE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
button = BTN_RIGHT;
|
||||
break;
|
||||
|
||||
default:
|
||||
button = button + BTN_LEFT - 1;
|
||||
break;
|
||||
}
|
||||
|
||||
serial = wl_display_next_serial (display);
|
||||
|
||||
wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
|
||||
@@ -582,13 +598,53 @@ meta_wayland_pointer_handle_event (MetaWaylandPointer *pointer,
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_focus (MetaWaylandPointer *pointer,
|
||||
struct wl_resource *resource)
|
||||
meta_wayland_pointer_send_enter (MetaWaylandPointer *pointer,
|
||||
struct wl_resource *pointer_resource,
|
||||
uint32_t serial,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
wl_fixed_t sx, sy;
|
||||
|
||||
meta_wayland_pointer_get_relative_coordinates (pointer, pointer->focus_surface, &sx, &sy);
|
||||
wl_pointer_send_enter (resource, pointer->focus_serial, pointer->focus_surface->resource, sx, sy);
|
||||
meta_wayland_pointer_get_relative_coordinates (pointer, surface, &sx, &sy);
|
||||
wl_pointer_send_enter (pointer_resource,
|
||||
serial,
|
||||
surface->resource,
|
||||
sx, sy);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_send_leave (MetaWaylandPointer *pointer,
|
||||
struct wl_resource *pointer_resource,
|
||||
uint32_t serial,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
wl_pointer_send_leave (pointer_resource, serial, surface->resource);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_broadcast_enter (MetaWaylandPointer *pointer,
|
||||
uint32_t serial,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
struct wl_resource *pointer_resource;
|
||||
|
||||
wl_resource_for_each (pointer_resource,
|
||||
&pointer->focus_client->pointer_resources)
|
||||
meta_wayland_pointer_send_enter (pointer, pointer_resource,
|
||||
serial, surface);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_broadcast_leave (MetaWaylandPointer *pointer,
|
||||
uint32_t serial,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
struct wl_resource *pointer_resource;
|
||||
|
||||
wl_resource_for_each (pointer_resource,
|
||||
&pointer->focus_client->pointer_resources)
|
||||
meta_wayland_pointer_send_leave (pointer, pointer_resource,
|
||||
serial, surface);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -607,18 +663,14 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
wl_resource_get_client (pointer->focus_surface->resource);
|
||||
struct wl_display *display = wl_client_get_display (client);
|
||||
uint32_t serial;
|
||||
struct wl_resource *resource;
|
||||
|
||||
serial = wl_display_next_serial (display);
|
||||
|
||||
if (pointer->focus_client)
|
||||
{
|
||||
wl_resource_for_each (resource,
|
||||
&pointer->focus_client->pointer_resources)
|
||||
{
|
||||
wl_pointer_send_leave (resource, serial, pointer->focus_surface->resource);
|
||||
}
|
||||
|
||||
meta_wayland_pointer_broadcast_leave (pointer,
|
||||
serial,
|
||||
pointer->focus_surface);
|
||||
pointer->focus_client = NULL;
|
||||
}
|
||||
|
||||
@@ -630,7 +682,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
{
|
||||
struct wl_client *client = wl_resource_get_client (surface->resource);
|
||||
struct wl_display *display = wl_client_get_display (client);
|
||||
struct wl_resource *resource;
|
||||
ClutterPoint pos;
|
||||
|
||||
pointer->focus_surface = surface;
|
||||
@@ -649,12 +700,9 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
if (pointer->focus_client)
|
||||
{
|
||||
pointer->focus_serial = wl_display_next_serial (display);
|
||||
|
||||
wl_resource_for_each (resource,
|
||||
&pointer->focus_client->pointer_resources)
|
||||
{
|
||||
broadcast_focus (pointer, resource);
|
||||
}
|
||||
meta_wayland_pointer_broadcast_enter (pointer,
|
||||
pointer->focus_serial,
|
||||
pointer->focus_surface);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -930,7 +978,9 @@ meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer,
|
||||
wl_resource_get_link (cr));
|
||||
|
||||
if (pointer->focus_client == pointer_client)
|
||||
broadcast_focus (pointer, cr);
|
||||
meta_wayland_pointer_send_enter (pointer, cr,
|
||||
pointer->focus_serial,
|
||||
pointer->focus_surface);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include "gtk-shell-server-protocol.h"
|
||||
#include "xdg-shell-server-protocol.h"
|
||||
#include "xdg-shell-unstable-v5-server-protocol.h"
|
||||
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-xwayland-private.h"
|
||||
@@ -1433,8 +1433,8 @@ handle_popup_parent_destroyed (struct wl_listener *listener, void *data)
|
||||
MetaWaylandSurface *surface =
|
||||
wl_container_of (listener, surface, popup.parent_destroy_listener);
|
||||
|
||||
wl_resource_post_error (surface->xdg_popup,
|
||||
XDG_POPUP_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
wl_resource_post_error (surface->xdg_shell_resource,
|
||||
XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
"destroyed popup not top most popup");
|
||||
surface->popup.parent = NULL;
|
||||
|
||||
@@ -1452,8 +1452,8 @@ handle_popup_destroyed (struct wl_listener *listener, void *data)
|
||||
top_popup = meta_wayland_popup_get_top_popup (popup);
|
||||
if (surface != top_popup)
|
||||
{
|
||||
wl_resource_post_error (surface->xdg_popup,
|
||||
XDG_POPUP_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
wl_resource_post_error (surface->xdg_shell_resource,
|
||||
XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
"destroyed popup not top most popup");
|
||||
}
|
||||
|
||||
@@ -1504,7 +1504,7 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
|
||||
(parent_surf->xdg_popup == NULL && parent_surf->xdg_surface == NULL))
|
||||
{
|
||||
wl_resource_post_error (resource,
|
||||
XDG_POPUP_ERROR_INVALID_PARENT,
|
||||
XDG_SHELL_ERROR_INVALID_POPUP_PARENT,
|
||||
"invalid parent surface");
|
||||
return;
|
||||
}
|
||||
@@ -1514,7 +1514,7 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
|
||||
(top_popup != NULL && parent_surf != top_popup))
|
||||
{
|
||||
wl_resource_post_error (resource,
|
||||
XDG_POPUP_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
"parent not top most surface");
|
||||
return;
|
||||
}
|
||||
|
@@ -208,8 +208,8 @@ touch_get_relative_coordinates (MetaWaylandTouch *touch,
|
||||
&event_x, &event_y);
|
||||
}
|
||||
|
||||
*x = event_x;
|
||||
*y = event_y;
|
||||
*x = event_x / surface->scale;
|
||||
*y = event_y / surface->scale;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -337,13 +337,13 @@ meta_wayland_init (void)
|
||||
meta_wayland_pointer_gestures_init (compositor);
|
||||
meta_wayland_seat_init (compositor);
|
||||
|
||||
if (!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display))
|
||||
g_error ("Failed to start X Wayland");
|
||||
|
||||
compositor->display_name = wl_display_add_socket_auto (compositor->wayland_display);
|
||||
if (compositor->display_name == NULL)
|
||||
g_error ("Failed to create socket");
|
||||
|
||||
if (!meta_xwayland_start (&compositor->xwayland_manager, compositor->wayland_display))
|
||||
g_error ("Failed to start X Wayland");
|
||||
|
||||
set_gnome_env ("DISPLAY", meta_wayland_get_xwayland_display_name (compositor));
|
||||
set_gnome_env ("WAYLAND_DISPLAY", meta_wayland_get_wayland_display_name (compositor));
|
||||
}
|
||||
|
@@ -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>
|
@@ -1,485 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<protocol name="xdg_shell">
|
||||
|
||||
<copyright>
|
||||
Copyright © 2008-2013 Kristian Høgsberg
|
||||
Copyright © 2013 Rafael Antognolli
|
||||
Copyright © 2013 Jasper St. Pierre
|
||||
Copyright © 2010-2013 Intel Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that copyright notice and this permission
|
||||
notice appear in supporting documentation, and that the name of
|
||||
the copyright holders not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific,
|
||||
written prior permission. The copyright holders make no
|
||||
representations about the suitability of this software for any
|
||||
purpose. It is provided "as is" without express or implied
|
||||
warranty.
|
||||
|
||||
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
||||
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
</copyright>
|
||||
|
||||
<interface name="xdg_shell" version="1">
|
||||
<description summary="create desktop-style surfaces">
|
||||
xdg_shell allows clients to turn a wl_surface into a "real window"
|
||||
which can be dragged, resized, stacked, and moved around by the
|
||||
user. Everything about this interface is suited towards traditional
|
||||
desktop environments.
|
||||
</description>
|
||||
|
||||
<enum name="version">
|
||||
<description summary="latest protocol version">
|
||||
The 'current' member of this enum gives the version of the
|
||||
protocol. Implementations can compare this to the version
|
||||
they implement using static_assert to ensure the protocol and
|
||||
implementation versions match.
|
||||
</description>
|
||||
<entry name="current" value="5" summary="Always the latest version"/>
|
||||
</enum>
|
||||
|
||||
<enum name="error">
|
||||
<entry name="role" value="0" summary="given wl_surface has another role"/>
|
||||
</enum>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="destroy xdg_shell">
|
||||
Destroy this xdg_shell object.
|
||||
|
||||
Destroying a bound xdg_shell object while there are surfaces
|
||||
still alive with roles from this interface is illegal and will
|
||||
result in a protocol error. Make sure to destroy all surfaces
|
||||
before destroying this object.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="use_unstable_version">
|
||||
<description summary="enable use of this unstable version">
|
||||
Negotiate the unstable version of the interface. This
|
||||
mechanism is in place to ensure client and server agree on the
|
||||
unstable versions of the protocol that they speak or exit
|
||||
cleanly if they don't agree. This request will go away once
|
||||
the xdg-shell protocol is stable.
|
||||
</description>
|
||||
<arg name="version" type="int"/>
|
||||
</request>
|
||||
|
||||
<request name="get_xdg_surface">
|
||||
<description summary="create a shell surface from a surface">
|
||||
This creates an xdg_surface for the given surface and gives it the
|
||||
xdg_surface role. See the documentation of xdg_surface for more details.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="xdg_surface"/>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
</request>
|
||||
|
||||
<request name="get_xdg_popup">
|
||||
<description summary="create a popup for a surface">
|
||||
This creates an xdg_popup for the given surface and gives it the
|
||||
xdg_popup role. See the documentation of xdg_popup for more details.
|
||||
|
||||
This request must be used in response to some sort of user action
|
||||
like a button press, key press, or touch down event.
|
||||
</description>
|
||||
<arg name="id" type="new_id" interface="xdg_popup"/>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
<arg name="parent" type="object" interface="wl_surface"/>
|
||||
<arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
|
||||
<arg name="serial" type="uint" summary="the serial of the user event"/>
|
||||
<arg name="x" type="int"/>
|
||||
<arg name="y" type="int"/>
|
||||
</request>
|
||||
|
||||
<event name="ping">
|
||||
<description summary="check if the client is alive">
|
||||
The ping event asks the client if it's still alive. Pass the
|
||||
serial specified in the event back to the compositor by sending
|
||||
a "pong" request back with the specified serial.
|
||||
|
||||
Compositors can use this to determine if the client is still
|
||||
alive. It's unspecified what will happen if the client doesn't
|
||||
respond to the ping request, or in what timeframe. Clients should
|
||||
try to respond in a reasonable amount of time.
|
||||
</description>
|
||||
<arg name="serial" type="uint" summary="pass this to the pong request"/>
|
||||
</event>
|
||||
|
||||
<request name="pong">
|
||||
<description summary="respond to a ping event">
|
||||
A client must respond to a ping event with a pong request or
|
||||
the client may be deemed unresponsive.
|
||||
</description>
|
||||
<arg name="serial" type="uint" summary="serial of the ping event"/>
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
<interface name="xdg_surface" version="1">
|
||||
<description summary="A desktop window">
|
||||
An interface that may be implemented by a wl_surface, for
|
||||
implementations that provide a desktop-style user interface.
|
||||
|
||||
It provides requests to treat surfaces like windows, allowing to set
|
||||
properties like maximized, fullscreen, minimized, and to move and resize
|
||||
them, and associate metadata like title and app id.
|
||||
</description>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="Destroy the xdg_surface">
|
||||
Unmap and destroy the window. The window will be effectively
|
||||
hidden from the user's point of view, and all state like
|
||||
maximization, fullscreen, and so on, will be lost.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<request name="set_parent">
|
||||
<description summary="set the parent of this surface">
|
||||
Set the "parent" of this surface. This window should be stacked
|
||||
above a parent. The parent surface must be mapped as long as this
|
||||
surface is mapped.
|
||||
|
||||
Parent windows should be set on dialogs, toolboxes, or other
|
||||
"auxilliary" surfaces, so that the parent is raised when the dialog
|
||||
is raised.
|
||||
</description>
|
||||
<arg name="parent" type="object" interface="xdg_surface" allow-null="true"/>
|
||||
</request>
|
||||
|
||||
<request name="set_title">
|
||||
<description summary="set surface title">
|
||||
Set a short title for the surface.
|
||||
|
||||
This string may be used to identify the surface in a task bar,
|
||||
window list, or other user interface elements provided by the
|
||||
compositor.
|
||||
|
||||
The string must be encoded in UTF-8.
|
||||
</description>
|
||||
<arg name="title" type="string"/>
|
||||
</request>
|
||||
|
||||
<request name="set_app_id">
|
||||
<description summary="set application ID">
|
||||
Set an application identifier for the surface.
|
||||
|
||||
The app ID identifies the general class of applications to which
|
||||
the surface belongs. The compositor can use this to group multiple
|
||||
applications together, or to determine how to launch a new
|
||||
application.
|
||||
|
||||
See the desktop-entry specification [0] for more details on
|
||||
application identifiers and how they relate to well-known DBus
|
||||
names and .desktop files.
|
||||
|
||||
[0] http://standards.freedesktop.org/desktop-entry-spec/
|
||||
</description>
|
||||
<arg name="app_id" type="string"/>
|
||||
</request>
|
||||
|
||||
<request name="show_window_menu">
|
||||
<description summary="show the window menu">
|
||||
Clients implementing client-side decorations might want to show
|
||||
a context menu when right-clicking on the decorations, giving the
|
||||
user a menu that they can use to maximize or minimize the window.
|
||||
|
||||
This request asks the compositor to pop up such a window menu at
|
||||
the given position, relative to the local surface coordinates of
|
||||
the parent surface. There are no guarantees as to what menu items
|
||||
the window menu contains.
|
||||
|
||||
This request must be used in response to some sort of user action
|
||||
like a button press, key press, or touch down event.
|
||||
</description>
|
||||
|
||||
<arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
|
||||
<arg name="serial" type="uint" summary="the serial of the user event"/>
|
||||
<arg name="x" type="int" summary="the x position to pop up the window menu at"/>
|
||||
<arg name="y" type="int" summary="the y position to pop up the window menu at"/>
|
||||
</request>
|
||||
|
||||
<request name="move">
|
||||
<description summary="start an interactive move">
|
||||
Start an interactive, user-driven move of the surface.
|
||||
|
||||
This request must be used in response to some sort of user action
|
||||
like a button press, key press, or touch down event.
|
||||
|
||||
The server may ignore move requests depending on the state of
|
||||
the surface (e.g. fullscreen or maximized).
|
||||
</description>
|
||||
<arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
|
||||
<arg name="serial" type="uint" summary="the serial of the user event"/>
|
||||
</request>
|
||||
|
||||
<enum name="resize_edge">
|
||||
<description summary="edge values for resizing">
|
||||
These values are used to indicate which edge of a surface
|
||||
is being dragged in a resize operation. The server may
|
||||
use this information to adapt its behavior, e.g. choose
|
||||
an appropriate cursor image.
|
||||
</description>
|
||||
<entry name="none" value="0"/>
|
||||
<entry name="top" value="1"/>
|
||||
<entry name="bottom" value="2"/>
|
||||
<entry name="left" value="4"/>
|
||||
<entry name="top_left" value="5"/>
|
||||
<entry name="bottom_left" value="6"/>
|
||||
<entry name="right" value="8"/>
|
||||
<entry name="top_right" value="9"/>
|
||||
<entry name="bottom_right" value="10"/>
|
||||
</enum>
|
||||
|
||||
<request name="resize">
|
||||
<description summary="start an interactive resize">
|
||||
Start a user-driven, interactive resize of the surface.
|
||||
|
||||
This request must be used in response to some sort of user action
|
||||
like a button press, key press, or touch down event.
|
||||
|
||||
The server may ignore resize requests depending on the state of
|
||||
the surface (e.g. fullscreen or maximized).
|
||||
</description>
|
||||
<arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
|
||||
<arg name="serial" type="uint" summary="the serial of the user event"/>
|
||||
<arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
|
||||
</request>
|
||||
|
||||
<enum name="state">
|
||||
<description summary="types of state on the surface">
|
||||
The different state values used on the surface. This is designed for
|
||||
state values like maximized, fullscreen. It is paired with the
|
||||
configure event to ensure that both the client and the compositor
|
||||
setting the state can be synchronized.
|
||||
|
||||
States set in this way are double-buffered. They will get applied on
|
||||
the next commit.
|
||||
|
||||
Desktop environments may extend this enum by taking up a range of
|
||||
values and documenting the range they chose in this description.
|
||||
They are not required to document the values for the range that they
|
||||
chose. Ideally, any good extensions from a desktop environment should
|
||||
make its way into standardization into this enum.
|
||||
|
||||
The current reserved ranges are:
|
||||
|
||||
0x0000 - 0x0FFF: xdg-shell core values, documented below.
|
||||
0x1000 - 0x1FFF: GNOME
|
||||
</description>
|
||||
<entry name="maximized" value="1" summary="the surface is maximized">
|
||||
The surface is maximized. The window geometry specified in the configure
|
||||
event must be obeyed by the client.
|
||||
</entry>
|
||||
<entry name="fullscreen" value="2" summary="the surface is fullscreen">
|
||||
The surface is fullscreen. The window geometry specified in the configure
|
||||
event must be obeyed by the client.
|
||||
</entry>
|
||||
<entry name="resizing" value="3">
|
||||
The surface is being resized. The window geometry specified in the
|
||||
configure event is a maximum; the client cannot resize beyond it.
|
||||
Clients that have aspect ratio or cell sizing configuration can use
|
||||
a smaller size, however.
|
||||
</entry>
|
||||
<entry name="activated" value="4">
|
||||
Client window decorations should be painted as if the window is
|
||||
active. Do not assume this means that the window actually has
|
||||
keyboard or pointer focus.
|
||||
</entry>
|
||||
</enum>
|
||||
|
||||
<event name="configure">
|
||||
<description summary="suggest a surface change">
|
||||
The configure event asks the client to resize its surface or to
|
||||
change its state.
|
||||
|
||||
The width and height arguments specify a hint to the window
|
||||
about how its surface should be resized in window geometry
|
||||
coordinates.
|
||||
|
||||
The states listed in the event specify how the width/height
|
||||
arguments should be interpreted, and possibly how it should be
|
||||
drawn.
|
||||
|
||||
Clients should arrange their surface for the new size and
|
||||
states, and then send a ack_configure request with the serial
|
||||
sent in this configure event at some point before committing
|
||||
the new surface.
|
||||
|
||||
If the client receives multiple configure events before it
|
||||
can respond to one, it is free to discard all but the last
|
||||
event it received.
|
||||
</description>
|
||||
|
||||
<arg name="width" type="int"/>
|
||||
<arg name="height" type="int"/>
|
||||
<arg name="states" type="array"/>
|
||||
<arg name="serial" type="uint"/>
|
||||
</event>
|
||||
|
||||
<request name="ack_configure">
|
||||
<description summary="ack a configure event">
|
||||
When a configure event is received, if a client commits the
|
||||
surface in response to the configure event, then the client
|
||||
must make a ack_configure request before the commit request,
|
||||
passing along the serial of the configure event.
|
||||
|
||||
The compositor might use this information to move a surface
|
||||
to the top left only when the client has drawn itself for
|
||||
the maximized or fullscreen state.
|
||||
|
||||
If the client receives multiple configure events before it
|
||||
can respond to one, it only has to ack the last configure event.
|
||||
</description>
|
||||
<arg name="serial" type="uint" summary="the serial from the configure event"/>
|
||||
</request>
|
||||
|
||||
<request name="set_window_geometry">
|
||||
<description summary="set the new window geometry">
|
||||
The window geometry of a window is its "visible bounds" from the
|
||||
user's perspective. Client-side decorations often have invisible
|
||||
portions like drop-shadows which should be ignored for the
|
||||
purposes of aligning, placing and constraining windows.
|
||||
|
||||
Once the window geometry of the surface is set once, it is not
|
||||
possible to unset it, and it will remain the same until
|
||||
set_window_geometry is called again, even if a new subsurface or
|
||||
buffer is attached.
|
||||
|
||||
If never set, the value is the full bounds of the surface,
|
||||
including any subsurfaces. This updates dynamically on every
|
||||
commit. This unset mode is meant for extremely simple clients.
|
||||
|
||||
If responding to a configure event, the window geometry in here
|
||||
must respect the sizing negotiations specified by the states in
|
||||
the configure event.
|
||||
|
||||
The width and height must be greater than zero.
|
||||
</description>
|
||||
<arg name="x" type="int"/>
|
||||
<arg name="y" type="int"/>
|
||||
<arg name="width" type="int"/>
|
||||
<arg name="height" type="int"/>
|
||||
</request>
|
||||
|
||||
<request name="set_maximized" />
|
||||
<request name="unset_maximized" />
|
||||
|
||||
<request name="set_fullscreen">
|
||||
<description summary="set the window as fullscreen on a monitor">
|
||||
Make the surface fullscreen.
|
||||
|
||||
You can specify an output that you would prefer to be fullscreen.
|
||||
If this value is NULL, it's up to the compositor to choose which
|
||||
display will be used to map this surface.
|
||||
</description>
|
||||
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
|
||||
</request>
|
||||
<request name="unset_fullscreen" />
|
||||
|
||||
<request name="set_minimized">
|
||||
<description summary="set the window as minimized">
|
||||
Request that the compositor minimize your surface. There is no
|
||||
way to know if the surface is currently minimized, nor is there
|
||||
any way to unset minimization on this surface.
|
||||
|
||||
If you are looking to throttle redrawing when minimized, please
|
||||
instead use the wl_surface.frame event for this, as this will
|
||||
also work with live previews on windows in Alt-Tab, Expose or
|
||||
similar compositor features.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<event name="close">
|
||||
<description summary="surface wants to be closed">
|
||||
The close event is sent by the compositor when the user
|
||||
wants the surface to be closed. This should be equivalent to
|
||||
the user clicking the close button in client-side decorations,
|
||||
if your application has any...
|
||||
|
||||
This is only a request that the user intends to close your
|
||||
window. The client may choose to ignore this request, or show
|
||||
a dialog to ask the user to save their data...
|
||||
</description>
|
||||
</event>
|
||||
</interface>
|
||||
|
||||
<interface name="xdg_popup" version="1">
|
||||
<description summary="short-lived, popup surfaces for menus">
|
||||
A popup surface is a short-lived, temporary surface that can be
|
||||
used to implement menus. It takes an explicit grab on the surface
|
||||
that will be dismissed when the user dismisses the popup. This can
|
||||
be done by the user clicking outside the surface, using the keyboard,
|
||||
or even locking the screen through closing the lid or a timeout.
|
||||
|
||||
When the popup is dismissed, a popup_done event will be sent out,
|
||||
and at the same time the surface will be unmapped. The xdg_popup
|
||||
object is now inert and cannot be reactivated, so clients should
|
||||
destroy it. Explicitly destroying the xdg_popup object will also
|
||||
dismiss the popup and unmap the surface.
|
||||
|
||||
Clients will receive events for all their surfaces during this
|
||||
grab (which is an "owner-events" grab in X11 parlance). This is
|
||||
done so that users can navigate through submenus and other
|
||||
"nested" popup windows without having to dismiss the topmost
|
||||
popup.
|
||||
|
||||
Clients that want to dismiss the popup when another surface of
|
||||
their own is clicked should dismiss the popup using the destroy
|
||||
request.
|
||||
|
||||
The parent surface must have either an xdg_surface or xdg_popup
|
||||
role.
|
||||
|
||||
Specifying an xdg_popup for the parent means that the popups are
|
||||
nested, with this popup now being the topmost popup. Nested
|
||||
popups must be destroyed in the reverse order they were created
|
||||
in, e.g. the only popup you are allowed to destroy at all times
|
||||
is the topmost one.
|
||||
|
||||
If there is an existing popup when creating a new popup, the
|
||||
parent must be the current topmost popup.
|
||||
|
||||
A parent surface must be mapped before the new popup is mapped.
|
||||
|
||||
When compositors choose to dismiss a popup, they will likely
|
||||
dismiss every nested popup as well.
|
||||
|
||||
The x and y arguments specify where the top left of the popup
|
||||
should be placed, relative to the local surface coordinates of the
|
||||
parent surface.
|
||||
</description>
|
||||
|
||||
<enum name="error">
|
||||
<description summary="xdg_popup error values">
|
||||
These errors can be emitted in response to xdg_popup requests.
|
||||
</description>
|
||||
<entry name="not_the_topmost_popup" value="0" summary="The client tried to map or destroy a non-toplevel popup"/>
|
||||
<entry name="invalid_parent" value="1" summary="The client specified an invalid parent surface"/>
|
||||
</enum>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="remove xdg_popup interface">
|
||||
This destroys the popup. Explicitly destroying the xdg_popup
|
||||
object will also dismiss the popup, and unmap the surface.
|
||||
|
||||
If this xdg_popup is not the "topmost" popup, a protocol error
|
||||
will be sent.
|
||||
</description>
|
||||
</request>
|
||||
|
||||
<event name="popup_done">
|
||||
<description summary="popup interaction is done">
|
||||
The popup_done event is sent out when a popup is dismissed
|
||||
by the compositor.
|
||||
</description>
|
||||
</event>
|
||||
|
||||
</interface>
|
||||
</protocol>
|
@@ -389,7 +389,7 @@ meta_window_apply_session_info (MetaWindow *window,
|
||||
"Restoring minimized state %d for window %s\n",
|
||||
info->minimized, window->desc);
|
||||
|
||||
if (window->has_minimize_func && info->minimized)
|
||||
if (info->minimized)
|
||||
meta_window_minimize (window);
|
||||
}
|
||||
|
||||
@@ -542,13 +542,10 @@ meta_window_x11_manage (MetaWindow *window)
|
||||
* For normal windows, do a full ConfigureRequest based on the
|
||||
* window hints, as that's what the ICCCM says to do.
|
||||
*/
|
||||
priv->client_rect = window->rect;
|
||||
window->buffer_rect = window->rect;
|
||||
|
||||
if (window->override_redirect)
|
||||
{
|
||||
priv->client_rect = window->rect;
|
||||
window->buffer_rect = window->rect;
|
||||
}
|
||||
else
|
||||
if (!window->override_redirect)
|
||||
{
|
||||
MetaRectangle rect;
|
||||
MetaMoveResizeFlags flags;
|
||||
@@ -2441,8 +2438,7 @@ meta_window_x11_client_message (MetaWindow *window,
|
||||
{
|
||||
meta_verbose ("WM_CHANGE_STATE client message, state: %ld\n",
|
||||
event->xclient.data.l[0]);
|
||||
if (event->xclient.data.l[0] == IconicState &&
|
||||
window->has_minimize_func)
|
||||
if (event->xclient.data.l[0] == IconicState)
|
||||
meta_window_minimize (window);
|
||||
|
||||
return TRUE;
|
||||
|
Reference in New Issue
Block a user