Compare commits

..

1 Commits

Author SHA1 Message Date
Carlos Garnacho
74be2e9f94 wayland: Implement wl_pointer.axis_source/axis_stop/axis_frame emission
As per the spec. wl_pointer.axis_source determines the current source of
scroll events, wl_pointer.axis_stop determines when there's no further
scroll events on any axis (Which Clutter sends as dx/dy=0 events).
wl_pointer.axis_frame marks the end of a series of axis_* events.

v2: Updated to v4 of the protocol spec by
    Peter Hutterer <peter.hutterer@who-t.net>
v3: Update to use Clutter API
2015-10-23 16:21:25 +02:00
12 changed files with 1888 additions and 1599 deletions

14
NEWS
View File

@@ -1,17 +1,3 @@
3.19.1
======
* wayland: Allow to trigger popups through keyboard/touch [Carlos; #756296]
* Fix modifiers-only input source switching on Ubuntu [Alberts; #756543]
* Misc. bug fixes [Jonas, Rui, Giovanni, Florian; #756675, #756660, #746420,
#756548, #756796, #757101, #757148]
Contributors:
Jonas Ådahl, Giovanni Campagna, Carlos Garnacho, Rui Matos,
Alberts Muktupāvels, Florian Müllner
Translations:
Daniel Șerbănescu [ro]
3.18.1
======
* Misc. crash fixes [Jonas, Rui, Carlos, Owen, Florian; #755096, #754979,

View File

@@ -1,7 +1,7 @@
AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [19])
m4_define([mutter_minor_version], [18])
m4_define([mutter_micro_version], [1])
m4_define([mutter_version],
@@ -58,7 +58,7 @@ CANBERRA_GTK_VERSION=0.26
CLUTTER_PACKAGE=clutter-1.0
MUTTER_PC_MODULES="
gtk+-3.0 >= 3.19.1
gtk+-3.0 >= 3.9.11
gio-unix-2.0 >= 2.35.1
pango >= 1.2.0
cairo >= 1.10.0

3353
po/ro.po

File diff suppressed because it is too large Load Diff

View File

@@ -82,7 +82,6 @@ struct _MetaBackendX11Private
gchar *keymap_layouts;
gchar *keymap_variants;
gchar *keymap_options;
int locked_group;
};
typedef struct _MetaBackendX11Private MetaBackendX11Private;
@@ -298,23 +297,15 @@ handle_host_xevent (MetaBackend *backend,
if (event->type == priv->xkb_event_base)
{
XkbEvent *xkb_ev = (XkbEvent *) event;
XkbAnyEvent *xkb_ev = (XkbAnyEvent *) event;
if (xkb_ev->any.device == META_VIRTUAL_CORE_KEYBOARD_ID)
if (xkb_ev->device == META_VIRTUAL_CORE_KEYBOARD_ID)
{
switch (xkb_ev->any.xkb_type)
switch (xkb_ev->xkb_type)
{
case XkbNewKeyboardNotify:
case XkbMapNotify:
keymap_changed (backend);
break;
case XkbStateNotify:
if (xkb_ev->state.changed & XkbGroupLockMask)
{
if (priv->locked_group != xkb_ev->state.locked_group)
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, priv->locked_group);
}
break;
default:
break;
}
@@ -785,7 +776,6 @@ meta_backend_x11_lock_layout_group (MetaBackend *backend,
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
priv->locked_group = idx;
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, idx);
}

View File

@@ -808,15 +808,6 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
{
GBytes *edid;
/* Get this first so that if there are no valid modes we
can immediately skip to the next output without having
to unwind all the assignments below. */
output_get_modes (manager, meta_output, output);
if (meta_output->n_modes == 0)
continue;
meta_output->preferred_mode = meta_output->modes[0];
meta_output->winsys_id = resources->outputs[i];
meta_output->name = g_strdup (output->name);
@@ -833,6 +824,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
meta_output->connector_type = output_get_connector_type (manager_xrandr, meta_output);
output_get_tile_info (manager_xrandr, meta_output);
output_get_modes (manager, meta_output, output);
meta_output->preferred_mode = meta_output->modes[0];
meta_output->n_possible_crtcs = output->ncrtc;
meta_output->possible_crtcs = g_new0 (MetaCRTC *, meta_output->n_possible_crtcs);

View File

@@ -3534,7 +3534,10 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
{
const MetaMonitorInfo *old, *new;
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
if (window->type == META_WINDOW_DESKTOP)
return;
if (window->override_redirect)
{
meta_window_update_monitor (window, FALSE);
return;

View File

@@ -929,7 +929,6 @@ static GtkStyleContext *
create_style_context (GType widget_type,
GtkStyleContext *parent_style,
GtkCssProvider *provider,
const char *object_name,
const char *first_class,
...)
{
@@ -949,9 +948,6 @@ create_style_context (GType widget_type,
gtk_widget_path_append_type (path, widget_type);
if (object_name)
gtk_widget_path_iter_set_object_name (path, -1, object_name);
va_start (ap, first_class);
for (name = first_class; name; name = va_arg (ap, const char *))
gtk_widget_path_iter_add_class (path, -1, name);
@@ -991,7 +987,6 @@ meta_theme_create_style_info (GdkScreen *screen,
create_style_context (META_TYPE_FRAMES,
NULL,
provider,
"decoration",
GTK_STYLE_CLASS_BACKGROUND,
"window-frame",
"ssd",
@@ -1000,7 +995,6 @@ meta_theme_create_style_info (GdkScreen *screen,
create_style_context (GTK_TYPE_HEADER_BAR,
style_info->styles[META_STYLE_ELEMENT_FRAME],
provider,
NULL,
GTK_STYLE_CLASS_TITLEBAR,
GTK_STYLE_CLASS_HORIZONTAL,
"default-decoration",
@@ -1010,14 +1004,12 @@ meta_theme_create_style_info (GdkScreen *screen,
create_style_context (GTK_TYPE_LABEL,
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
provider,
NULL,
GTK_STYLE_CLASS_TITLE,
NULL);
style_info->styles[META_STYLE_ELEMENT_BUTTON] =
create_style_context (GTK_TYPE_BUTTON,
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
provider,
NULL,
GTK_STYLE_CLASS_BUTTON,
"titlebutton",
NULL);
@@ -1025,7 +1017,6 @@ meta_theme_create_style_info (GdkScreen *screen,
create_style_context (GTK_TYPE_IMAGE,
style_info->styles[META_STYLE_ELEMENT_BUTTON],
provider,
NULL,
NULL);
return style_info;
}

View File

@@ -494,10 +494,27 @@ handle_scroll_event (MetaWaylandPointer *pointer,
{
struct wl_resource *resource;
wl_fixed_t x_value = 0, y_value = 0;
enum wl_pointer_axis_source source = -1;
if (clutter_event_is_pointer_emulated (event))
return;
switch (event->scroll.scroll_source)
{
case CLUTTER_SCROLL_SOURCE_WHEEL:
source = WL_POINTER_AXIS_SOURCE_WHEEL;
break;
case CLUTTER_SCROLL_SOURCE_FINGER:
source = WL_POINTER_AXIS_SOURCE_FINGER;
break;
case CLUTTER_SCROLL_SOURCE_CONTINUOUS:
source = WL_POINTER_AXIS_SOURCE_CONTINUOUS;
break;
default:
source = WL_POINTER_AXIS_SOURCE_WHEEL;
break;
}
switch (clutter_event_get_scroll_direction (event))
{
case CLUTTER_SCROLL_UP:
@@ -537,12 +554,31 @@ handle_scroll_event (MetaWaylandPointer *pointer,
{
wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
{
if (wl_resource_get_version (resource) >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
wl_pointer_send_axis_source (resource, source);
if (x_value)
wl_pointer_send_axis (resource, clutter_event_get_time (event),
WL_POINTER_AXIS_HORIZONTAL_SCROLL, x_value);
if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL) &&
wl_resource_get_version (resource) >= WL_POINTER_AXIS_STOP_SINCE_VERSION)
wl_pointer_send_axis_stop (resource,
clutter_event_get_time (event),
WL_POINTER_AXIS_HORIZONTAL_SCROLL);
if (y_value)
wl_pointer_send_axis (resource, clutter_event_get_time (event),
WL_POINTER_AXIS_VERTICAL_SCROLL, y_value);
if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_VERTICAL) &&
wl_resource_get_version (resource) >= WL_POINTER_AXIS_STOP_SINCE_VERSION)
wl_pointer_send_axis_stop (resource,
clutter_event_get_time (event),
WL_POINTER_AXIS_VERTICAL_SCROLL);
if (wl_resource_get_version (resource) >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
wl_pointer_send_axis_frame (resource);
}
}
}

View File

@@ -933,26 +933,22 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
MetaWaylandOutput *wayland_output,
gboolean is_on_output)
{
gpointer orig_id;
gboolean was_on_output = g_hash_table_lookup_extended (surface->outputs_to_destroy_notify_id,
wayland_output,
NULL, &orig_id);
gboolean was_on_output = g_hash_table_contains (surface->outputs,
wayland_output);
if (!was_on_output && is_on_output)
{
gulong id;
id = g_signal_connect (wayland_output, "output-destroyed",
G_CALLBACK (surface_handle_output_destroy),
surface);
g_hash_table_insert (surface->outputs_to_destroy_notify_id, wayland_output,
GSIZE_TO_POINTER ((gsize)id));
g_signal_connect (wayland_output, "output-destroyed",
G_CALLBACK (surface_handle_output_destroy),
surface);
g_hash_table_add (surface->outputs, wayland_output);
surface_entered_output (surface, wayland_output);
}
else if (was_on_output && !is_on_output)
{
g_hash_table_remove (surface->outputs_to_destroy_notify_id, wayland_output);
g_signal_handler_disconnect (wayland_output, (gulong) GPOINTER_TO_SIZE (orig_id));
g_hash_table_remove (surface->outputs, wayland_output);
g_signal_handlers_disconnect_by_func (
wayland_output, (gpointer)surface_handle_output_destroy, surface);
surface_left_output (surface, wayland_output);
}
}
@@ -990,12 +986,6 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
set_surface_is_on_output (surface, wayland_output, is_on_output);
}
static void
surface_output_disconnect_signal (gpointer key, gpointer value, gpointer user_data)
{
g_signal_handler_disconnect (key, (gulong) GPOINTER_TO_SIZE (value));
}
void
meta_wayland_surface_update_outputs (MetaWaylandSurface *surface)
{
@@ -1046,8 +1036,7 @@ wl_surface_destructor (struct wl_resource *resource)
meta_wayland_compositor_destroy_frame_callbacks (compositor, surface);
g_hash_table_foreach (surface->outputs_to_destroy_notify_id, surface_output_disconnect_signal, surface);
g_hash_table_unref (surface->outputs_to_destroy_notify_id);
g_hash_table_unref (surface->outputs);
wl_list_for_each_safe (cb, next, &surface->pending_frame_callback_list, link)
wl_resource_destroy (cb->resource);
@@ -1092,7 +1081,7 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
sync_drag_dest_funcs (surface);
surface->outputs_to_destroy_notify_id = g_hash_table_new (NULL, NULL);
surface->outputs = g_hash_table_new (NULL, NULL);
pending_state_init (&surface->pending);
return surface;

View File

@@ -147,7 +147,7 @@ struct _MetaWaylandSurface
int scale;
int32_t offset_x, offset_y;
GList *subsurfaces;
GHashTable *outputs_to_destroy_notify_id;
GHashTable *outputs;
/* List of pending frame callbacks that needs to stay queued longer than one
* commit sequence, such as when it has not yet been assigned a role.

View File

@@ -39,7 +39,7 @@
#define META_WL_DATA_DEVICE_MANAGER_VERSION 2
#define META_XDG_SHELL_VERSION 1
#define META_WL_SHELL_VERSION 1
#define META_WL_SEAT_VERSION 4
#define META_WL_SEAT_VERSION 5
#define META_WL_OUTPUT_VERSION 2
#define META_XSERVER_VERSION 1
#define META_GTK_SHELL_VERSION 2

View File

@@ -863,7 +863,7 @@ meta_window_x11_grab_op_began (MetaWindow *window,
if (window->sync_request_counter != None)
meta_window_x11_create_sync_request_alarm (window);
if (window->size_hints.width_inc > 2 || window->size_hints.height_inc > 2)
if (window->size_hints.width_inc > 1 || window->size_hints.height_inc > 1)
{
priv->showing_resize_popup = TRUE;
meta_window_refresh_resize_popup (window);