Compare commits

...

47 Commits

Author SHA1 Message Date
Florian Müllner
ea08ed7dc4 Bump version to 3.21.90
Update NEWS.
2016-08-19 12:41:06 +02:00
Florian Müllner
3248c6852c build: Say good-bye to intltool
intltool is unmaintained nowadays while upstream gettext gained
support for formats like GSettings schemas and .desktop files,
and offers a mechanism to teach it about other XML formats not
yet supported out of the box which we can use for the rest.
So there's nothing stopping us, just make the switch ...

https://bugzilla.gnome.org/show_bug.cgi?id=769073
2016-08-19 11:04:48 +02:00
Matej Urbančič
5649734100 Updated Slovenian translation 2016-08-18 23:16:28 +02:00
Jonas Ådahl
c55943d753 cogl: Fix a few GISCAN warnings
We tried to resolve non-introspected types; lets skip those. We didn't
have a vfunc scope on a for-each loop; declared it synchronous.

https://bugzilla.gnome.org/show_bug.cgi?id=769800
2016-08-18 11:32:33 +08:00
Marek Černocký
19e02b3bbe Updated Czech translation 2016-08-17 13:15:56 +02:00
Simon McVittie
eb7f33265a META_PLUGIN_DECLARE: don't emit an old-style definition
An empty argument list means "unspecified arguments", and not
"no arguments" like it does in C++. If an implementer of Mutter
plugins uses gcc -Wold-style-definition, as configured by
AX_COMPILER_FLAGS_CFLAGS, they will get warnings about this.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Florian Müllner <fmuellner@gnome.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=769971
2016-08-16 13:01:17 +01:00
Jonas Ådahl
9f6f778589 MetaMonitorManagerKms: Set output scale when assigning crtc
The scale will have been set to 1 no matter what when initializing the
MetaOutput since it at the time didn't have an CRTC assigned to it.
Now, when we assign the CRTC to the output, we need to update the scale.

https://bugzilla.gnome.org/show_bug.cgi?id=769505
2016-08-12 14:58:39 +08:00
Jonas Ådahl
1f657d2c81 monitor-manager: Always set the monitor info scale
https://bugzilla.gnome.org/show_bug.cgi?id=769505
2016-08-12 14:58:39 +08:00
Jonas Ådahl
6940169f46 MetaMonitorManagerKms: Split up read_current() into logical chunks
Instead of reading all the different state in one huge function, split
it up into logical chunks, making it easier to read.

https://bugzilla.gnome.org/show_bug.cgi?id=769505
2016-08-12 14:58:39 +08:00
Piotr Drąg
4678c24d83 Updated POTFILES.skip 2016-08-10 17:21:05 +02:00
Carlos Garnacho
1ca57e0923 backends: Prepare for virtual devices
Those have no backing libinput_device, and configuration does not
apply to those.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:36:42 +02:00
Carlos Garnacho
b53b94e6f2 clutter/evdev: Implement ClutterVirtualInputDevice::notify_keyval
This is somewhat gross at the moment, because we're after all mimicking
real keyboard events, we can only lookup keycodes that are available
in the current map, and the control of levels is rather limited.

Eventually, we want to implement the text_input protocol, handle these
events separately to MetaWaylandKeyboard, so event->key.keyval is
is guaranteed to be the final result. Until then, this is the farthest
we can get.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:36:42 +02:00
Carlos Garnacho
4abd31d863 clutter: Add ClutterVirtualInputDevice vmethod to notify keysyms
Evcodes don't cut it when we have something already specifying the
character to be printed, despite the current group/level. This API
allows some more control on the intended output.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Carlos Garnacho
3c8b1462bc clutter: Make ClutterVirtualInputDevice public
This includes adding documentation and introspection annotations,
and marking the functions as extern.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Carlos Garnacho
27a77fa115 clutter/evdev: Allow specifying the ClutterInputMode of virtual devices
The seat core keyboard/pointer will be "master", the ones created through
ClutterVirtualInputDevice will be "slaves".

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Jonas Ådahl
0992b5c53e ClutterVirtualInputDeviceEvdev: Forward button and key presses
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 11:03:18 +02:00
Jonas Ådahl
e928370bf0 ClutterSeatEvdev: Keep track of button count
libinput does it for us, but only for physical devices. When we add
virtual devices to the same seat, we need to track button press count
ourself.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
d2b05f0305 ClutterVirtualInputDeviceEvdev: Forward motion events
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
bd326d38ac ClutterVirtualInputDeviceEvdev: Create associated ClutterInputDevice
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
8e335ce183 ClutterVirtualInputDeviceEvdev: Construct with a specific seat
We are still single seated, so until we are properly multi seated its
always the main seat.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
364b184f41 ClutterVirtualInputDevice: Store the device type
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
94016f7257 clutter/evdev: Move keyboard and pointer notification into seat
We notify per seat; so lets move the logic there. Touch and tablets to
follow later.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
e38a8363e4 ClutterVirtualInputDevice: Keep track of the device manager
https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
76eb27e786 ClutterDeviceManagerEvdev: Split out seat into a separate file
Split out ClutterSeatEvdev functionality into a separate file.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:24 +02:00
Jonas Ådahl
5db2be414b clutter: Add virtual input device API
Virtual input devices aim to enable injecting input events as if they
came from hardware events. This is useful for things such as remote
controlling, for example via a remote desktop session.

The API so far only consists of stumps.

https://bugzilla.gnome.org/show_bug.cgi?id=765009
2016-08-10 10:39:19 +02:00
Fabio Tomat
61bfe04b7b Updated Friulian translation 2016-08-07 16:19:13 +00:00
Yosef Or Boczko
1931d0ef51 Updated Hebrew translation 2016-08-07 15:13:49 +03:00
Fabio Tomat
46f1dcaecc Updated Friulian translation 2016-08-07 10:39:25 +00:00
Carlos Garnacho
5c9a2c54c4 xwayland: Avoid late errno checks
We do some things when binding to a socket fails (closing the fd,
logging, unlinking files, ...) those might affect errno in some
or other way, so it might no longer be EADDRINUSE even if we later
try to make those non fatal.

It seems better to check errno soon after the failure, and don't
rely on it in any way at a later point. All error paths in
bind_to_abstract_socket() also have early logging, which also might
help figure out better the point of failure when the socket fails
to be created.

https://bugzilla.gnome.org/show_bug.cgi?id=769578
2016-08-06 17:14:52 +02:00
Carlos Garnacho
dd549604e2 xwayland: Fix typo
Check the unix_fd, which is the one just created, the abstract_fd
is already checked above.
2016-08-06 16:42:25 +02:00
Balázs Úr
8913cbb06d Updated Hungarian translation 2016-08-04 22:07:32 +00:00
Fabio Tomat
96790276c5 Updated Friulian translation 2016-08-04 15:51:56 +00:00
Dušan Kazik
84eeebe32f Updated Slovak translation 2016-08-04 13:28:48 +00:00
Aurimas Černius
01f1de704d Updated Lithuanian translation 2016-08-03 22:15:56 +03:00
Jonas Ådahl
6894563667 MetaRendererView: Fix GObject parent
Set ClutterStageViewCogl as parent of MetaRendererView, since that is
the actual parent.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-08-03 11:20:55 +08:00
Jonas Ådahl
9b4e8695f3 MetaRendererX11: Allocate offscreen framebuffers up front
Allocate the offscreen stage view framebuffers up front; otherwise they
may get allocated after the viewport calculated by the stage is set,
which would cause the viewport to be incorrect until recalculated.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-08-03 11:20:55 +08:00
Jonas Ådahl
adcd0fe9b4 ClutterStageView: Initialize viewport/projection as dirty
Initially the viewport and projection is not calculated and should thus
be marked as dirty.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-08-03 11:20:55 +08:00
Jonas Ådahl
cc4a65fe94 x11/nested: Only paint monitor stage views when enabled
Only paint the per monitor stage views when enabled, otherwise bad
things happen.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-08-03 11:19:24 +08:00
Jonas Ådahl
53061c7005 MetaInputSettings: Initialize the accel-profile setting
Shouldn't just update them when they change; they also need to be
set when initializing.

https://bugzilla.gnome.org/show_bug.cgi?id=769179
2016-08-03 10:49:22 +08:00
Jonas Ådahl
53e3d0df64 MetaInputSettings: Don't initialize the same setting twice
Two settings were set twice on the same device. Now instead group the
generic update functions together, removing the redundant calls.

https://bugzilla.gnome.org/show_bug.cgi?id=769179
2016-08-03 10:49:22 +08:00
Bastien Nocera
97d180ee59 build: Fix KMS backend summary printout
If have_native_backend is not set, we might end up with:
	Native (KMS) backend:
instead of:
	Native (KMS) backend:     no

in the configure summary

https://bugzilla.gnome.org/show_bug.cgi?id=769305
2016-07-29 16:48:29 +02:00
Florian Müllner
740748af3e clutter: Fix typo in assert 2016-07-29 11:35:31 +02:00
Alberts Muktupāvels
38d61f30dc monitor-config: add missing chain-up for finalize 2016-07-28 19:57:42 +03:00
Jonas Ådahl
23c4ac6c7f settings: Support mouse and trackball accel profile
Support changing the mouse and trackball acceleration profile. This
makes it possible to for example disable pointer acceleration by
choosing the 'flat' profile.

This adds an optional dependency on gudev. Gudev is used by the X11
backend to detect whether a device is a mouse or not. Without gudev
support, the accel profile settings has have effect for mouse devices.

Trackball still uses the "strstr" approach, since udev doesn't support
tagging devices as trackball devices yet.

https://bugzilla.gnome.org/show_bug.cgi?id=769179
2016-07-28 20:13:08 +08:00
Bastien Nocera
cfe5d7429a backends/x11: Add enum for scroll methods
This way the "libinput Scroll Method Enabled" property manipulation
is made clearer.
2016-07-27 19:42:14 +02:00
Bastien Nocera
36cd7177fd backends: Re-add support for edge scrolling with some touchpads
Add support for setting edge-scrolling separately from two-finger
scrolling. We now have 2 separate boolean settings for those, with the
Mouse panel in gnome-control-center allowing to set only one of those at
a time, but nothing precludes both being set in the configuration.

We need to handle:
- two-finger-scrolling-enabled and edge-scrolling-enabled settings both
  being set.
- those 2 settings being change out-of-order
- two-finger-scrolling being set on a device that doesn't support it
- edge-scrolling-enabled on a device that doesn't support it

And the combinations of one touchpad supporting just one of edge
scrolling and two-finger scrolling and another vice-versa.

https://bugzilla.gnome.org/show_bug.cgi?id=768245
2016-07-27 17:17:25 +02:00
Carlos Garnacho
2e4eb86340 configure: Require libinput 1.4
We use API recently added in that version.
2016-07-27 13:32:38 +02:00
57 changed files with 3544 additions and 1254 deletions

6
.gitignore vendored
View File

@@ -41,8 +41,14 @@ stamp-h1
*~
stamp-it
.intltool-merge-cache
ABOUT-NLS
POTFILES
Makevars.template
po/*.header
po/*.pot
po/*.sed
po/*.sin
Rules-quot
libmutter.pc
mutter
mutter-restart-helper

21
NEWS
View File

@@ -1,3 +1,24 @@
3.21.90
=======
* Consider XDG_SESSION_TYPE when determining session type [Jouke; #759388]
* Re-add support for edge scrolling on some touchpads [Bastien; #768245]
* Support mouse and trackball acceleration profile [Jonas; #769179]
* Draw monitor contentn to individual framebuffer [Jonas; #768976]
* Support virtual input devices [Jonas, Carlos; #765009]
* Set correct output scale on hotplug [Jonas; #769505]
* Misc. bug fixes and cleanups [Florian, Jonas, Thomas, Bastien, Carlos;
#769014, #769024, #769054, #769070, #769036, #769305, #769578, #769800,
#769073]
Contributors:
Jonas Ådahl, Carlos Garnacho, Thomas Hindoe Paaboel Andersen, Simon McVittie,
Alberts Muktupāvels, Florian Müllner, Bastien Nocera, Jouke Witteveen
Translations:
Daniel Mustieles [es], Aurimas Černius [lt], Dušan Kazik [sk],
Fabio Tomat [fur], Balázs Úr [hu], Yosef Or Boczko [he], Marek Černocký [cs],
Matej Urbančič [sl]
3.21.4
======
* Fix missing frame border around GTK+ dialogs [Florian; #745060]

View File

@@ -123,6 +123,7 @@ source_h = \
clutter-transition.h \
clutter-types.h \
clutter-units.h \
clutter-virtual-input-device.h \
clutter-zoom-action.h \
$(NULL)
@@ -168,6 +169,7 @@ source_c = \
clutter-image.c \
clutter-input-device.c \
clutter-input-device-tool.c \
clutter-virtual-input-device.c \
clutter-interval.c \
clutter-keyframe-transition.c \
clutter-keysyms-table.c \
@@ -418,6 +420,14 @@ x11_source_h_priv += \
x11/clutter-input-device-xi2.h \
$(NULL)
x11_source_c += \
x11/clutter-virtual-input-device-x11.c \
$(NULL)
x11_source_h_priv += \
x11/clutter-virtual-input-device-x11.h \
$(NULL)
backend_source_h += $(x11_source_h)
backend_source_c += $(x11_source_c)
backend_source_h_priv += $(x11_source_h_priv)
@@ -458,13 +468,17 @@ backend_source_c += $(glx_source_c)
evdev_c_priv = \
evdev/clutter-device-manager-evdev.c \
evdev/clutter-input-device-evdev.c \
evdev/clutter-seat-evdev.c \
evdev/clutter-virtual-input-device-evdev.c \
evdev/clutter-event-evdev.c \
evdev/clutter-input-device-tool-evdev.c \
$(NULL)
evdev_h_priv = \
evdev/clutter-device-manager-evdev.h \
evdev/clutter-input-device-evdev.h \
evdev/clutter-seat-evdev.h \
evdev/clutter-input-device-tool-evdev.h \
evdev/clutter-virtual-input-device-evdev.h \
$(NULL)
evdev_h = evdev/clutter-evdev.h

View File

@@ -401,7 +401,7 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
gboolean res;
cairo_t *cr;
g_assert (priv->width > 0 && priv->width > 0);
g_assert (priv->height > 0 && priv->width > 0);
priv->dirty = TRUE;

View File

@@ -47,6 +47,7 @@
#include "clutter-marshal.h"
#include "clutter-private.h"
#include "clutter-stage-private.h"
#include "clutter-virtual-input-device.h"
struct _ClutterDeviceManagerPrivate
{
@@ -435,3 +436,25 @@ _clutter_device_manager_get_backend (ClutterDeviceManager *manager)
return manager->priv->backend;
}
/**
* clutter_device_manager_create_virtual_device:
* @device_manager: a #ClutterDeviceManager
* @device_type: the type of the virtual device
*
* Creates a virtual input device.
*
* Returns: (transfer full): a newly created virtual device
**/
ClutterVirtualInputDevice *
clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
ClutterInputDeviceType device_type)
{
ClutterDeviceManagerClass *manager_class;
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
return manager_class->create_virtual_device (device_manager,
device_type);
}

View File

@@ -83,6 +83,8 @@ struct _ClutterDeviceManagerClass
ClutterInputDevice *device);
void (* select_stage_events) (ClutterDeviceManager *manager,
ClutterStage *stage);
ClutterVirtualInputDevice *(* create_virtual_device) (ClutterDeviceManager *manager,
ClutterInputDeviceType device_type);
/* padding */
gpointer _padding[7];
@@ -105,6 +107,10 @@ CLUTTER_AVAILABLE_IN_1_2
ClutterInputDevice * clutter_device_manager_get_core_device (ClutterDeviceManager *device_manager,
ClutterInputDeviceType device_type);
CLUTTER_AVAILABLE_IN_ALL
ClutterVirtualInputDevice *clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
ClutterInputDeviceType device_type);
G_END_DECLS
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */

View File

@@ -157,6 +157,11 @@ clutter_stage_view_dispose (GObject *object)
static void
clutter_stage_view_init (ClutterStageView *view)
{
ClutterStageViewPrivate *priv =
clutter_stage_view_get_instance_private (view);
priv->dirty_viewport = TRUE;
priv->dirty_projection = TRUE;
}
static void

View File

@@ -95,6 +95,7 @@ typedef struct _ClutterState ClutterState;
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
typedef struct _ClutterInputDevice ClutterInputDevice;
typedef struct _ClutterVirtualInputDevice ClutterVirtualInputDevice;
typedef CoglMatrix ClutterMatrix;

View File

@@ -0,0 +1,222 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifdef HAVE_CONFIG_H
#include "clutter-build-config.h"
#endif
#include <glib-object.h>
#include "clutter-virtual-input-device.h"
#include "clutter-device-manager.h"
#include "clutter-private.h"
#include "clutter-enum-types.h"
enum
{
PROP_0,
PROP_DEVICE_MANAGER,
PROP_DEVICE_TYPE,
PROP_LAST
};
static GParamSpec *obj_props[PROP_LAST];
typedef struct _ClutterVirtualInputDevicePrivate
{
ClutterDeviceManager *manager;
ClutterInputDeviceType device_type;
} ClutterVirtualInputDevicePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (ClutterVirtualInputDevice,
clutter_virtual_input_device,
G_TYPE_OBJECT)
void
clutter_virtual_input_device_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double dx,
double dy)
{
ClutterVirtualInputDeviceClass *klass =
CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
klass->notify_relative_motion (virtual_device, time_us, dx, dy);
}
void
clutter_virtual_input_device_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double x,
double y)
{
ClutterVirtualInputDeviceClass *klass =
CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
klass->notify_absolute_motion (virtual_device, time_us, x, y);
}
void
clutter_virtual_input_device_notify_button (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t button,
ClutterButtonState button_state)
{
ClutterVirtualInputDeviceClass *klass =
CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
klass->notify_button (virtual_device, time_us, button, button_state);
}
void
clutter_virtual_input_device_notify_key (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t key,
ClutterKeyState key_state)
{
ClutterVirtualInputDeviceClass *klass =
CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
klass->notify_key (virtual_device, time_us, key, key_state);
}
void
clutter_virtual_input_device_notify_keyval (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t keyval,
ClutterKeyState key_state)
{
ClutterVirtualInputDeviceClass *klass =
CLUTTER_VIRTUAL_INPUT_DEVICE_GET_CLASS (virtual_device);
klass->notify_keyval (virtual_device, time_us, keyval, key_state);
}
/**
* clutter_virtual_input_device_get_manager:
* @virtual_device: a virtual device
*
* Gets the device manager of this virtual device.
*
* Returns: (transfer none): The #ClutterDeviceManager of this virtual device
**/
ClutterDeviceManager *
clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device)
{
ClutterVirtualInputDevicePrivate *priv =
clutter_virtual_input_device_get_instance_private (virtual_device);
return priv->manager;
}
int
clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device)
{
ClutterVirtualInputDevicePrivate *priv =
clutter_virtual_input_device_get_instance_private (virtual_device);
return priv->device_type;
}
static void
clutter_virtual_input_device_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterVirtualInputDevice *virtual_device =
CLUTTER_VIRTUAL_INPUT_DEVICE (object);
ClutterVirtualInputDevicePrivate *priv =
clutter_virtual_input_device_get_instance_private (virtual_device);
switch (prop_id)
{
case PROP_DEVICE_MANAGER:
g_value_set_object (value, priv->manager);
break;
case PROP_DEVICE_TYPE:
g_value_set_enum (value, priv->device_type);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_virtual_input_device_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterVirtualInputDevice *virtual_device =
CLUTTER_VIRTUAL_INPUT_DEVICE (object);
ClutterVirtualInputDevicePrivate *priv =
clutter_virtual_input_device_get_instance_private (virtual_device);
switch (prop_id)
{
case PROP_DEVICE_MANAGER:
priv->manager = g_value_get_object (value);
break;
case PROP_DEVICE_TYPE:
priv->device_type = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_virtual_input_device_init (ClutterVirtualInputDevice *virtual_device)
{
}
static void
clutter_virtual_input_device_class_init (ClutterVirtualInputDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = clutter_virtual_input_device_get_property;
object_class->set_property = clutter_virtual_input_device_set_property;
obj_props[PROP_DEVICE_MANAGER] =
g_param_spec_object ("device-manager",
P_("Device Manager"),
P_("The device manager instance"),
CLUTTER_TYPE_DEVICE_MANAGER,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
obj_props[PROP_DEVICE_TYPE] =
g_param_spec_enum ("device-type",
P_("Device type"),
P_("Device type"),
CLUTTER_TYPE_INPUT_DEVICE_TYPE,
CLUTTER_POINTER_DEVICE,
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}

View File

@@ -0,0 +1,116 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2016 Red Hat inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_H__
#define __CLUTTER_VIRTUAL_INPUT_DEVICE_H__
#include <glib-object.h>
#include <stdint.h>
#include "clutter-device-manager.h"
#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE (clutter_virtual_input_device_get_type ())
CLUTTER_AVAILABLE_IN_ALL
G_DECLARE_DERIVABLE_TYPE (ClutterVirtualInputDevice,
clutter_virtual_input_device,
CLUTTER, VIRTUAL_INPUT_DEVICE,
GObject)
typedef enum _ClutterButtonState
{
CLUTTER_BUTTON_STATE_RELEASED,
CLUTTER_BUTTON_STATE_PRESSED
} ClutterButtonState;
typedef enum _ClutterKeyState
{
CLUTTER_KEY_STATE_RELEASED,
CLUTTER_KEY_STATE_PRESSED
} ClutterKeyState;
struct _ClutterVirtualInputDeviceClass
{
GObjectClass parent_class;
void (*notify_relative_motion) (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double dx,
double dy);
void (*notify_absolute_motion) (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double x,
double y);
void (*notify_button) (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t button,
ClutterButtonState button_state);
void (*notify_key) (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t key,
ClutterKeyState key_state);
void (*notify_keyval) (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t keyval,
ClutterKeyState key_state);
};
CLUTTER_AVAILABLE_IN_ALL
void clutter_virtual_input_device_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double dx,
double dy);
CLUTTER_AVAILABLE_IN_ALL
void clutter_virtual_input_device_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double x,
double y);
CLUTTER_AVAILABLE_IN_ALL
void clutter_virtual_input_device_notify_button (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t button,
ClutterButtonState button_state);
CLUTTER_AVAILABLE_IN_ALL
void clutter_virtual_input_device_notify_key (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t key,
ClutterKeyState key_state);
CLUTTER_AVAILABLE_IN_ALL
void clutter_virtual_input_device_notify_keyval (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t keyval,
ClutterKeyState key_state);
CLUTTER_AVAILABLE_IN_ALL
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_H__ */

View File

@@ -107,6 +107,7 @@
#include "clutter-transition.h"
#include "clutter-units.h"
#include "clutter-version.h"
#include "clutter-virtual-input-device.h"
#include "clutter-zoom-action.h"
#include "clutter-deprecated.h"

View File

@@ -46,6 +46,8 @@
#include "clutter-device-manager-private.h"
#include "clutter-event-private.h"
#include "clutter-input-device-evdev.h"
#include "clutter-seat-evdev.h"
#include "clutter-virtual-input-device-evdev.h"
#include "clutter-main.h"
#include "clutter-private.h"
#include "clutter-stage-manager.h"
@@ -59,12 +61,6 @@
#define DISCRETE_SCROLL_STEP 10.0
#define AUTOREPEAT_VALUE 2
/* Try to keep the pointer inside the stage. Hopefully no one is using
* this backend with stages smaller than this. */
#define INITIAL_POINTER_X 16
#define INITIAL_POINTER_Y 16
/*
* Clutter makes the assumption that two core devices have ID's 2 and 3 (core
@@ -76,50 +72,8 @@
*/
#define INITIAL_DEVICE_ID 2
typedef struct _ClutterTouchState ClutterTouchState;
typedef struct _ClutterEventFilter ClutterEventFilter;
struct _ClutterTouchState
{
guint32 id;
ClutterPoint coords;
};
struct _ClutterSeatEvdev
{
struct libinput_seat *libinput_seat;
ClutterDeviceManagerEvdev *manager_evdev;
GSList *devices;
ClutterInputDevice *core_pointer;
ClutterInputDevice *core_keyboard;
GHashTable *touches;
struct xkb_state *xkb;
xkb_led_index_t caps_lock_led;
xkb_led_index_t num_lock_led;
xkb_led_index_t scroll_lock_led;
uint32_t button_state;
/* keyboard repeat */
gboolean repeat;
guint32 repeat_delay;
guint32 repeat_interval;
guint32 repeat_key;
guint32 repeat_count;
guint32 repeat_timer;
ClutterInputDevice *repeat_device;
gfloat pointer_x;
gfloat pointer_y;
/* Emulation of discrete scroll events out of smooth ones */
gfloat accum_scroll_dx;
gfloat accum_scroll_dy;
};
struct _ClutterEventFilter
{
ClutterEvdevFilterFunc func;
@@ -198,24 +152,6 @@ static const char *option_xkb_layout = "us";
static const char *option_xkb_variant = "";
static const char *option_xkb_options = "";
static inline guint64
us (guint64 us)
{
return us;
}
static inline guint64
ms2us (guint64 ms)
{
return us (ms * 1000);
}
static inline guint32
us2ms (guint64 us)
{
return (guint32) (us / 1000);
}
static void
clutter_device_manager_evdev_copy_event_data (ClutterEventExtender *event_extender,
const ClutterEvent *src,
@@ -299,134 +235,34 @@ queue_event (ClutterEvent *event)
_clutter_event_push (event, FALSE);
}
static void
clear_repeat_timer (ClutterSeatEvdev *seat)
void
_clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *core_pointer,
uint64_t time_us,
float x,
float y,
float *new_x,
float *new_y)
{
if (seat->repeat_timer)
if (manager_evdev->priv->constrain_callback)
{
g_source_remove (seat->repeat_timer);
seat->repeat_timer = 0;
g_clear_object (&seat->repeat_device);
}
}
static gboolean
keyboard_repeat (gpointer data);
static void
clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat);
static void
notify_key_device (ClutterInputDevice *input_device,
guint64 time_us,
guint32 key,
guint32 state,
gboolean update_keys)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
ClutterSeatEvdev *seat = _clutter_input_device_evdev_get_seat (device_evdev);
ClutterStage *stage;
ClutterEvent *event = NULL;
enum xkb_state_component changed_state;
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
stage = _clutter_input_device_get_stage (input_device);
if (stage == NULL)
{
clear_repeat_timer (seat);
return;
}
event = _clutter_key_event_new_from_evdev (input_device,
seat->core_keyboard,
stage,
seat->xkb,
seat->button_state,
us2ms (time_us), key, state);
_clutter_evdev_event_set_event_code (event, key);
/* We must be careful and not pass multiple releases to xkb, otherwise it gets
confused and locks the modifiers */
if (state != AUTOREPEAT_VALUE)
{
changed_state = xkb_state_update_key (seat->xkb,
event->key.hardware_keycode,
state ? XKB_KEY_DOWN : XKB_KEY_UP);
manager_evdev->priv->constrain_callback (core_pointer,
us2ms (time_us),
x, y,
new_x, new_y,
manager_evdev->priv->constrain_data);
}
else
{
changed_state = 0;
clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_SYNTHETIC);
}
ClutterActor *stage = CLUTTER_ACTOR (manager_evdev->priv->stage);
float stage_width = clutter_actor_get_width (stage);
float stage_height = clutter_actor_get_height (stage);
queue_event (event);
if (update_keys && (changed_state & XKB_STATE_LEDS))
clutter_seat_evdev_sync_leds (seat);
if (state == 0 || /* key release */
!seat->repeat ||
!xkb_keymap_key_repeats (xkb_state_get_keymap (seat->xkb), event->key.hardware_keycode))
{
clear_repeat_timer (seat);
return;
}
if (state == 1) /* key press */
seat->repeat_count = 0;
seat->repeat_count += 1;
seat->repeat_key = key;
switch (seat->repeat_count)
{
case 1:
case 2:
{
guint32 interval;
clear_repeat_timer (seat);
seat->repeat_device = g_object_ref (input_device);
if (seat->repeat_count == 1)
interval = seat->repeat_delay;
else
interval = seat->repeat_interval;
seat->repeat_timer =
clutter_threads_add_timeout_full (CLUTTER_PRIORITY_EVENTS,
interval,
keyboard_repeat,
seat,
NULL);
return;
}
default:
return;
x = CLAMP (x, 0.f, stage_width - 1);
y = CLAMP (y, 0.f, stage_height - 1);
}
}
static gboolean
keyboard_repeat (gpointer data)
{
ClutterSeatEvdev *seat = data;
GSource *source;
guint32 time_ms;
g_return_val_if_fail (seat->repeat_device != NULL, G_SOURCE_REMOVE);
source = g_main_context_find_source_by_id (NULL, seat->repeat_timer);
time_ms = g_source_get_time (source) / 1000;
notify_key_device (seat->repeat_device,
ms2us (time_ms),
seat->repeat_key,
AUTOREPEAT_VALUE,
FALSE);
return G_SOURCE_CONTINUE;
}
static ClutterEvent *
new_absolute_motion_event (ClutterInputDevice *input_device,
@@ -511,45 +347,6 @@ notify_absolute_motion (ClutterInputDevice *input_device,
queue_event (event);
}
static void
notify_relative_motion (ClutterInputDevice *input_device,
struct libinput_event_pointer *pointer_event)
{
guint64 time_us;
double dx;
double dy;
double dx_unaccel;
double dy_unaccel;
gfloat new_x, new_y;
ClutterInputDeviceEvdev *device_evdev;
ClutterSeatEvdev *seat;
ClutterEvent *event;
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
if (!_clutter_input_device_get_stage (input_device))
return;
device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
seat = _clutter_input_device_evdev_get_seat (device_evdev);
dx = libinput_event_pointer_get_dx (pointer_event);
dy = libinput_event_pointer_get_dy (pointer_event);
new_x = seat->pointer_x + dx;
new_y = seat->pointer_y + dy;
time_us = libinput_event_pointer_get_time_usec (pointer_event);
event = new_absolute_motion_event (input_device, time_us, new_x, new_y, NULL);
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event);
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event);
_clutter_evdev_event_set_relative_motion (event,
dx, dy,
dx_unaccel, dy_unaccel);
queue_event (event);
}
static void
notify_relative_tool_motion (ClutterInputDevice *input_device,
guint64 time_us,
@@ -682,118 +479,6 @@ notify_scroll (ClutterInputDevice *input_device,
queue_event (event);
}
static void
notify_button (ClutterInputDevice *input_device,
guint64 time_us,
guint32 button,
guint32 state)
{
ClutterInputDeviceEvdev *device_evdev;
ClutterSeatEvdev *seat;
ClutterStage *stage;
ClutterEvent *event = NULL;
gint button_nr;
static gint maskmap[8] =
{
CLUTTER_BUTTON1_MASK, CLUTTER_BUTTON3_MASK, CLUTTER_BUTTON2_MASK,
CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK, 0, 0, 0
};
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
stage = _clutter_input_device_get_stage (input_device);
if (stage == NULL)
return;
device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
seat = _clutter_input_device_evdev_get_seat (device_evdev);
/* The evdev button numbers don't map sequentially to clutter button
* numbers (the right and middle mouse buttons are in the opposite
* order) so we'll map them directly with a switch statement */
switch (button)
{
case BTN_LEFT:
case BTN_TOUCH:
button_nr = CLUTTER_BUTTON_PRIMARY;
break;
case BTN_RIGHT:
case BTN_STYLUS:
button_nr = CLUTTER_BUTTON_SECONDARY;
break;
case BTN_MIDDLE:
case BTN_STYLUS2:
button_nr = CLUTTER_BUTTON_MIDDLE;
break;
default:
/* For compatibility reasons, all additional buttons go after the old 4-7 scroll ones */
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
button_nr = button - BTN_TOOL_PEN + 4;
else
button_nr = button - (BTN_LEFT - 1) + 4;
break;
}
if (button_nr < 1 || button_nr > 12)
{
g_warning ("Unhandled button event 0x%x", button);
return;
}
if (state)
event = clutter_event_new (CLUTTER_BUTTON_PRESS);
else
event = clutter_event_new (CLUTTER_BUTTON_RELEASE);
if (button_nr < G_N_ELEMENTS (maskmap))
{
/* Update the modifiers */
if (state)
seat->button_state |= maskmap[button_nr - 1];
else
seat->button_state &= ~maskmap[button_nr - 1];
}
_clutter_evdev_event_set_time_usec (event, time_us);
event->button.time = us2ms (time_us);
event->button.stage = CLUTTER_STAGE (stage);
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->button.button = button_nr;
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
ClutterPoint point;
clutter_input_device_get_coords (input_device, NULL, &point);
event->button.x = point.x;
event->button.y = point.y;
}
else
{
event->button.x = seat->pointer_x;
event->button.y = seat->pointer_y;
}
clutter_event_set_source_device (event, input_device);
_clutter_evdev_event_set_event_code (event, button);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, input_device);
}
else
clutter_event_set_device (event, seat->core_pointer);
_clutter_input_device_set_stage (seat->core_pointer, stage);
queue_event (event);
}
static void
notify_touch_event (ClutterInputDevice *input_device,
ClutterEventType evtype,
@@ -1205,128 +890,6 @@ clutter_event_source_free (ClutterEventSource *source)
g_source_unref (g_source);
}
static void
clutter_touch_state_free (ClutterTouchState *touch_state)
{
g_slice_free (ClutterTouchState, touch_state);
}
static void
clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
struct libinput_seat *libinput_seat)
{
g_assert (seat->libinput_seat == NULL);
libinput_seat_ref (libinput_seat);
libinput_seat_set_user_data (libinput_seat, seat);
seat->libinput_seat = libinput_seat;
}
static ClutterSeatEvdev *
clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
{
ClutterDeviceManager *manager = CLUTTER_DEVICE_MANAGER (manager_evdev);
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
ClutterSeatEvdev *seat;
ClutterInputDevice *device;
struct xkb_context *ctx;
struct xkb_rule_names names;
struct xkb_keymap *keymap;
seat = g_new0 (ClutterSeatEvdev, 1);
if (!seat)
return NULL;
device = _clutter_input_device_evdev_new_virtual (
manager, seat, CLUTTER_POINTER_DEVICE);
_clutter_input_device_set_stage (device, priv->stage);
seat->pointer_x = INITIAL_POINTER_X;
seat->pointer_y = INITIAL_POINTER_Y;
_clutter_input_device_set_coords (device, NULL,
seat->pointer_x, seat->pointer_y,
NULL);
_clutter_device_manager_add_device (manager, device);
seat->core_pointer = device;
device = _clutter_input_device_evdev_new_virtual (
manager, seat, CLUTTER_KEYBOARD_DEVICE);
_clutter_input_device_set_stage (device, priv->stage);
_clutter_device_manager_add_device (manager, device);
seat->core_keyboard = device;
seat->touches = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) clutter_touch_state_free);
ctx = xkb_context_new(0);
g_assert (ctx);
names.rules = "evdev";
names.model = "pc105";
names.layout = option_xkb_layout;
names.variant = option_xkb_variant;
names.options = option_xkb_options;
keymap = xkb_keymap_new_from_names (ctx, &names, 0);
xkb_context_unref(ctx);
if (keymap)
{
seat->xkb = xkb_state_new (keymap);
seat->caps_lock_led =
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_CAPS);
seat->num_lock_led =
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_NUM);
seat->scroll_lock_led =
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_SCROLL);
priv->keymap = keymap;
}
seat->repeat = TRUE;
seat->repeat_delay = 250; /* ms */
seat->repeat_interval = 33; /* ms */
priv->seats = g_slist_append (priv->seats, seat);
return seat;
}
static void
clutter_seat_evdev_free (ClutterSeatEvdev *seat)
{
GSList *iter;
for (iter = seat->devices; iter; iter = g_slist_next (iter))
{
ClutterInputDevice *device = iter->data;
g_object_unref (device);
}
g_slist_free (seat->devices);
g_hash_table_unref (seat->touches);
xkb_state_unref (seat->xkb);
clear_repeat_timer (seat);
if (seat->libinput_seat)
libinput_seat_unref (seat->libinput_seat);
g_free (seat);
}
static void
clutter_seat_evdev_set_stage (ClutterSeatEvdev *seat, ClutterStage *stage)
{
GSList *l;
for (l = seat->devices; l; l = l->next)
{
ClutterInputDevice *device = l->data;
_clutter_input_device_set_stage (device, stage);
}
}
static void
evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
struct libinput_device *libinput_device)
@@ -1351,6 +914,7 @@ evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
seat = clutter_seat_evdev_new (manager_evdev);
clutter_seat_evdev_set_libinput_seat (seat, libinput_seat);
priv->seats = g_slist_append (priv->seats, seat);
}
device = _clutter_input_device_evdev_new (manager, seat, libinput_device);
@@ -1429,7 +993,7 @@ clutter_device_manager_evdev_remove_device (ClutterDeviceManager *manager,
priv->devices = g_slist_remove (priv->devices, device);
if (seat->repeat_timer && seat->repeat_device == device)
clear_repeat_timer (seat);
clutter_seat_evdev_clear_repeat_timer (seat);
g_object_unref (device);
}
@@ -1494,32 +1058,6 @@ clutter_device_manager_evdev_get_device (ClutterDeviceManager *manager,
return NULL;
}
static void
clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat)
{
GSList *iter;
ClutterInputDeviceEvdev *device_evdev;
int caps_lock, num_lock, scroll_lock;
enum libinput_led leds = 0;
caps_lock = xkb_state_led_index_is_active (seat->xkb, seat->caps_lock_led);
num_lock = xkb_state_led_index_is_active (seat->xkb, seat->num_lock_led);
scroll_lock = xkb_state_led_index_is_active (seat->xkb, seat->scroll_lock_led);
if (caps_lock)
leds |= LIBINPUT_LED_CAPS_LOCK;
if (num_lock)
leds |= LIBINPUT_LED_NUM_LOCK;
if (scroll_lock)
leds |= LIBINPUT_LED_SCROLL_LOCK;
for (iter = seat->devices; iter; iter = iter->next)
{
device_evdev = iter->data;
_clutter_input_device_evdev_update_leds (device_evdev, leds);
}
}
static void
flush_event_queue (void)
{
@@ -1568,45 +1106,6 @@ process_base_event (ClutterDeviceManagerEvdev *manager_evdev,
return handled;
}
static ClutterTouchState *
_device_seat_add_touch (ClutterInputDevice *input_device,
guint32 id)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
ClutterSeatEvdev *seat = _clutter_input_device_evdev_get_seat (device_evdev);
ClutterTouchState *touch;
touch = g_slice_new0 (ClutterTouchState);
touch->id = id;
g_hash_table_insert (seat->touches, GUINT_TO_POINTER (id), touch);
return touch;
}
static void
_device_seat_remove_touch (ClutterInputDevice *input_device,
guint32 id)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
ClutterSeatEvdev *seat = _clutter_input_device_evdev_get_seat (device_evdev);
g_hash_table_remove (seat->touches, GUINT_TO_POINTER (id));
}
static ClutterTouchState *
_device_seat_get_touch (ClutterInputDevice *input_device,
guint32 id)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
ClutterSeatEvdev *seat = _clutter_input_device_evdev_get_seat (device_evdev);
return g_hash_table_lookup (seat->touches, GUINT_TO_POINTER (id));
}
static void
check_notify_discrete_scroll (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *device,
@@ -1773,6 +1272,14 @@ translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event)
return (gdouble *) g_array_free (axes, FALSE);
}
static ClutterSeatEvdev *
seat_from_device (ClutterInputDevice *device)
{
ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
return _clutter_input_device_evdev_get_seat (device_evdev);
}
static gboolean
process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
struct libinput_event *event)
@@ -1789,8 +1296,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
guint64 time_us;
struct libinput_event_keyboard *key_event =
libinput_event_get_keyboard_event (event);
device = libinput_device_get_user_data (libinput_device);
device = libinput_device_get_user_data (libinput_device);
time_us = libinput_event_keyboard_get_time_usec (key_event);
key = libinput_event_keyboard_get_key (key_event);
key_state = libinput_event_keyboard_get_key_state (key_event) ==
@@ -1805,18 +1312,35 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
seat_key_count != 0))
break;
notify_key_device (device, time_us, key, key_state, TRUE);
clutter_seat_evdev_notify_key (seat_from_device (device),
device,
time_us, key, key_state, TRUE);
break;
}
case LIBINPUT_EVENT_POINTER_MOTION:
{
struct libinput_event_pointer *motion_event =
struct libinput_event_pointer *pointer_event =
libinput_event_get_pointer_event (event);
device = libinput_device_get_user_data (libinput_device);
uint64_t time_us;
double dx;
double dy;
double dx_unaccel;
double dy_unaccel;
notify_relative_motion (device, motion_event);
device = libinput_device_get_user_data (libinput_device);
time_us = libinput_event_pointer_get_time_usec (pointer_event);
dx = libinput_event_pointer_get_dx (pointer_event);
dy = libinput_event_pointer_get_dy (pointer_event);
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event);
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event);
clutter_seat_evdev_notify_relative_motion (seat_from_device (device),
device,
time_us,
dx, dy,
dx_unaccel, dy_unaccel);
break;
}
@@ -1843,7 +1367,12 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
stage_width);
y = libinput_event_pointer_get_absolute_y_transformed (motion_event,
stage_height);
notify_absolute_motion (device, time_us, x, y, NULL);
clutter_seat_evdev_notify_absolute_motion (seat_from_device (device),
device,
time_us,
x, y,
NULL);
break;
}
@@ -1870,8 +1399,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
seat_button_count != 0))
break;
notify_button (device, time_us, button, button_state);
clutter_seat_evdev_notify_button (seat_from_device (device), device,
time_us, button, button_state);
break;
}
@@ -1966,11 +1495,14 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
guint64 time_us;
double x, y;
gfloat stage_width, stage_height;
ClutterSeatEvdev *seat;
ClutterStage *stage;
ClutterTouchState *touch_state;
struct libinput_event_touch *touch_event =
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
seat = _clutter_input_device_evdev_get_seat (CLUTTER_INPUT_DEVICE_EVDEV (device));
stage = _clutter_input_device_get_stage (device);
if (stage == NULL)
@@ -1986,7 +1518,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
y = libinput_event_touch_get_y_transformed (touch_event,
stage_height);
touch_state = _device_seat_add_touch (device, slot);
touch_state = clutter_seat_evdev_add_touch (seat, slot);
touch_state->coords.x = x;
touch_state->coords.y = y;
@@ -1999,18 +1531,21 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
{
gint32 slot;
guint64 time_us;
ClutterSeatEvdev *seat;
ClutterTouchState *touch_state;
struct libinput_event_touch *touch_event =
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
seat = _clutter_input_device_evdev_get_seat (CLUTTER_INPUT_DEVICE_EVDEV (device));
slot = libinput_event_touch_get_slot (touch_event);
time_us = libinput_event_touch_get_time_usec (touch_event);
touch_state = _device_seat_get_touch (device, slot);
touch_state = clutter_seat_evdev_get_touch (seat, slot);
notify_touch_event (device, CLUTTER_TOUCH_END, time_us, slot,
touch_state->coords.x, touch_state->coords.y);
_device_seat_remove_touch (device, slot);
clutter_seat_evdev_remove_touch (seat, slot);
break;
}
@@ -2021,11 +1556,14 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
guint64 time_us;
double x, y;
gfloat stage_width, stage_height;
ClutterSeatEvdev *seat;
ClutterStage *stage;
ClutterTouchState *touch_state;
struct libinput_event_touch *touch_event =
libinput_event_get_touch_event (event);
device = libinput_device_get_user_data (libinput_device);
seat = _clutter_input_device_evdev_get_seat (CLUTTER_INPUT_DEVICE_EVDEV (device));
stage = _clutter_input_device_get_stage (device);
if (stage == NULL)
@@ -2041,7 +1579,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
y = libinput_event_touch_get_y_transformed (touch_event,
stage_height);
touch_state = _device_seat_get_touch (device, slot);
touch_state = clutter_seat_evdev_get_touch (seat, slot);
touch_state->coords.x = x;
touch_state->coords.y = y;
@@ -2215,34 +1753,38 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
}
case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
{
guint64 time;
guint64 time_us;
guint32 button_state;
struct libinput_event_tablet_tool *tablet_event =
libinput_event_get_tablet_tool_event (event);
guint tablet_button;
device = libinput_device_get_user_data (libinput_device);
time = libinput_event_tablet_tool_get_time_usec (tablet_event);
time_us = libinput_event_tablet_tool_get_time_usec (tablet_event);
tablet_button = libinput_event_tablet_tool_get_button (tablet_event);
button_state = libinput_event_tablet_tool_get_button_state (tablet_event) ==
LIBINPUT_BUTTON_STATE_PRESSED;
notify_button (device, time, tablet_button, button_state);
clutter_seat_evdev_notify_button (seat_from_device (device), device,
time_us, tablet_button, button_state);
break;
}
case LIBINPUT_EVENT_TABLET_TOOL_TIP:
{
guint64 time;
guint64 time_us;
guint32 button_state;
struct libinput_event_tablet_tool *tablet_event =
libinput_event_get_tablet_tool_event (event);
device = libinput_device_get_user_data (libinput_device);
time = libinput_event_tablet_tool_get_time_usec (tablet_event);
time_us = libinput_event_tablet_tool_get_time_usec (tablet_event);
button_state = libinput_event_tablet_tool_get_tip_state (tablet_event) ==
LIBINPUT_TABLET_TOOL_TIP_DOWN;
notify_button (device, time, BTN_TOUCH, button_state);
clutter_seat_evdev_notify_button (seat_from_device (device), device,
time_us, BTN_TOUCH, button_state);
break;
}
case LIBINPUT_EVENT_TABLET_PAD_BUTTON:
@@ -2413,6 +1955,21 @@ static const struct libinput_interface libinput_interface = {
close_restricted
};
static ClutterVirtualInputDevice *
clutter_device_manager_evdev_create_virtual_device (ClutterDeviceManager *manager,
ClutterInputDeviceType device_type)
{
ClutterDeviceManagerEvdev *manager_evdev =
CLUTTER_DEVICE_MANAGER_EVDEV (manager);
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV,
"device-manager", manager,
"seat", priv->main_seat,
"device-type", device_type,
NULL);
}
/*
* GObject implementation
*/
@@ -2424,6 +1981,8 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
ClutterDeviceManagerEvdevPrivate *priv;
ClutterEventSource *source;
struct udev *udev;
struct xkb_context *ctx;
struct xkb_rule_names names;
udev = udev_new ();
if (G_UNLIKELY (udev == NULL))
@@ -2454,6 +2013,17 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
udev_unref (udev);
names.rules = "evdev";
names.model = "pc105";
names.layout = option_xkb_layout;
names.variant = option_xkb_variant;
names.options = option_xkb_options;
ctx = xkb_context_new (0);
g_assert (ctx);
priv->keymap = xkb_keymap_new_from_names (ctx, &names, 0);
xkb_context_unref (ctx);
priv->main_seat = clutter_seat_evdev_new (manager_evdev);
dispatch_libinput (manager_evdev);
@@ -2539,6 +2109,7 @@ clutter_device_manager_evdev_class_init (ClutterDeviceManagerEvdevClass *klass)
manager_class->get_devices = clutter_device_manager_evdev_get_devices;
manager_class->get_core_device = clutter_device_manager_evdev_get_core_device;
manager_class->get_device = clutter_device_manager_evdev_get_device;
manager_class->create_virtual_device = clutter_device_manager_evdev_create_virtual_device;
}
static void
@@ -2684,6 +2255,22 @@ _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *mana
compare_ids);
}
struct xkb_keymap *
_clutter_device_manager_evdev_get_keymap (ClutterDeviceManagerEvdev *manager_evdev)
{
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
return priv->keymap;
}
ClutterStage *
_clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev)
{
ClutterDeviceManagerEvdevPrivate *priv = manager_evdev->priv;
return priv->stage;
}
/**
* clutter_evdev_release_devices:
*

View File

@@ -24,6 +24,7 @@
#ifndef __CLUTTER_DEVICE_MANAGER_EVDEV_H__
#define __CLUTTER_DEVICE_MANAGER_EVDEV_H__
#include <clutter/clutter-backend.h>
#include <clutter/clutter-device-manager.h>
G_BEGIN_DECLS
@@ -39,6 +40,8 @@ typedef struct _ClutterDeviceManagerEvdev ClutterDeviceManagerEvdev;
typedef struct _ClutterDeviceManagerEvdevClass ClutterDeviceManagerEvdevClass;
typedef struct _ClutterDeviceManagerEvdevPrivate ClutterDeviceManagerEvdevPrivate;
typedef struct _ClutterSeatEvdev ClutterSeatEvdev;
struct _ClutterDeviceManagerEvdev
{
ClutterDeviceManager parent_instance;
@@ -61,6 +64,36 @@ gint _clutter_device_manager_evdev_acquire_device_id (ClutterDeviceManagerEvdev
void _clutter_device_manager_evdev_release_device_id (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *device);
struct xkb_keymap * _clutter_device_manager_evdev_get_keymap (ClutterDeviceManagerEvdev *manager_evdev);
ClutterStage * _clutter_device_manager_evdev_get_stage (ClutterDeviceManagerEvdev *manager_evdev);
void _clutter_device_manager_evdev_constrain_pointer (ClutterDeviceManagerEvdev *manager_evdev,
ClutterInputDevice *core_pointer,
uint64_t time_us,
float x,
float y,
float *new_x,
float *new_y);
static inline guint64
us (guint64 us)
{
return us;
}
static inline guint64
ms2us (guint64 ms)
{
return us (ms * 1000);
}
static inline guint32
us2ms (guint64 us)
{
return (guint32) (us / 1000);
}
G_END_DECLS
#endif /* __CLUTTER_DEVICE_MANAGER_EVDEV_H__ */

View File

@@ -196,7 +196,8 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
ClutterInputDevice *
_clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
ClutterSeatEvdev *seat,
ClutterInputDeviceType type)
ClutterInputDeviceType type,
ClutterInputMode mode)
{
ClutterInputDeviceEvdev *device;
ClutterDeviceManagerEvdev *manager_evdev;
@@ -223,7 +224,7 @@ _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
"name", name,
"device-manager", manager,
"device-type", type,
"device-mode", CLUTTER_INPUT_MODE_MASTER,
"device-mode", mode,
"enabled", TRUE,
NULL);

View File

@@ -29,7 +29,8 @@
#include <glib-object.h>
#include <libinput.h>
#include <clutter/clutter-input-device.h>
#include "clutter/clutter-device-manager-private.h"
#include "evdev/clutter-seat-evdev.h"
G_BEGIN_DECLS
@@ -56,7 +57,6 @@ G_BEGIN_DECLS
CLUTTER_TYPE_INPUT_DEVICE_EVDEV, ClutterInputDeviceEvdevClass))
typedef struct _ClutterInputDeviceEvdev ClutterInputDeviceEvdev;
typedef struct _ClutterSeatEvdev ClutterSeatEvdev;
typedef struct _ClutterEventEvdev ClutterEventEvdev;
struct _ClutterInputDeviceEvdev
@@ -76,7 +76,8 @@ ClutterInputDevice * _clutter_input_device_evdev_new (ClutterDe
ClutterInputDevice * _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
ClutterSeatEvdev *seat,
ClutterInputDeviceType type);
ClutterInputDeviceType type,
ClutterInputMode mode);
ClutterSeatEvdev * _clutter_input_device_evdev_get_seat (ClutterInputDeviceEvdev *device);

View File

@@ -0,0 +1,590 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2010 Intel Corp.
* Copyright (C) 2014 Jonas Ådahl
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Damien Lespiau <damien.lespiau@intel.com>
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#include "clutter-build-config.h"
#include "clutter-seat-evdev.h"
#include <linux/input.h>
#include "clutter-event-private.h"
#include "clutter-input-device-evdev.h"
#include "clutter-main.h"
/* Try to keep the pointer inside the stage. Hopefully no one is using
* this backend with stages smaller than this. */
#define INITIAL_POINTER_X 16
#define INITIAL_POINTER_Y 16
#define AUTOREPEAT_VALUE 2
void
clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
struct libinput_seat *libinput_seat)
{
g_assert (seat->libinput_seat == NULL);
libinput_seat_ref (libinput_seat);
libinput_seat_set_user_data (libinput_seat, seat);
seat->libinput_seat = libinput_seat;
}
void
clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat)
{
GSList *iter;
ClutterInputDeviceEvdev *device_evdev;
int caps_lock, num_lock, scroll_lock;
enum libinput_led leds = 0;
caps_lock = xkb_state_led_index_is_active (seat->xkb, seat->caps_lock_led);
num_lock = xkb_state_led_index_is_active (seat->xkb, seat->num_lock_led);
scroll_lock = xkb_state_led_index_is_active (seat->xkb, seat->scroll_lock_led);
if (caps_lock)
leds |= LIBINPUT_LED_CAPS_LOCK;
if (num_lock)
leds |= LIBINPUT_LED_NUM_LOCK;
if (scroll_lock)
leds |= LIBINPUT_LED_SCROLL_LOCK;
for (iter = seat->devices; iter; iter = iter->next)
{
device_evdev = iter->data;
_clutter_input_device_evdev_update_leds (device_evdev, leds);
}
}
static void
clutter_touch_state_free (ClutterTouchState *touch_state)
{
g_slice_free (ClutterTouchState, touch_state);
}
ClutterTouchState *
clutter_seat_evdev_add_touch (ClutterSeatEvdev *seat,
guint32 id)
{
ClutterTouchState *touch;
touch = g_slice_new0 (ClutterTouchState);
touch->id = id;
g_hash_table_insert (seat->touches, GUINT_TO_POINTER (id), touch);
return touch;
}
void
clutter_seat_evdev_remove_touch (ClutterSeatEvdev *seat,
guint32 id)
{
g_hash_table_remove (seat->touches, GUINT_TO_POINTER (id));
}
ClutterTouchState *
clutter_seat_evdev_get_touch (ClutterSeatEvdev *seat,
guint32 id)
{
return g_hash_table_lookup (seat->touches, GUINT_TO_POINTER (id));
}
ClutterSeatEvdev *
clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
{
ClutterDeviceManager *manager = CLUTTER_DEVICE_MANAGER (manager_evdev);
ClutterSeatEvdev *seat;
ClutterInputDevice *device;
ClutterStage *stage;
struct xkb_keymap *keymap;
seat = g_new0 (ClutterSeatEvdev, 1);
if (!seat)
return NULL;
seat->manager_evdev = manager_evdev;
device = _clutter_input_device_evdev_new_virtual (
manager, seat, CLUTTER_POINTER_DEVICE,
CLUTTER_INPUT_MODE_MASTER);
stage = _clutter_device_manager_evdev_get_stage (manager_evdev);
_clutter_input_device_set_stage (device, stage);
seat->pointer_x = INITIAL_POINTER_X;
seat->pointer_y = INITIAL_POINTER_Y;
_clutter_input_device_set_coords (device, NULL,
seat->pointer_x, seat->pointer_y,
NULL);
_clutter_device_manager_add_device (manager, device);
seat->core_pointer = device;
device = _clutter_input_device_evdev_new_virtual (
manager, seat, CLUTTER_KEYBOARD_DEVICE,
CLUTTER_INPUT_MODE_MASTER);
_clutter_input_device_set_stage (device, stage);
_clutter_device_manager_add_device (manager, device);
seat->core_keyboard = device;
seat->touches = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) clutter_touch_state_free);
seat->repeat = TRUE;
seat->repeat_delay = 250; /* ms */
seat->repeat_interval = 33; /* ms */
keymap = _clutter_device_manager_evdev_get_keymap (manager_evdev);
if (keymap)
{
seat->xkb = xkb_state_new (keymap);
seat->caps_lock_led =
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_CAPS);
seat->num_lock_led =
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_NUM);
seat->scroll_lock_led =
xkb_keymap_led_get_index (keymap, XKB_LED_NAME_SCROLL);
}
return seat;
}
void
clutter_seat_evdev_clear_repeat_timer (ClutterSeatEvdev *seat)
{
if (seat->repeat_timer)
{
g_source_remove (seat->repeat_timer);
seat->repeat_timer = 0;
g_clear_object (&seat->repeat_device);
}
}
static gboolean
keyboard_repeat (gpointer data)
{
ClutterSeatEvdev *seat = data;
GSource *source;
guint32 time_ms;
g_return_val_if_fail (seat->repeat_device != NULL, G_SOURCE_REMOVE);
source = g_main_context_find_source_by_id (NULL, seat->repeat_timer);
time_ms = g_source_get_time (source) / 1000;
clutter_seat_evdev_notify_key (seat,
seat->repeat_device,
ms2us (time_ms),
seat->repeat_key,
AUTOREPEAT_VALUE,
FALSE);
return G_SOURCE_CONTINUE;
}
static void
queue_event (ClutterEvent *event)
{
_clutter_event_push (event, FALSE);
}
static int
update_button_count (ClutterSeatEvdev *seat,
uint32_t button,
uint32_t state)
{
if (state)
{
return ++seat->button_count[button];
}
else
{
/* Handle cases where we newer saw the initial pressed event. */
if (seat->button_count[button] == 0)
return 0;
return --seat->button_count[button];
}
}
void
clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
ClutterInputDevice *device,
uint64_t time_us,
uint32_t key,
uint32_t state,
gboolean update_keys)
{
ClutterStage *stage;
ClutterEvent *event = NULL;
enum xkb_state_component changed_state;
if (state != AUTOREPEAT_VALUE)
{
/* Drop any repeated button press (for example from virtual devices. */
int count = update_button_count (seat, key, state);
if (state && count > 1)
return;
if (!state && count != 0)
return;
}
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
stage = _clutter_input_device_get_stage (device);
if (stage == NULL)
{
clutter_seat_evdev_clear_repeat_timer (seat);
return;
}
event = _clutter_key_event_new_from_evdev (device,
seat->core_keyboard,
stage,
seat->xkb,
seat->button_state,
us2ms (time_us), key, state);
_clutter_evdev_event_set_event_code (event, key);
/* We must be careful and not pass multiple releases to xkb, otherwise it gets
confused and locks the modifiers */
if (state != AUTOREPEAT_VALUE)
{
changed_state = xkb_state_update_key (seat->xkb,
event->key.hardware_keycode,
state ? XKB_KEY_DOWN : XKB_KEY_UP);
}
else
{
changed_state = 0;
clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_SYNTHETIC);
}
queue_event (event);
if (update_keys && (changed_state & XKB_STATE_LEDS))
clutter_seat_evdev_sync_leds (seat);
if (state == 0 || /* key release */
!seat->repeat ||
!xkb_keymap_key_repeats (xkb_state_get_keymap (seat->xkb),
event->key.hardware_keycode))
{
clutter_seat_evdev_clear_repeat_timer (seat);
return;
}
if (state == 1) /* key press */
seat->repeat_count = 0;
seat->repeat_count += 1;
seat->repeat_key = key;
switch (seat->repeat_count)
{
case 1:
case 2:
{
guint32 interval;
clutter_seat_evdev_clear_repeat_timer (seat);
seat->repeat_device = g_object_ref (device);
if (seat->repeat_count == 1)
interval = seat->repeat_delay;
else
interval = seat->repeat_interval;
seat->repeat_timer =
clutter_threads_add_timeout_full (CLUTTER_PRIORITY_EVENTS,
interval,
keyboard_repeat,
seat,
NULL);
return;
}
default:
return;
}
}
static ClutterEvent *
new_absolute_motion_event (ClutterSeatEvdev *seat,
ClutterInputDevice *input_device,
guint64 time_us,
gfloat x,
gfloat y,
gdouble *axes)
{
ClutterStage *stage = _clutter_input_device_get_stage (input_device);
ClutterEvent *event;
event = clutter_event_new (CLUTTER_MOTION);
if (clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE)
_clutter_device_manager_evdev_constrain_pointer (seat->manager_evdev,
seat->core_pointer,
time_us,
seat->pointer_x,
seat->pointer_y,
&x, &y);
_clutter_evdev_event_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us);
event->motion.stage = stage;
event->motion.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x;
event->motion.y = y;
event->motion.axes = axes;
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, input_device);
}
else
{
clutter_event_set_device (event, seat->core_pointer);
}
_clutter_input_device_set_stage (seat->core_pointer, stage);
if (clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE)
{
seat->pointer_x = x;
seat->pointer_y = y;
}
return event;
}
void
clutter_seat_evdev_notify_relative_motion (ClutterSeatEvdev *seat,
ClutterInputDevice *input_device,
uint64_t time_us,
float dx,
float dy,
float dx_unaccel,
float dy_unaccel)
{
gfloat new_x, new_y;
ClutterEvent *event;
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
if (!_clutter_input_device_get_stage (input_device))
return;
new_x = seat->pointer_x + dx;
new_y = seat->pointer_y + dy;
event = new_absolute_motion_event (seat, input_device,
time_us, new_x, new_y, NULL);
_clutter_evdev_event_set_relative_motion (event,
dx, dy,
dx_unaccel, dy_unaccel);
queue_event (event);
}
void clutter_seat_evdev_notify_absolute_motion (ClutterSeatEvdev *seat,
ClutterInputDevice *input_device,
uint64_t time_us,
float x,
float y,
double *axes)
{
ClutterEvent *event;
event = new_absolute_motion_event (seat, input_device, time_us, x, x, axes);
queue_event (event);
}
void
clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
ClutterInputDevice *input_device,
uint64_t time_us,
uint32_t button,
uint32_t state)
{
ClutterStage *stage;
ClutterEvent *event = NULL;
gint button_nr;
static gint maskmap[8] =
{
CLUTTER_BUTTON1_MASK, CLUTTER_BUTTON3_MASK, CLUTTER_BUTTON2_MASK,
CLUTTER_BUTTON4_MASK, CLUTTER_BUTTON5_MASK, 0, 0, 0
};
int button_count;
/* Drop any repeated button press (for example from virtual devices. */
button_count = update_button_count (seat, button, state);
if (state && button_count > 1)
return;
if (!state && button_count != 0)
return;
/* We can drop the event on the floor if no stage has been
* associated with the device yet. */
stage = _clutter_input_device_get_stage (input_device);
if (stage == NULL)
return;
/* The evdev button numbers don't map sequentially to clutter button
* numbers (the right and middle mouse buttons are in the opposite
* order) so we'll map them directly with a switch statement */
switch (button)
{
case BTN_LEFT:
case BTN_TOUCH:
button_nr = CLUTTER_BUTTON_PRIMARY;
break;
case BTN_RIGHT:
case BTN_STYLUS:
button_nr = CLUTTER_BUTTON_SECONDARY;
break;
case BTN_MIDDLE:
case BTN_STYLUS2:
button_nr = CLUTTER_BUTTON_MIDDLE;
break;
default:
/* For compatibility reasons, all additional buttons go after the old 4-7 scroll ones */
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
button_nr = button - BTN_TOOL_PEN + 4;
else
button_nr = button - (BTN_LEFT - 1) + 4;
break;
}
if (button_nr < 1 || button_nr > 12)
{
g_warning ("Unhandled button event 0x%x", button);
return;
}
if (state)
event = clutter_event_new (CLUTTER_BUTTON_PRESS);
else
event = clutter_event_new (CLUTTER_BUTTON_RELEASE);
if (button_nr < G_N_ELEMENTS (maskmap))
{
/* Update the modifiers */
if (state)
seat->button_state |= maskmap[button_nr - 1];
else
seat->button_state &= ~maskmap[button_nr - 1];
}
_clutter_evdev_event_set_time_usec (event, time_us);
event->button.time = us2ms (time_us);
event->button.stage = CLUTTER_STAGE (stage);
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->button.button = button_nr;
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
ClutterPoint point;
clutter_input_device_get_coords (input_device, NULL, &point);
event->button.x = point.x;
event->button.y = point.y;
}
else
{
event->button.x = seat->pointer_x;
event->button.y = seat->pointer_y;
}
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
_clutter_evdev_event_set_event_code (event, button);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
{
ClutterInputDeviceEvdev *device_evdev =
CLUTTER_INPUT_DEVICE_EVDEV (input_device);
clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, input_device);
}
else
{
clutter_event_set_device (event, seat->core_pointer);
}
_clutter_input_device_set_stage (seat->core_pointer, stage);
queue_event (event);
}
void
clutter_seat_evdev_free (ClutterSeatEvdev *seat)
{
GSList *iter;
for (iter = seat->devices; iter; iter = g_slist_next (iter))
{
ClutterInputDevice *device = iter->data;
g_object_unref (device);
}
g_slist_free (seat->devices);
g_hash_table_unref (seat->touches);
xkb_state_unref (seat->xkb);
clutter_seat_evdev_clear_repeat_timer (seat);
if (seat->libinput_seat)
libinput_seat_unref (seat->libinput_seat);
g_free (seat);
}
void
clutter_seat_evdev_set_stage (ClutterSeatEvdev *seat,
ClutterStage *stage)
{
GSList *l;
_clutter_input_device_set_stage (seat->core_pointer, stage);
_clutter_input_device_set_stage (seat->core_keyboard, stage);
for (l = seat->devices; l; l = l->next)
{
ClutterInputDevice *device = l->data;
_clutter_input_device_set_stage (device, stage);
}
}

View File

@@ -0,0 +1,132 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2010 Intel Corp.
* Copyright (C) 2014 Jonas Ådahl
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Damien Lespiau <damien.lespiau@intel.com>
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifndef __CLUTTER_SEAT_EVDEV_H__
#define __CLUTTER_SEAT_EVDEV_H__
#include <libinput.h>
#include <linux/input.h>
#include "clutter-input-device.h"
#include "clutter-device-manager-evdev.h"
#include "clutter-xkb-utils.h"
typedef struct _ClutterTouchState ClutterTouchState;
struct _ClutterTouchState
{
guint32 id;
ClutterPoint coords;
};
struct _ClutterSeatEvdev
{
struct libinput_seat *libinput_seat;
ClutterDeviceManagerEvdev *manager_evdev;
GSList *devices;
ClutterInputDevice *core_pointer;
ClutterInputDevice *core_keyboard;
GHashTable *touches;
struct xkb_state *xkb;
xkb_led_index_t caps_lock_led;
xkb_led_index_t num_lock_led;
xkb_led_index_t scroll_lock_led;
uint32_t button_state;
int button_count[KEY_CNT];
/* keyboard repeat */
gboolean repeat;
guint32 repeat_delay;
guint32 repeat_interval;
guint32 repeat_key;
guint32 repeat_count;
guint32 repeat_timer;
ClutterInputDevice *repeat_device;
gfloat pointer_x;
gfloat pointer_y;
/* Emulation of discrete scroll events out of smooth ones */
gfloat accum_scroll_dx;
gfloat accum_scroll_dy;
};
void clutter_seat_evdev_notify_key (ClutterSeatEvdev *seat,
ClutterInputDevice *device,
uint64_t time_us,
uint32_t key,
uint32_t state,
gboolean update_keys);
void clutter_seat_evdev_notify_relative_motion (ClutterSeatEvdev *seat_evdev,
ClutterInputDevice *input_device,
uint64_t time_us,
float dx,
float dy,
float dx_unaccel,
float dy_unaccel);
void clutter_seat_evdev_notify_absolute_motion (ClutterSeatEvdev *seat_evdev,
ClutterInputDevice *input_device,
uint64_t time_us,
float x,
float y,
double *axes);
void clutter_seat_evdev_notify_button (ClutterSeatEvdev *seat,
ClutterInputDevice *input_device,
uint64_t time_us,
uint32_t button,
uint32_t state);
void clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
struct libinput_seat *libinput_seat);
void clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat);
ClutterTouchState * clutter_seat_evdev_add_touch (ClutterSeatEvdev *seat,
guint32 id);
void clutter_seat_evdev_remove_touch (ClutterSeatEvdev *seat,
guint32 id);
ClutterTouchState * clutter_seat_evdev_get_touch (ClutterSeatEvdev *seat,
guint32 id);
void clutter_seat_evdev_set_stage (ClutterSeatEvdev *seat,
ClutterStage *stage);
void clutter_seat_evdev_clear_repeat_timer (ClutterSeatEvdev *seat);
ClutterSeatEvdev * clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev);
void clutter_seat_evdev_free (ClutterSeatEvdev *seat);
#endif /* __CLUTTER_SEAT_EVDEV_H__ */

View File

@@ -0,0 +1,495 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifdef HAVE_CONFIG_H
#include "clutter-build-config.h"
#endif
#include <glib-object.h>
#include <linux/input.h>
#include "clutter-private.h"
#include "clutter-virtual-input-device.h"
#include "evdev/clutter-input-device-evdev.h"
#include "evdev/clutter-seat-evdev.h"
#include "evdev/clutter-virtual-input-device-evdev.h"
enum
{
PROP_0,
PROP_SEAT,
PROP_LAST
};
static GParamSpec *obj_props[PROP_LAST];
struct _ClutterVirtualInputDeviceEvdev
{
ClutterVirtualInputDevice parent;
ClutterInputDevice *device;
ClutterSeatEvdev *seat;
int button_count[KEY_CNT];
};
G_DEFINE_TYPE (ClutterVirtualInputDeviceEvdev,
clutter_virtual_input_device_evdev,
CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE)
typedef enum _EvdevButtonType
{
EVDEV_BUTTON_TYPE_NONE,
EVDEV_BUTTON_TYPE_KEY,
EVDEV_BUTTON_TYPE_BUTTON,
} EvdevButtonType;
static int
update_button_count (ClutterVirtualInputDeviceEvdev *virtual_evdev,
uint32_t button,
uint32_t state)
{
if (state)
return ++virtual_evdev->button_count[button];
else
return --virtual_evdev->button_count[button];
}
static EvdevButtonType
get_button_type (uint16_t code)
{
switch (code)
{
case BTN_TOOL_PEN:
case BTN_TOOL_RUBBER:
case BTN_TOOL_BRUSH:
case BTN_TOOL_PENCIL:
case BTN_TOOL_AIRBRUSH:
case BTN_TOOL_MOUSE:
case BTN_TOOL_LENS:
case BTN_TOOL_QUINTTAP:
case BTN_TOOL_DOUBLETAP:
case BTN_TOOL_TRIPLETAP:
case BTN_TOOL_QUADTAP:
case BTN_TOOL_FINGER:
case BTN_TOUCH:
return EVDEV_BUTTON_TYPE_NONE;
}
if (code >= KEY_ESC && code <= KEY_MICMUTE)
return EVDEV_BUTTON_TYPE_KEY;
if (code >= BTN_MISC && code <= BTN_GEAR_UP)
return EVDEV_BUTTON_TYPE_BUTTON;
if (code >= KEY_OK && code <= KEY_LIGHTS_TOGGLE)
return EVDEV_BUTTON_TYPE_KEY;
if (code >= BTN_DPAD_UP && code <= BTN_DPAD_RIGHT)
return EVDEV_BUTTON_TYPE_BUTTON;
if (code >= KEY_ALS_TOGGLE && code <= KEY_KBDINPUTASSIST_CANCEL)
return EVDEV_BUTTON_TYPE_KEY;
if (code >= BTN_TRIGGER_HAPPY && code <= BTN_TRIGGER_HAPPY40)
return EVDEV_BUTTON_TYPE_BUTTON;
return EVDEV_BUTTON_TYPE_NONE;
}
static void
release_pressed_buttons (ClutterVirtualInputDevice *virtual_device)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
int code;
uint64_t time_us;
time_us = g_get_monotonic_time ();
for (code = 0; code < G_N_ELEMENTS (virtual_evdev->button_count); code++)
{
if (virtual_evdev->button_count[code] == 0)
continue;
switch (get_button_type (code))
{
case EVDEV_BUTTON_TYPE_KEY:
clutter_virtual_input_device_notify_key (virtual_device,
time_us,
code,
CLUTTER_KEY_STATE_RELEASED);
break;
case EVDEV_BUTTON_TYPE_BUTTON:
clutter_virtual_input_device_notify_button (virtual_device,
time_us,
code,
CLUTTER_BUTTON_STATE_RELEASED);
break;
case EVDEV_BUTTON_TYPE_NONE:
g_assert_not_reached ();
}
}
}
static void
clutter_virtual_input_device_evdev_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double dx,
double dy)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
clutter_seat_evdev_notify_relative_motion (virtual_evdev->seat,
virtual_evdev->device,
time_us,
dx, dy,
dx, dy);
}
static void
clutter_virtual_input_device_evdev_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double x,
double y)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
clutter_seat_evdev_notify_absolute_motion (virtual_evdev->seat,
virtual_evdev->device,
time_us,
x, y,
NULL);
}
static void
clutter_virtual_input_device_evdev_notify_button (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t button,
ClutterButtonState button_state)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
int button_count;
if (get_button_type (button) != EVDEV_BUTTON_TYPE_BUTTON)
{
g_warning ("Unknown/invalid virtual device button 0x%x pressed",
button);
return;
}
button_count = update_button_count (virtual_evdev, button, button_state);
if (button_count < 0 || button_count > 1)
{
g_warning ("Received multiple virtual 0x%x button %s (ignoring)", button,
button_state == CLUTTER_BUTTON_STATE_PRESSED ? "presses" : "releases");
update_button_count (virtual_evdev, button, 1 - button_state);
return;
}
clutter_seat_evdev_notify_button (virtual_evdev->seat,
virtual_evdev->device,
time_us,
button,
button_state);
}
static void
clutter_virtual_input_device_evdev_notify_key (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t key,
ClutterKeyState key_state)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
int key_count;
if (get_button_type (key) != EVDEV_BUTTON_TYPE_KEY)
{
g_warning ("Unknown/invalid virtual device key 0x%x pressed\n", key);
return;
}
key_count = update_button_count (virtual_evdev, key, key_state);
if (key_count < 0 || key_count > 1)
{
g_warning ("Received multiple virtual 0x%x key %s (ignoring)", key,
key_state == CLUTTER_KEY_STATE_PRESSED ? "presses" : "releases");
update_button_count (virtual_evdev, key, 1 - key_state);
return;
}
clutter_seat_evdev_notify_key (virtual_evdev->seat,
virtual_evdev->device,
time_us,
key,
key_state,
TRUE);
}
static gboolean
pick_keycode_for_keyval_in_current_group (ClutterVirtualInputDevice *virtual_device,
guint keyval,
guint *keycode_out,
guint *level_out)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
ClutterDeviceManager *manager;
struct xkb_keymap *xkb_keymap;
struct xkb_state *state;
guint keycode, layout;
xkb_keycode_t min_keycode, max_keycode;
manager = clutter_virtual_input_device_get_manager (virtual_device);
xkb_keymap = _clutter_device_manager_evdev_get_keymap (CLUTTER_DEVICE_MANAGER_EVDEV (manager));
state = virtual_evdev->seat->xkb;
layout = xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_EFFECTIVE);
min_keycode = xkb_keymap_min_keycode (xkb_keymap);
max_keycode = xkb_keymap_max_keycode (xkb_keymap);
for (keycode = min_keycode; keycode < max_keycode; keycode++)
{
gint num_levels, level;
num_levels = xkb_keymap_num_levels_for_key (xkb_keymap, keycode, layout);
for (level = 0; level < num_levels; level++)
{
const xkb_keysym_t *syms;
gint num_syms, sym;
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, keycode, layout, level, &syms);
for (sym = 0; sym < num_syms; sym++)
{
if (syms[sym] == keyval)
{
*keycode_out = keycode;
if (level_out)
*level_out = level;
return TRUE;
}
}
}
}
return FALSE;
}
static void
apply_level_modifiers (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t level,
uint32_t key_state)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
guint keysym, keycode, evcode;
if (level == 0)
return;
if (level == 1)
{
keysym = XKB_KEY_Shift_L;
}
else if (level == 2)
{
keysym = XKB_KEY_ISO_Level3_Shift;
}
else
{
g_warning ("Unhandled level: %d\n", level);
return;
}
if (!pick_keycode_for_keyval_in_current_group (virtual_device, keysym,
&keycode, NULL))
return;
clutter_input_device_keycode_to_evdev (virtual_evdev->device,
keycode, &evcode);
clutter_seat_evdev_notify_key (virtual_evdev->seat,
virtual_evdev->device,
time_us,
evcode,
key_state,
TRUE);
}
static void
clutter_virtual_input_device_evdev_notify_keyval (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t keyval,
ClutterKeyState key_state)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
int key_count;
guint keycode = 0, level = 0, evcode = 0;
if (!pick_keycode_for_keyval_in_current_group (virtual_device,
keyval, &keycode, &level))
{
g_warning ("No keycode found for keyval %x in current group", keyval);
return;
}
clutter_input_device_keycode_to_evdev (virtual_evdev->device,
keycode, &evcode);
if (get_button_type (evcode) != EVDEV_BUTTON_TYPE_KEY)
{
g_warning ("Unknown/invalid virtual device key 0x%x pressed\n", evcode);
return;
}
key_count = update_button_count (virtual_evdev, evcode, key_state);
if (key_count < 0 || key_count > 1)
{
g_warning ("Received multiple virtual 0x%x key %s (ignoring)", keycode,
key_state == CLUTTER_KEY_STATE_PRESSED ? "presses" : "releases");
update_button_count (virtual_evdev, evcode, 1 - key_state);
return;
}
if (key_state)
apply_level_modifiers (virtual_device, time_us, level, key_state);
clutter_seat_evdev_notify_key (virtual_evdev->seat,
virtual_evdev->device,
time_us,
evcode,
key_state,
TRUE);
if (!key_state)
apply_level_modifiers (virtual_device, time_us, level, key_state);
}
static void
clutter_virtual_input_device_evdev_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
switch (prop_id)
{
case PROP_SEAT:
g_value_set_pointer (value, virtual_evdev->seat);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_virtual_input_device_evdev_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
switch (prop_id)
{
case PROP_SEAT:
virtual_evdev->seat = g_value_get_pointer (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_virtual_input_device_evdev_constructed (GObject *object)
{
ClutterVirtualInputDevice *virtual_device =
CLUTTER_VIRTUAL_INPUT_DEVICE (object);
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
ClutterDeviceManager *manager;
ClutterInputDeviceType device_type;
ClutterStage *stage;
manager = clutter_virtual_input_device_get_manager (virtual_device);
device_type = clutter_virtual_input_device_get_device_type (virtual_device);
virtual_evdev->device =
_clutter_input_device_evdev_new_virtual (manager,
virtual_evdev->seat,
device_type,
CLUTTER_INPUT_MODE_SLAVE);
stage = _clutter_device_manager_evdev_get_stage (CLUTTER_DEVICE_MANAGER_EVDEV (manager));
_clutter_input_device_set_stage (virtual_evdev->device, stage);
}
static void
clutter_virtual_input_device_evdev_finalize (GObject *object)
{
ClutterVirtualInputDevice *virtual_device =
CLUTTER_VIRTUAL_INPUT_DEVICE (object);
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (object);
GObjectClass *object_class;
release_pressed_buttons (virtual_device);
g_clear_object (&virtual_evdev->device);
object_class =
G_OBJECT_CLASS (clutter_virtual_input_device_evdev_parent_class);
object_class->finalize (object);
}
static void
clutter_virtual_input_device_evdev_init (ClutterVirtualInputDeviceEvdev *virtual_device_evdev)
{
}
static void
clutter_virtual_input_device_evdev_class_init (ClutterVirtualInputDeviceEvdevClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterVirtualInputDeviceClass *virtual_input_device_class =
CLUTTER_VIRTUAL_INPUT_DEVICE_CLASS (klass);
object_class->get_property = clutter_virtual_input_device_evdev_get_property;
object_class->set_property = clutter_virtual_input_device_evdev_set_property;
object_class->constructed = clutter_virtual_input_device_evdev_constructed;
object_class->finalize = clutter_virtual_input_device_evdev_finalize;
virtual_input_device_class->notify_relative_motion = clutter_virtual_input_device_evdev_notify_relative_motion;
virtual_input_device_class->notify_absolute_motion = clutter_virtual_input_device_evdev_notify_absolute_motion;
virtual_input_device_class->notify_button = clutter_virtual_input_device_evdev_notify_button;
virtual_input_device_class->notify_key = clutter_virtual_input_device_evdev_notify_key;
virtual_input_device_class->notify_keyval = clutter_virtual_input_device_evdev_notify_keyval;
obj_props[PROP_SEAT] = g_param_spec_pointer ("seat",
P_("ClutterSeatEvdev"),
P_("ClutterSeatEvdev"),
CLUTTER_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}

View File

@@ -0,0 +1,35 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__
#define __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__
#include "clutter-virtual-input-device.h"
#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_EVDEV (clutter_virtual_input_device_evdev_get_type ())
G_DECLARE_FINAL_TYPE (ClutterVirtualInputDeviceEvdev,
clutter_virtual_input_device_evdev,
CLUTTER, VIRTUAL_INPUT_DEVICE_EVDEV,
ClutterVirtualInputDevice)
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV_H__ */

View File

@@ -28,6 +28,7 @@
#include "clutter-backend-x11.h"
#include "clutter-input-device-core-x11.h"
#include "clutter-stage-x11.h"
#include "clutter-virtual-input-device-x11.h"
#include "clutter-backend.h"
#include "clutter-debug.h"
@@ -480,6 +481,13 @@ clutter_device_manager_x11_get_device (ClutterDeviceManager *manager,
GINT_TO_POINTER (id));
}
static ClutterVirtualInputDevice *
clutter_device_manager_x11_create_virtual_device (ClutterDeviceManager *device_manager,
ClutterInputDeviceType device_type)
{
return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_X11, NULL);
}
static void
clutter_device_manager_x11_set_property (GObject *gobject,
guint prop_id,
@@ -526,6 +534,7 @@ clutter_device_manager_x11_class_init (ClutterDeviceManagerX11Class *klass)
manager_class->get_devices = clutter_device_manager_x11_get_devices;
manager_class->get_core_device = clutter_device_manager_x11_get_core_device;
manager_class->get_device = clutter_device_manager_x11_get_device;
manager_class->create_virtual_device = clutter_device_manager_x11_create_virtual_device;
}
static void

View File

@@ -0,0 +1,89 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifdef HAVE_CONFIG_H
#include "clutter-build-config.h"
#endif
#include <glib-object.h>
#include "clutter-virtual-input-device.h"
#include "x11/clutter-virtual-input-device-x11.h"
struct _ClutterVirtualInputDeviceX11
{
ClutterVirtualInputDevice parent;
};
G_DEFINE_TYPE (ClutterVirtualInputDeviceX11,
clutter_virtual_input_device_x11,
CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE)
static void
clutter_virtual_input_device_x11_notify_relative_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double dx,
double dy)
{
}
static void
clutter_virtual_input_device_x11_notify_absolute_motion (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
double x,
double y)
{
}
static void
clutter_virtual_input_device_x11_notify_button (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t button,
ClutterButtonState button_state)
{
}
static void
clutter_virtual_input_device_x11_notify_key (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
uint32_t key,
ClutterKeyState key_state)
{
}
static void
clutter_virtual_input_device_x11_init (ClutterVirtualInputDeviceX11 *virtual_device_x11)
{
}
static void
clutter_virtual_input_device_x11_class_init (ClutterVirtualInputDeviceX11Class *klass)
{
ClutterVirtualInputDeviceClass *virtual_input_device_class =
CLUTTER_VIRTUAL_INPUT_DEVICE_CLASS (klass);
virtual_input_device_class->notify_relative_motion = clutter_virtual_input_device_x11_notify_relative_motion;
virtual_input_device_class->notify_absolute_motion = clutter_virtual_input_device_x11_notify_absolute_motion;
virtual_input_device_class->notify_button = clutter_virtual_input_device_x11_notify_button;
virtual_input_device_class->notify_key = clutter_virtual_input_device_x11_notify_key;
}

View File

@@ -0,0 +1,35 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2016 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Jonas Ådahl <jadahl@gmail.com>
*/
#ifndef __CLUTTER_VIRTUAL_INPUT_DEVICE_X11_H__
#define __CLUTTER_VIRTUAL_INPUT_DEVICE_X11_H__
#include "clutter-virtual-input-device.h"
#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_X11 (clutter_virtual_input_device_x11_get_type ())
G_DECLARE_FINAL_TYPE (ClutterVirtualInputDeviceX11,
clutter_virtual_input_device_x11,
CLUTTER, VIRTUAL_INPUT_DEVICE_X11,
ClutterVirtualInputDevice)
#endif /* __CLUTTER_VIRTUAL_INPUT_DEVICE_X11_H__ */

View File

@@ -116,7 +116,7 @@ m4_define([pango_req_version], [1.30])
m4_define([gi_req_version], [1.39.0])
m4_define([xcomposite_req_version], [0.4])
m4_define([gdk_req_version], [3.3.18])
m4_define([libinput_req_version], [0.19.0])
m4_define([libinput_req_version], [1.4.0])
m4_define([libudev_req_version], [136])
AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])

View File

@@ -180,7 +180,7 @@ XVisualInfo *
cogl_xlib_renderer_get_visual_info (CoglRenderer *renderer);
/**
* cogl_xlib_renderer_request_reset_on_video_memory_purge:
* cogl_xlib_renderer_request_reset_on_video_memory_purge: (skip)
* @renderer: a #CoglRenderer
* @enable: The new value
*

View File

@@ -1307,7 +1307,7 @@ CoglMaterialWrapMode
cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
/**
* cogl_material_set_depth_state:
* cogl_material_set_depth_state: (skip)
* @material: A #CoglMaterial object
* @state: A #CoglDepthState struct
* @error: A #CoglError to report failures to setup the given @state.
@@ -1334,7 +1334,7 @@ cogl_material_set_depth_state (CoglMaterial *material,
CoglError **error);
/**
* cogl_material_get_depth_state:
* cogl_material_get_depth_state: (skip)
* @material: A #CoglMaterial object
* @state_out: A destination #CoglDepthState struct
*
@@ -1370,8 +1370,8 @@ typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material,
/**
* cogl_material_foreach_layer:
* @material: A #CoglMaterial object
* @callback: A #CoglMaterialLayerCallback to be called for each layer
* index
* @callback: (scope call): A #CoglMaterialLayerCallback to be called for each
* layer index
* @user_data: Private data that will be passed to the callback
*
* Iterates all the layer indices of the given @material.

View File

@@ -2,7 +2,7 @@ AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [21])
m4_define([mutter_micro_version], [4])
m4_define([mutter_micro_version], [90])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])
@@ -43,9 +43,11 @@ GETTEXT_PACKAGE=mutter
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Name of default gettext domain])
AM_GNU_GETTEXT_VERSION([0.19.6])
AM_GNU_GETTEXT([external])
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
IT_PROG_INTLTOOL([0.41])
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_INSTALL
@@ -116,6 +118,11 @@ AC_ARG_WITH(libwacom,
[disable the use of libwacom for advanced tablet management]),,
with_libwacom=auto)
AC_ARG_WITH(gudev,
AC_HELP_STRING([--without-gudev],
[disable the use of gudev for device type detection]),,
with_gudev=auto)
AC_ARG_WITH([xwayland-path],
[AS_HELP_STRING([--with-xwayland-path], [Absolute path for an X Wayland server])],
[XWAYLAND_PATH="$withval"],
@@ -195,6 +202,24 @@ else
fi
fi
have_gudev=no
AC_MSG_CHECKING([gudev])
if test x$with_gudev = xno ; then
AC_MSG_RESULT([disabled])
else
if $PKG_CONFIG --exists gudev-1.0; then
have_gudev=yes
AC_MSG_RESULT(yes)
MUTTER_PC_MODULES="$MUTTER_PC_MODULES gudev-1.0"
AC_DEFINE([HAVE_LIBGUDEV], 1, [Building with gudev for device type detection])
else
AC_MSG_RESULT(no)
if test x$with_gudev = xyes ; then
AC_MSG_ERROR([gudev forced but not found])
fi
fi
fi
INTROSPECTION_VERSION=0.9.5
GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_VERSION])
@@ -214,12 +239,13 @@ AC_SUBST(XWAYLAND_PATH)
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
MUTTER_NATIVE_BACKEND_MODULES="libdrm libsystemd libinput gudev-1.0 gbm >= 10.3"
MUTTER_NATIVE_BACKEND_MODULES="libdrm libsystemd libinput >= 1.4 gudev-1.0 gbm >= 10.3"
AC_ARG_ENABLE(native-backend,
AS_HELP_STRING([--disable-native-backend], [disable mutter native (KMS) backend]),,
enable_native_backend=auto
)
have_native_backend="no"
AS_IF([test "$enable_native_backend" = "yes"], [have_native_backend=yes],
[test "$enable_native_backend" = "auto"], PKG_CHECK_EXISTS([$MUTTER_NATIVE_BACKEND_MODULES], [have_native_backend=yes]))
@@ -449,6 +475,7 @@ mutter-$VERSION
Startup notification: ${have_startup_notification}
libcanberra: ${have_libcanberra}
libwacom: ${have_libwacom}
gudev ${have_gudev}
Introspection: ${found_introspection}
Session management: ${found_sm}
Wayland: ${have_wayland}

View File

@@ -1,140 +1,140 @@
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
_name="Navigation"
name="Navigation"
wm_name="Mutter"
package="mutter">
<KeyListEntry name="move-to-workspace-1"
_description="Move window to workspace 1" />
description="Move window to workspace 1" />
<KeyListEntry name="move-to-workspace-2"
_description="Move window to workspace 2" />
description="Move window to workspace 2" />
<KeyListEntry name="move-to-workspace-3"
_description="Move window to workspace 3" />
description="Move window to workspace 3" />
<KeyListEntry name="move-to-workspace-4"
_description="Move window to workspace 4" />
description="Move window to workspace 4" />
<KeyListEntry name="move-to-workspace-last"
_description="Move window to last workspace" />
description="Move window to last workspace" />
<KeyListEntry name="move-to-workspace-left"
_description="Move window one workspace to the left" />
description="Move window one workspace to the left" />
<KeyListEntry name="move-to-workspace-right"
_description="Move window one workspace to the right" />
description="Move window one workspace to the right" />
<KeyListEntry name="move-to-workspace-up"
_description="Move window one workspace up" />
description="Move window one workspace up" />
<KeyListEntry name="move-to-workspace-down"
_description="Move window one workspace down" />
description="Move window one workspace down" />
<KeyListEntry name="move-to-monitor-left"
_description="Move window one monitor to the left" />
description="Move window one monitor to the left" />
<KeyListEntry name="move-to-monitor-right"
_description="Move window one monitor to the right" />
description="Move window one monitor to the right" />
<KeyListEntry name="move-to-monitor-up"
_description="Move window one monitor up" />
description="Move window one monitor up" />
<KeyListEntry name="move-to-monitor-down"
_description="Move window one monitor down" />
description="Move window one monitor down" />
<KeyListEntry name="switch-applications"
reverse-entry="switch-applications-backward"
_description="Switch applications"/>
description="Switch applications"/>
<KeyListEntry name="switch-applications-backward"
reverse-entry="switch-applications"
hidden="true"
_description="Switch to previous application"/>
description="Switch to previous application"/>
<KeyListEntry name="switch-windows"
reverse-entry="switch-windows-backward"
_description="Switch windows"/>
description="Switch windows"/>
<KeyListEntry name="switch-windows-backward"
reverse-entry="switch-windows"
hidden="true"
_description="Switch to previous window"/>
description="Switch to previous window"/>
<KeyListEntry name="switch-group"
reverse-entry="switch-group-backward"
_description="Switch windows of an application"/>
description="Switch windows of an application"/>
<KeyListEntry name="switch-group-backward"
reverse-entry="switch-group"
hidden="true"
_description="Switch to previous window of an application"/>
description="Switch to previous window of an application"/>
<KeyListEntry name="switch-panels"
reverse-entry="switch-panels-backward"
_description="Switch system controls"/>
description="Switch system controls"/>
<KeyListEntry name="switch-panels-backward"
reverse-entry="switch-panels"
hidden="true"
_description="Switch to previous system control"/>
description="Switch to previous system control"/>
<KeyListEntry name="cycle-windows"
reverse-entry="cycle-windows-backward"
_description="Switch windows directly"/>
description="Switch windows directly"/>
<KeyListEntry name="cycle-windows-backward"
reverse-entry="cycle-windows"
hidden="true"
_description="Switch directly to previous window"/>
description="Switch directly to previous window"/>
<KeyListEntry name="cycle-group"
reverse-entry="cycle-group-backward"
_description="Switch windows of an app directly"/>
description="Switch windows of an app directly"/>
<KeyListEntry name="cycle-group-backward"
reverse-entry="cycle-group"
hidden="true"
_description="Switch directly to previous window of an app"/>
description="Switch directly to previous window of an app"/>
<KeyListEntry name="cycle-panels"
reverse-entry="cycle-panels-backward"
_description="Switch system controls directly"/>
description="Switch system controls directly"/>
<KeyListEntry name="cycle-panels-backward"
reverse-entry="cycle-panels"
hidden="true"
_description="Switch directly to previous system control"/>
description="Switch directly to previous system control"/>
<KeyListEntry name="show-desktop"
_description="Hide all normal windows"/>
description="Hide all normal windows"/>
<KeyListEntry name="switch-to-workspace-1"
_description="Switch to workspace 1" />
description="Switch to workspace 1" />
<KeyListEntry name="switch-to-workspace-2"
_description="Switch to workspace 2" />
description="Switch to workspace 2" />
<KeyListEntry name="switch-to-workspace-3"
_description="Switch to workspace 3" />
description="Switch to workspace 3" />
<KeyListEntry name="switch-to-workspace-4"
_description="Switch to workspace 4" />
description="Switch to workspace 4" />
<KeyListEntry name="switch-to-workspace-last"
_description="Switch to last workspace" />
description="Switch to last workspace" />
<KeyListEntry name="switch-to-workspace-left"
_description="Move to workspace left" />
description="Move to workspace left" />
<KeyListEntry name="switch-to-workspace-right"
_description="Move to workspace right" />
description="Move to workspace right" />
<KeyListEntry name="switch-to-workspace-up"
_description="Move to workspace above" />
description="Move to workspace above" />
<KeyListEntry name="switch-to-workspace-down"
_description="Move to workspace below" />
description="Move to workspace below" />
</KeyListEntries>

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
_name="System"
name="System"
wm_name="Mutter"
package="mutter">
<KeyListEntry name="panel-run-dialog" _description="Show the run command prompt"/>
<KeyListEntry name="panel-run-dialog" description="Show the run command prompt"/>
<KeyListEntry name="panel-main-menu" _description="Show the activities overview"/>
<KeyListEntry name="panel-main-menu" description="Show the activities overview"/>
</KeyListEntries>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
name="Windows"
wm_name="Mutter"
package="mutter">
<KeyListEntry name="activate-window-menu" description="Activate the window menu"/>
<KeyListEntry name="toggle-fullscreen" description="Toggle fullscreen mode"/>
<KeyListEntry name="toggle-maximized" description="Toggle maximization state"/>
<KeyListEntry name="maximize" description="Maximize window"/>
<KeyListEntry name="unmaximize" description="Restore window"/>
<KeyListEntry name="toggle-shaded" description="Toggle shaded state"/>
<KeyListEntry name="close" description="Close window"/>
<KeyListEntry name="minimize" description="Hide window"/>
<KeyListEntry name="begin-move" description="Move window"/>
<KeyListEntry name="begin-resize" description="Resize window"/>
<KeyListEntry name="toggle-on-all-workspaces"
description="Toggle window on all workspaces or one"/>
<KeyListEntry name="raise-or-lower" description="Raise window if covered, otherwise lower it"/>
<KeyListEntry name="raise" description="Raise window above other windows"/>
<KeyListEntry name="lower" description="Lower window below other windows"/>
<KeyListEntry name="maximize-vertically" description="Maximize window vertically"/>
<KeyListEntry name="maximize-horizontally" description="Maximize window horizontally"/>
<KeyListEntry name="toggle-tiled-left"
schema="org.gnome.mutter.keybindings"
description="View split on left"/>
<KeyListEntry name="toggle-tiled-right"
schema="org.gnome.mutter.keybindings"
description="View split on right"/>
</KeyListEntries>

View File

@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
_name="Windows"
wm_name="Mutter"
package="mutter">
<KeyListEntry name="activate-window-menu" _description="Activate the window menu"/>
<KeyListEntry name="toggle-fullscreen" _description="Toggle fullscreen mode"/>
<KeyListEntry name="toggle-maximized" _description="Toggle maximization state"/>
<KeyListEntry name="maximize" _description="Maximize window"/>
<KeyListEntry name="unmaximize" _description="Restore window"/>
<KeyListEntry name="toggle-shaded" _description="Toggle shaded state"/>
<KeyListEntry name="close" _description="Close window"/>
<KeyListEntry name="minimize" _description="Hide window"/>
<KeyListEntry name="begin-move" _description="Move window"/>
<KeyListEntry name="begin-resize" _description="Resize window"/>
<KeyListEntry name="toggle-on-all-workspaces"
_description="Toggle window on all workspaces or one"/>
<KeyListEntry name="raise-or-lower" _description="Raise window if covered, otherwise lower it"/>
<KeyListEntry name="raise" _description="Raise window above other windows"/>
<KeyListEntry name="lower" _description="Lower window below other windows"/>
<KeyListEntry name="maximize-vertically" _description="Maximize window vertically"/>
<KeyListEntry name="maximize-horizontally" _description="Maximize window horizontally"/>
<KeyListEntry name="toggle-tiled-left"
schema="org.gnome.mutter.keybindings"
_description="View split on left"/>
<KeyListEntry name="toggle-tiled-right"
schema="org.gnome.mutter.keybindings"
_description="View split on right"/>
</KeyListEntries>

View File

@@ -3,21 +3,24 @@ desktopfiles_in_files = \
desktopfilesdir = $(datadir)/applications
desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
%.desktop:%.desktop.in
$(AM_V_GET) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
xml_in_files = \
50-mutter-navigation.xml.in \
50-mutter-system.xml.in \
50-mutter-windows.xml.in
xmldir = $(GNOME_KEYBINDINGS_KEYSDIR)
xml_DATA = $(xml_in_files:.xml.in=.xml)
xml_DATA = \
50-mutter-navigation.xml \
50-mutter-system.xml \
50-mutter-windows.xml
gschema_in_files = \
org.gnome.mutter.gschema.xml.in \
org.gnome.mutter.wayland.gschema.xml.in
gsettings_SCHEMAS = $(gschema_in_files:.xml.in=.xml)
@INTLTOOL_XML_NOMERGE_RULE@
%.gschema.xml: %.gschema.xml.in Makefile
$(AM_V_GEN) sed -e 's|@GETTEXT_DOMAIN[@]|$(GETTEXT_DOMAIN)|g' \
$< > $@ || rm $@
@GSETTINGS_RULES@
convertdir = $(datadir)/GConf/gsettings
@@ -25,11 +28,10 @@ convert_DATA = mutter-schemas.convert
CLEANFILES = \
$(desktopfiles_DATA) \
$(gsettings_SCHEMAS) \
$(xml_DATA)
$(gsettings_SCHEMAS)
EXTRA_DIST = \
$(convert_DATA) \
$(desktopfiles_in_files) \
$(gschema_in_files) \
$(xml_in_files)
$(xml_DATA)

View File

@@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
_Name=Mutter
Name=Mutter
Exec=mutter
NoDisplay=true
# name of loadable control center module

View File

@@ -4,102 +4,102 @@
<key name="overlay-key" type="s">
<default>'Super_L'</default>
<_summary>Modifier to use for extended window management operations</_summary>
<_description>
<summary>Modifier to use for extended window management operations</summary>
<description>
This key will initiate the "overlay", which is a combination window
overview and application launching system. The default is intended
to be the "Windows key" on PC hardware.
It's expected that this binding either the default or set to
the empty string.
</_description>
</description>
</key>
<key name="attach-modal-dialogs" type="b">
<default>false</default>
<_summary>Attach modal dialogs</_summary>
<_description>
<summary>Attach modal dialogs</summary>
<description>
When true, instead of having independent titlebars, modal dialogs
appear attached to the titlebar of the parent window and are moved
together with the parent window.
</_description>
</description>
</key>
<key name="edge-tiling" type="b">
<default>false</default>
<_summary>Enable edge tiling when dropping windows on screen edges</_summary>
<_description>
<summary>Enable edge tiling when dropping windows on screen edges</summary>
<description>
If enabled, dropping windows on vertical screen edges maximizes them
vertically and resizes them horizontally to cover half of the available
area. Dropping windows on the top screen edge maximizes them completely.
</_description>
</description>
</key>
<key name="dynamic-workspaces" type="b">
<default>false</default>
<_summary>Workspaces are managed dynamically</_summary>
<_description>
<summary>Workspaces are managed dynamically</summary>
<description>
Determines whether workspaces are managed dynamically or
whether there's a static number of workspaces (determined
by the num-workspaces key in org.gnome.desktop.wm.preferences).
</_description>
</description>
</key>
<key name="workspaces-only-on-primary" type="b">
<default>false</default>
<_summary>Workspaces only on primary</_summary>
<_description>
<summary>Workspaces only on primary</summary>
<description>
Determines whether workspace switching should happen for windows
on all monitors or only for windows on the primary monitor.
</_description>
</description>
</key>
<key name="no-tab-popup" type="b">
<default>false</default>
<_summary>No tab popup</_summary>
<_description>
<summary>No tab popup</summary>
<description>
Determines whether the use of popup and highlight frame should
be disabled for window cycling.
</_description>
</description>
</key>
<key name="focus-change-on-pointer-rest" type="b">
<default>false</default>
<_summary>Delay focus changes until the pointer stops moving</_summary>
<_description>
<summary>Delay focus changes until the pointer stops moving</summary>
<description>
If set to true, and the focus mode is either "sloppy" or "mouse"
then the focus will not be changed immediately when entering a
window, but only after the pointer stops moving.
</_description>
</description>
</key>
<key name="draggable-border-width" type="i">
<default>10</default>
<range min="0" max="64"/>
<_summary>Draggable border width</_summary>
<_description>
<summary>Draggable border width</summary>
<description>
The amount of total draggable borders. If the theme's visible
borders are not enough, invisible borders will be added to meet
this value.
</_description>
</description>
</key>
<key name="auto-maximize" type="b">
<default>true</default>
<_summary>Auto maximize nearly monitor sized windows</_summary>
<_description>
<summary>Auto maximize nearly monitor sized windows</summary>
<description>
If enabled, new windows that are initially the size of the monitor
automatically get maximized.
</_description>
</description>
</key>
<key name="center-new-windows" type="b">
<default>false</default>
<_summary>Place new windows in the center</_summary>
<_description>
<summary>Place new windows in the center</summary>
<description>
When true, the new windows will always be put in the center of the
active screen of the monitor.
</_description>
</description>
</key>
<child name="keybindings" schema="org.gnome.mutter.keybindings"/>
@@ -117,12 +117,12 @@
<key name="tab-popup-select" type="as">
<default>[]</default>
<_summary>Select window from tab popup</_summary>
<summary>Select window from tab popup</summary>
</key>
<key name="tab-popup-cancel" type="as">
<default>[]</default>
<_summary>Cancel tab popup</_summary>
<summary>Cancel tab popup</summary>
</key>
</schema>

View File

@@ -3,51 +3,51 @@
gettext-domain="@GETTEXT_DOMAIN@">
<key name="switch-to-session-1" type="as">
<default><![CDATA[['<Primary><Alt>F1']]]></default>
<_summary>Switch to VT 1</_summary>
<summary>Switch to VT 1</summary>
</key>
<key name="switch-to-session-2" type="as">
<default><![CDATA[['<Primary><Alt>F2']]]></default>
<_summary>Switch to VT 2</_summary>
<summary>Switch to VT 2</summary>
</key>
<key name="switch-to-session-3" type="as">
<default><![CDATA[['<Primary><Alt>F3']]]></default>
<_summary>Switch to VT 3</_summary>
<summary>Switch to VT 3</summary>
</key>
<key name="switch-to-session-4" type="as">
<default><![CDATA[['<Primary><Alt>F4']]]></default>
<_summary>Switch to VT 4</_summary>
<summary>Switch to VT 4</summary>
</key>
<key name="switch-to-session-5" type="as">
<default><![CDATA[['<Primary><Alt>F5']]]></default>
<_summary>Switch to VT 5</_summary>
<summary>Switch to VT 5</summary>
</key>
<key name="switch-to-session-6" type="as">
<default><![CDATA[['<Primary><Alt>F6']]]></default>
<_summary>Switch to VT 6</_summary>
<summary>Switch to VT 6</summary>
</key>
<key name="switch-to-session-7" type="as">
<default><![CDATA[['<Primary><Alt>F7']]]></default>
<_summary>Switch to VT 7</_summary>
<summary>Switch to VT 7</summary>
</key>
<key name="switch-to-session-8" type="as">
<default><![CDATA[['<Primary><Alt>F8']]]></default>
<_summary>Switch to VT 8</_summary>
<summary>Switch to VT 8</summary>
</key>
<key name="switch-to-session-9" type="as">
<default><![CDATA[['<Primary><Alt>F9']]]></default>
<_summary>Switch to VT 9</_summary>
<summary>Switch to VT 9</summary>
</key>
<key name="switch-to-session-10" type="as">
<default><![CDATA[['<Primary><Alt>F10']]]></default>
<_summary>Switch to VT 10</_summary>
<summary>Switch to VT 10</summary>
</key>
<key name="switch-to-session-11" type="as">
<default><![CDATA[['<Primary><Alt>F11']]]></default>
<_summary>Switch to VT 11</_summary>
<summary>Switch to VT 11</summary>
</key>
<key name="switch-to-session-12" type="as">
<default><![CDATA[['<Primary><Alt>F12']]]></default>
<_summary>Switch to VT 12</_summary>
<summary>Switch to VT 12</summary>
</key>
</schema>
</schemalist>

68
po/Makevars Normal file
View File

@@ -0,0 +1,68 @@
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ \
--keyword=C_:1c,2 --keyword=NC_:1c,2 \
--keyword=g_dngettext:2,3 \
--flag=g_dngettext:2:pass-c-format \
--flag=g_strdup_printf:1:c-format \
--flag=g_string_printf:2:c-format \
--flag=g_string_append_printf:2:c-format \
--flag=g_error_new:3:c-format \
--flag=g_set_error:4:c-format \
--flag=g_markup_printf_escaped:1:c-format \
--flag=g_log:3:c-format \
--flag=g_print:1:c-format \
--flag=g_printerr:1:c-format \
--flag=g_printf:1:c-format \
--flag=g_fprintf:2:c-format \
--flag=g_sprintf:2:c-format \
--flag=g_snprintf:3:c-format
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Translation copyright holder
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = http://bugzilla.gnome.org/enter_bug.cgi?product=mutter&keywords=I18N+L10N&component=general
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# Ignore the timestamp of the .pot file, as git clones do not have
# deterministic timestamps, and .po files are updated by translators
# (only) in GNOME projects.
PO_DEPENDS_ON_POT = no
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = no

View File

@@ -1,8 +1,8 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
data/50-mutter-navigation.xml.in
data/50-mutter-system.xml.in
data/50-mutter-windows.xml.in
data/50-mutter-navigation.xml
data/50-mutter-system.xml
data/50-mutter-windows.xml
data/mutter.desktop.in
data/org.gnome.mutter.gschema.xml.in
data/org.gnome.mutter.wayland.gschema.xml.in

View File

@@ -1,13 +1,12 @@
# List of source files that should NOT be translated.
# Please keep this file sorted alphabetically.
clutter/clutter/clutter-actor-meta.c
clutter/clutter/clutter-actor.c
clutter/clutter/clutter-actor-meta.c
clutter/clutter/clutter-align-constraint.c
clutter/clutter/clutter-backend.c
clutter/clutter/clutter-bin-layout.c
clutter/clutter/clutter-bind-constraint.c
clutter/clutter/clutter-binding-pool.c
clutter/clutter/clutter-bin-layout.c
clutter/clutter/clutter-box-layout.c
clutter/clutter/clutter-brightness-contrast-effect.c
clutter/clutter/clutter-canvas.c
@@ -52,17 +51,18 @@ clutter/clutter/clutter-text.c
clutter/clutter/clutter-timeline.c
clutter/clutter/clutter-transition.c
clutter/clutter/clutter-units.c
clutter/clutter/clutter-virtual-input-device.c
clutter/clutter/clutter-zoom-action.c
clutter/clutter/deprecated/clutter-alpha.c
clutter/clutter/deprecated/clutter-animation.c
clutter/clutter/deprecated/clutter-animator.c
clutter/clutter/deprecated/clutter-behaviour.c
clutter/clutter/deprecated/clutter-behaviour-depth.c
clutter/clutter/deprecated/clutter-behaviour-ellipse.c
clutter/clutter/deprecated/clutter-behaviour-opacity.c
clutter/clutter/deprecated/clutter-behaviour-path.c
clutter/clutter/deprecated/clutter-behaviour-rotate.c
clutter/clutter/deprecated/clutter-behaviour-scale.c
clutter/clutter/deprecated/clutter-behaviour.c
clutter/clutter/deprecated/clutter-box.c
clutter/clutter/deprecated/clutter-cairo-texture.c
clutter/clutter/deprecated/clutter-fixed.c
@@ -72,9 +72,10 @@ clutter/clutter/deprecated/clutter-shader.c
clutter/clutter/deprecated/clutter-state.c
clutter/clutter/deprecated/clutter-table-layout.c
clutter/clutter/deprecated/clutter-texture.c
clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
clutter/clutter/wayland/clutter-wayland-surface.c
clutter/clutter/x11/clutter-backend-x11.c
clutter/clutter/x11/clutter-keymap-x11.c
clutter/clutter/x11/clutter-x11-texture-pixmap.c
cogl/cogl/cogl-debug-options.h
cogl/cogl/cogl-debug.c
cogl/cogl/cogl-debug-options.h

View File

@@ -6,22 +6,23 @@
# Petr Tomeš <ptomes@gmail.com>, 2006.
# Jakub Friedl <jfriedl@suse.cz>, 2006, 2007.
# Petr Kovar <pknbe@volny.cz>, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014.
# Marek Černocký <marek@manet.cz>, 2012, 2013, 2014.
# Marek Černocký <marek@manet.cz>, 2012, 2013, 2014, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-02-27 13:36+0000\n"
"PO-Revision-Date: 2014-09-22 15:01+0200\n"
"Last-Translator: Petr Kovar <pknbe@volny.cz>\n"
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
"POT-Creation-Date: 2016-08-16 12:01+0000\n"
"PO-Revision-Date: 2016-08-17 13:15+0200\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: čeština <gnome-cs-list@gnome.org>\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Generator: Gtranslator 2.91.7\n"
"X-Project-Style: gnome\n"
#: ../data/50-mutter-navigation.xml.in.h:1
@@ -456,36 +457,45 @@ msgstr "Přepnout na VT 11"
msgid "Switch to VT 12"
msgstr "Přepnout na VT 12"
#: ../src/backends/meta-monitor-manager.c:518
#: ../src/backends/meta-input-settings.c:1707
#| msgid "Switch system controls"
msgid "Switch monitor"
msgstr "Přepnout monitor"
#: ../src/backends/meta-input-settings.c:1709
msgid "Show on-screen help"
msgstr "Zobrazit nápovědu na obrazovce"
#: ../src/backends/meta-monitor-manager.c:514
msgid "Built-in display"
msgstr "Vestavěný displej"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:537
msgid "Unknown"
msgstr "Neznámý"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:539
msgid "Unknown Display"
msgstr "Neznámý displej"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:547
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
"\"."
msgstr "Jiný kompozitní správce již běží na obrazovce %i displeje „%s“."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Událost zvonku"
@@ -514,44 +524,44 @@ msgstr "_Počkat"
msgid "_Force Quit"
msgstr "_Vynutit ukončení"
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Nelze otevřít displej X Window System „%s“\n"
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "Zakáže připojení ke správci sezení"
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "Nahradí běžícího správce oken"
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr "Určení ID správy sezení"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "Displej X, který použije"
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "Spustí sezení z uloženého souboru"
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Provede volání X synchronně"
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Spustit jako kompozitor protokolu Wayland"
#: ../src/core/main.c:223
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Spustit jako podkladový kompozitor"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "Spustit jako plnohodnotný server displeje, nikoliv vnořeně"
@@ -573,7 +583,7 @@ msgstr ""
#: ../src/core/mutter.c:53
msgid "Print version"
msgstr "Vypíše verzi"
msgstr "Vypsat verzi"
#: ../src/core/mutter.c:59
msgid "Mutter plugin to use"
@@ -593,15 +603,20 @@ msgstr ""
"Displej „%s“ již správce oken má; zkuste prosím nahradit aktuálního správce "
"oken pomocí přepínače --replace."
#: ../src/core/screen.c:603
#: ../src/core/screen.c:606
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Obrazovka %d na displeji „%s“ je neplatná\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter bylo přeloženo bez podpory podrobného režimu\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Přepínač režimu: režim %d"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
@@ -610,7 +625,7 @@ msgstr ""
"Tato okna nepodporují &quot;ukládání aktuálního nastavení&quot; a po vašem "
"příštím přihlášení je budete muset spustit ručně."
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (na %s)"
@@ -1274,4 +1289,3 @@ msgstr "%s (na %s)"
#~ msgid "Move to Another _Workspace"
#~ msgstr "Přes_unout na jinou plochu"

126
po/fur.po
View File

@@ -8,15 +8,15 @@ msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-03-25 01:58+0000\n"
"PO-Revision-Date: 2016-03-25 17:54+0100\n"
"POT-Creation-Date: 2016-08-07 10:39+0000\n"
"PO-Revision-Date: 2016-08-07 18:18+0200\n"
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
"Language-Team: Friulian <fur@li.org>\n"
"Language: fur\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
"X-Generator: Poedit 1.8.5\n"
"X-Generator: Poedit 1.8.8\n"
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
@@ -108,27 +108,27 @@ msgstr "Passe al control di sisteme precedent"
#: ../data/50-mutter-navigation.xml.in.h:23
msgid "Switch windows directly"
msgstr ""
msgstr "Passe dret ai barcons"
#: ../data/50-mutter-navigation.xml.in.h:24
msgid "Switch directly to previous window"
msgstr ""
msgstr "Passe dret al barcon precedent"
#: ../data/50-mutter-navigation.xml.in.h:25
msgid "Switch windows of an app directly"
msgstr ""
msgstr "Passe dret a un barcon di une aplicazion"
#: ../data/50-mutter-navigation.xml.in.h:26
msgid "Switch directly to previous window of an app"
msgstr ""
msgstr "Passe dret al barcon precedent di une aplicazion"
#: ../data/50-mutter-navigation.xml.in.h:27
msgid "Switch system controls directly"
msgstr ""
msgstr "Passe dret ai controi dal sisteme"
#: ../data/50-mutter-navigation.xml.in.h:28
msgid "Switch directly to previous system control"
msgstr ""
msgstr "Passe dret al control precedent dal sisteme"
#: ../data/50-mutter-navigation.xml.in.h:29
msgid "Hide all normal windows"
@@ -176,7 +176,7 @@ msgstr "Sisteme"
#: ../data/50-mutter-system.xml.in.h:2
msgid "Show the run command prompt"
msgstr ""
msgstr "Mostre la richieste \"eseguìs comant\""
#: ../data/50-mutter-system.xml.in.h:3
msgid "Show the activities overview"
@@ -252,11 +252,11 @@ msgstr "Slargje il barcon par orizontâl"
#: ../data/50-mutter-windows.xml.in.h:18
msgid "View split on left"
msgstr ""
msgstr "Slargje dividint ae çampe"
#: ../data/50-mutter-windows.xml.in.h:19
msgid "View split on right"
msgstr ""
msgstr "Slargje dividint ae drete"
#: ../data/mutter.desktop.in.h:1
msgid "Mutter"
@@ -264,7 +264,7 @@ msgstr "Mutter"
#: ../data/org.gnome.mutter.gschema.xml.in.h:1
msgid "Modifier to use for extended window management operations"
msgstr ""
msgstr "Modificadôr di doprâ pes operazions estesis di gjestion barcons"
#: ../data/org.gnome.mutter.gschema.xml.in.h:2
msgid ""
@@ -273,10 +273,14 @@ msgid ""
"\"Windows key\" on PC hardware. It's expected that this binding either the "
"default or set to the empty string."
msgstr ""
"Cheste clâf e tache il \"overlay\", che e je une cumbinazion tra la "
"panoramiche dai barcons e il sisteme par inviâ lis aplicazions. Il valôr "
"predefinît al è pensât par jessi il \"tast Windows\" su hardware PC. Si "
"spiete che cheste scurte e sedi il valôr predefinît o une stringhe vueide."
#: ../data/org.gnome.mutter.gschema.xml.in.h:3
msgid "Attach modal dialogs"
msgstr ""
msgstr "Dialics modâi tacâts"
#: ../data/org.gnome.mutter.gschema.xml.in.h:4
msgid ""
@@ -284,10 +288,13 @@ msgid ""
"attached to the titlebar of the parent window and are moved together with "
"the parent window."
msgstr ""
"Se metût a VÊR, invezit di vê sbaris di titul indipendentis, i dialics modâi "
"a semein tacâts ae sbare dal titul dal barcon gjenitôr e si spostin cun lui."
#: ../data/org.gnome.mutter.gschema.xml.in.h:5
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
"Abilite il piastrelâ tal ôr cuant che si strissine i barcons tal ôr dal visôr"
#: ../data/org.gnome.mutter.gschema.xml.in.h:6
msgid ""
@@ -295,6 +302,10 @@ msgid ""
"vertically and resizes them horizontally to cover half of the available "
"area. Dropping windows on the top screen edge maximizes them completely."
msgstr ""
"Se abilitade, strissinant i barcons sui ôrs verticâi dal schermi, i barcons "
"a vegnin slargjâts in verticâl e ridimensionâts in orizontâl, in mût di "
"cuvierzi metât dal spazi disponibil. Strissinant sul ôr superiôr dal schermi "
"al slargje i barcons dal dut."
#: ../data/org.gnome.mutter.gschema.xml.in.h:7
msgid "Workspaces are managed dynamically"
@@ -306,6 +317,9 @@ msgid ""
"static number of workspaces (determined by the num-workspaces key in org."
"gnome.desktop.wm.preferences)."
msgstr ""
"Determine se i spazis di lavôr a son gjestîts in maniere dinamiche o se il "
"lôr numar al è fis (determinât de clâf num-workspaces in org.gnome.desktop."
"wm.preferences)."
#: ../data/org.gnome.mutter.gschema.xml.in.h:9
msgid "Workspaces only on primary"
@@ -316,20 +330,24 @@ msgid ""
"Determines whether workspace switching should happen for windows on all "
"monitors or only for windows on the primary monitor."
msgstr ""
"Determine se il cambi di spazi di lavôr al à di vignî pai barcons su ducj i "
"visôrs o nome pai barcons sul visôr primari."
#: ../data/org.gnome.mutter.gschema.xml.in.h:11
msgid "No tab popup"
msgstr ""
msgstr "Nissun tab popup"
#: ../data/org.gnome.mutter.gschema.xml.in.h:12
msgid ""
"Determines whether the use of popup and highlight frame should be disabled "
"for window cycling."
msgstr ""
"Determine se disabilitâ l'ûs di popup e di curnîs di evidenziadure tal passâ "
"di un barcon a chel altri."
#: ../data/org.gnome.mutter.gschema.xml.in.h:13
msgid "Delay focus changes until the pointer stops moving"
msgstr ""
msgstr "Tarde il cambiament dal focus fintremai che il puntadôr si ferme"
#: ../data/org.gnome.mutter.gschema.xml.in.h:14
msgid ""
@@ -337,26 +355,33 @@ msgid ""
"the focus will not be changed immediately when entering a window, but only "
"after the pointer stops moving."
msgstr ""
"Se metût a VÊR, e la modalitât di focus e je metude a \"sloppy\" o \"mouse\" "
"alore il focus nol ven spostât subite cuant che si passe suntun barcon, ma "
"nome cuant che il puntadôr si ferme."
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
msgid "Draggable border width"
msgstr ""
msgstr "Largjece dal ôr che si pues strissinâ"
#: ../data/org.gnome.mutter.gschema.xml.in.h:16
msgid ""
"The amount of total draggable borders. If the theme's visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
"Il spessôr totâl pai ôrs che si puedin strissinâ. Se i ôrs visibii dal teme "
"no bastin, a vegnin zontâts dai ôrs invisibii par rivâ a chest valôr."
#: ../data/org.gnome.mutter.gschema.xml.in.h:17
msgid "Auto maximize nearly monitor sized windows"
msgstr ""
msgstr "Slargje in automatic i barcons grancj su par ju come il visôr"
#: ../data/org.gnome.mutter.gschema.xml.in.h:18
msgid ""
"If enabled, new windows that are initially the size of the monitor "
"automatically get maximized."
msgstr ""
"Se abilitât, i gnûfs barcons che a an al inizi la stesse dimension dal visôr "
"a vegnin slargjâts in automatic."
#: ../data/org.gnome.mutter.gschema.xml.in.h:19
msgid "Place new windows in the center"
@@ -367,14 +392,16 @@ msgid ""
"When true, the new windows will always be put in the center of the active "
"screen of the monitor."
msgstr ""
"Se metût a VÊR, i gnûfs barcons a vegnaran plaçâts simpri tal mieç dal "
"schermi atîf dal visôr."
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
msgid "Select window from tab popup"
msgstr ""
msgstr "Selezione barcon dal tab popup"
#: ../data/org.gnome.mutter.gschema.xml.in.h:22
msgid "Cancel tab popup"
msgstr ""
msgstr "Anule tab popup"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
msgid "Switch to VT 1"
@@ -424,29 +451,37 @@ msgstr "Passe al VT 11"
msgid "Switch to VT 12"
msgstr "Passe al VT 12"
#: ../src/backends/meta-monitor-manager.c:518
#: ../src/backends/meta-input-settings.c:1707
msgid "Switch monitor"
msgstr "Cambie visôr"
#: ../src/backends/meta-input-settings.c:1709
msgid "Show on-screen help"
msgstr "Mostre jutori a schermi"
#: ../src/backends/meta-monitor-manager.c:515
msgid "Built-in display"
msgstr "Display integrât"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:538
msgid "Unknown"
msgstr "No cognossût"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:540
msgid "Unknown Display"
msgstr "Display no cognossût"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:548
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -473,6 +508,8 @@ msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr ""
"Al è pussibil sielzi di spietâ un pôc lassant che la aplicazion e continui o "
"sfuarçâ la aplicazion par sierâle dal dut."
#: ../src/core/delete.c:141
msgid "_Wait"
@@ -482,44 +519,44 @@ msgstr "_Spiete"
msgid "_Force Quit"
msgstr "Sfuarce _Jessude"
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Impussibil vierzi il display '%s' di X Window System\n"
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr ""
msgstr "Disabilite la conession al gjestôr de session"
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "Rimplace il window manager in vore"
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr ""
msgstr "Specifiche il ID di gjestion session"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "Display X di doprâ"
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "Inizialize session da file salvât"
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Fâs lis clamadis X sincronis"
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Eseguìs come compositor wayland"
#: ../src/core/main.c:223
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Eseguìs come compositor nidiât"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "Eseguìs come servidôr display complet, invezit che nidiât"
@@ -535,7 +572,7 @@ msgstr ""
"mutter %s\n"
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., e altris\n"
"Chest al è software libar; viodi i sorzints pes condizions di copie.\n"
"No je NISSUNE garanzie; nancje di COMERCIABILITÂT o IDONEITÂT A UNE "
"No je NISSUNE garanzie; nancje di CUMIERÇABILITÂT o IDONEITÂT A UNE "
"FINALITÂT PARTICOLÂR.\n"
#: ../src/core/mutter.c:53
@@ -560,15 +597,20 @@ msgstr ""
"Il display \"%s\" al à za un window manager; prove dopre la opzion --replace "
"par rimplaçâ chel atuâl."
#: ../src/core/screen.c:603
#: ../src/core/screen.c:606
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Schermi %d su display '%s' no valit\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Cambie mût: mût %d"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
@@ -577,7 +619,7 @@ msgstr ""
"Chescj barcons no supuartin la funzion &quot;salve impostazions atuâi&quot; "
"e si scugnarà tornâ a inviâlis a man tal prossim acès."
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (su %s)"

View File

@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: metacity.HEAD.he\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-03 14:39+0200\n"
"PO-Revision-Date: 2016-03-03 14:40+0200\n"
"POT-Creation-Date: 2016-08-07 15:11+0300\n"
"PO-Revision-Date: 2016-08-07 15:12+0300\n"
"Last-Translator: Yosef Or Boczko <yoseforb@gmail.com>\n"
"Language-Team: עברית <>\n"
"Language: he\n"
@@ -453,36 +453,44 @@ msgstr "מעבר ל־VT 11"
msgid "Switch to VT 12"
msgstr "מעבר ל־VT 12"
#: ../src/backends/meta-monitor-manager.c:518
#: ../src/backends/meta-input-settings.c:1707
msgid "Switch monitor"
msgstr "החלפה בין צגים"
#: ../src/backends/meta-input-settings.c:1709
msgid "Show on-screen help"
msgstr "הצגת עזרה על המסך"
#: ../src/backends/meta-monitor-manager.c:515
msgid "Built-in display"
msgstr "תצוגה מובנית"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:538
msgid "Unknown"
msgstr "לא ידוע"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:540
msgid "Unknown Display"
msgstr "תצוגה לא ידועה"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:548
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
"\"."
msgstr "מנהל תצוגת חלונות אחר כבר פועל במסך %i בתצוגה „%s“."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "אירוע פעמון"
@@ -510,44 +518,44 @@ msgstr "ה_מתנה"
msgid "_Force Quit"
msgstr "_אילוץ סגירה"
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Failed to open X Window System display '%s'\n"
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "Disable connection to session manager"
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "Replace the running window manager"
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr "Specify session management ID"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "X Display to use"
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "Initialize session from savefile"
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Make X calls synchronous"
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Run as a wayland compositor"
#: ../src/core/main.c:223
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Run as a nested compositor"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "Run as a full display server, rather than nested"
@@ -587,15 +595,20 @@ msgstr ""
"Display \"%s\" already has a window manager; try using the --replace option "
"to replace the current window manager."
#: ../src/core/screen.c:603
#: ../src/core/screen.c:606
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Screen %d on display '%s' is invalid\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter הודר ללא תמיכה במצב פירוט\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "מצב העברה: מצב %d"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
@@ -604,7 +617,7 @@ msgstr ""
"חלונות אלו אינם תומכים ב&quot;שמירת ההגדרות הנוכחיות&quot;, ויהיה צורך "
"באתחול ידני בכניסה הבאה שלך."
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (מעל %s)"

View File

@@ -12,8 +12,8 @@ msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-03-04 13:42+0000\n"
"PO-Revision-Date: 2016-03-04 20:43+0100\n"
"POT-Creation-Date: 2016-07-22 13:03+0000\n"
"PO-Revision-Date: 2016-08-05 00:06+0200\n"
"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
"Language-Team: Hungarian <gnome-hu-list at gnome dot org>\n"
"Language: hu\n"
@@ -455,29 +455,38 @@ msgstr "Váltás a 11. VT-re"
msgid "Switch to VT 12"
msgstr "Váltás a 12. VT-re"
#: ../src/backends/meta-monitor-manager.c:518
#: ../src/backends/meta-input-settings.c:1601
#| msgid "Switch system controls"
msgid "Switch monitor"
msgstr "Monitorváltás"
#: ../src/backends/meta-input-settings.c:1603
msgid "Show on-screen help"
msgstr "Képernyősúgó megjelenítése"
#: ../src/backends/meta-monitor-manager.c:515
msgid "Built-in display"
msgstr "Beépített kijelző"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:538
msgid "Unknown"
msgstr "Ismeretlen"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:540
msgid "Unknown Display"
msgstr "Ismeretlen kijelző"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:548
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -485,7 +494,7 @@ msgid ""
msgstr ""
"Már fut egy másik betűszedés-kezelő a(z) %i képernyőn a(z) „%s” megjelenítőn."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Csengetés esemény"
@@ -514,45 +523,44 @@ msgstr "Vá_rakozás"
msgid "_Force Quit"
msgstr "_Erőltetett kilépés"
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Nem sikerült megnyitni a(z) „%s” X Window rendszer képernyőt\n"
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "A munkamenet-kezelőhöz való csatlakozás tiltása"
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "A futó ablakkezelő helyettesítése"
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr "A munkamenet-kezelő azonosítójának megadása"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "A használandó X megjelenítő"
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "A munkamenet előkészítése a mentési fájlból"
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Az X-hívások szinkronná tétele"
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Futtatás wayland betűszedőként"
#: ../src/core/main.c:223
#| msgid "Run as a wayland compositor"
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Futtatás beágyazott betűszedőként"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr ""
"Futtatás teljes megjelenítő kiszolgálóként az egymásba ágyazott helyett"
@@ -599,10 +607,15 @@ msgstr ""
msgid "Screen %d on display '%s' is invalid\n"
msgstr "A(z) %d képernyő a(z) „%s” megjelenítőn érvénytelen\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "A Mutter ablakkezelőt a részletes mód támogatása nélkül fordították\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Módkapcsoló: %d. mód"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
@@ -612,7 +625,7 @@ msgstr ""
"mentését&quot;, emiatt ezeket a legközelebbi bejelentkezéskor manuálisan "
"újra kell indítania."
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (ezen: %s)"

View File

@@ -6,15 +6,15 @@
# Tomas Kuliavas <tokul@users.sourceforge.net>, 2003.
# Žygimantas Beručka <zygis@gnome.org>, 2004-2007.
# Gintautas Miliauskas <gintautas@miliauskas.lt>, 2007-2009, 2010.
# Aurimas Černius <aurisc4@gmail.com>, 2013, 2014, 2015.
# Aurimas Černius <aurisc4@gmail.com>, 2013, 2014, 2015, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: lt\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-02-26 09:54+0000\n"
"PO-Revision-Date: 2016-02-25 15:18+0200\n"
"POT-Creation-Date: 2016-07-22 13:03+0000\n"
"PO-Revision-Date: 2016-08-03 22:14+0300\n"
"Last-Translator: Aurimas Černius <aurisc4@gmail.com>\n"
"Language-Team: Lietuvių <gnome-lt@lists.akl.lt>\n"
"Language: lt\n"
@@ -23,7 +23,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n"
"%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.8.7\n"
"X-Generator: Gtranslator 2.91.7\n"
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
@@ -457,36 +457,45 @@ msgstr "Persijungti į VT 11"
msgid "Switch to VT 12"
msgstr "Persijungti į VT 12"
#: ../src/backends/meta-monitor-manager.c:518
#: ../src/backends/meta-input-settings.c:1601
#| msgid "Switch system controls"
msgid "Switch monitor"
msgstr "Perjungti monitorių"
#: ../src/backends/meta-input-settings.c:1603
msgid "Show on-screen help"
msgstr "Rodyti pagalbą ekrane"
#: ../src/backends/meta-monitor-manager.c:515
msgid "Built-in display"
msgstr "Integruotas vaizduoklis"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:538
msgid "Unknown"
msgstr "Nežinomas"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:540
msgid "Unknown Display"
msgstr "Nežinomas vaizduoklis"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:548
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
"\"."
msgstr "Kita kompozicijos tvarkytuvė jau veikia ekrane %i vaizduoklyje „%s“."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Skambučio įvykis"
@@ -513,44 +522,44 @@ msgstr "_Laukti"
msgid "_Force Quit"
msgstr "_Priverstinai išeiti"
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Nepavyko atverti X Window sistemos ekrano „%s“\n"
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "Išjungti susijungimą su sesijos tvarkytuve"
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "Pakeisti veikiančią langų tvarkytuvę"
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr "Nurodyti sesijos tvarkymo ID"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "Naudotinas X ekranas"
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "Inicializuoti sesiją iš išsaugojimo failo"
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Sinchronizuoti X iškvietimus"
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Vykdyti kaip wayland kompozitorių"
#: ../src/core/main.c:223
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Vykdyti kaip įdėtinį kompozitorių"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "Vykdyti kaip visą vaizduoklio serverį, o ne įdėtinį"
@@ -598,10 +607,15 @@ msgstr ""
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Ekranas %d vaizduoklyje „%s“ netinkamas\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter buvo sukompiliuota be išsamaus veikimo veiksenos\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Veiksenos perjungimas: veiksena %d"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
@@ -610,7 +624,7 @@ msgstr ""
"Šie langai nepalaiko &quot;išsaugoti esamus nustatymus&quot; komandos ir "
"turi būti paleisti rankiniu būdu, kai prisijungsite kitą kartą."
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (kompiuteryje %s)"

View File

@@ -14,8 +14,8 @@ msgstr ""
"Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-03-01 13:42+0000\n"
"PO-Revision-Date: 2016-03-01 20:40+0100\n"
"POT-Creation-Date: 2016-07-22 13:03+0000\n"
"PO-Revision-Date: 2016-08-04 15:28+0200\n"
"Last-Translator: Dušan Kazik <prescott66@gmail.com>\n"
"Language-Team: Slovak <gnome-sk-list@gnome.org>\n"
"Language: sk\n"
@@ -23,7 +23,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;\n"
"X-Generator: Poedit 1.8.7\n"
"X-Generator: Poedit 1.8.8\n"
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
@@ -242,7 +242,7 @@ msgstr "Aktivovať ponuku okna"
# description
#: ../data/50-mutter-windows.xml.in.h:3
msgid "Toggle fullscreen mode"
msgstr "Prepnúť celoobrazovkový režim"
msgstr "Prepnúť režim na celú obrazovku"
# description
#: ../data/50-mutter-windows.xml.in.h:4
@@ -542,29 +542,39 @@ msgstr "Prepnúť na VT č. 11"
msgid "Switch to VT 12"
msgstr "Prepnúť na VT č. 12"
#: ../src/backends/meta-monitor-manager.c:518
# PK: predpokladam ze to prepisane medzi tlacidlami
# description
#: ../src/backends/meta-input-settings.c:1601
msgid "Switch monitor"
msgstr "Prepnúť monitor"
#: ../src/backends/meta-input-settings.c:1603
msgid "Show on-screen help"
msgstr "Zobraziť pomocníka na obrazovke"
#: ../src/backends/meta-monitor-manager.c:515
msgid "Built-in display"
msgstr "Vstavaný displej"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:538
msgid "Unknown"
msgstr "Neznámy"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:540
msgid "Unknown Display"
msgstr "Neznámy displej"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:548
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -572,7 +582,7 @@ msgid ""
msgstr ""
"Pre obrazovku č. %i na displeji „%s“ je spustený už iný správca rozloženia."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Udalosť zvončeka"
@@ -602,51 +612,51 @@ msgid "_Force Quit"
msgstr "_Vynútiť ukončenie"
# X window system preloz, napr. system na spravu okien X
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n"
# cmd desc
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "Zakáže pripojenia k správcovi relácií"
# cmd desc
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "Nahradí bežiaceho správcu okien"
# cmd desc
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr "Zadá identifikátor správy relácií"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "X displej, ktorý bude použitý"
# cmd desc
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "Inicializuje reláciu z uloženého súboru"
# cmd desc
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Použije synchrónne volania X"
# cmd desc
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Spustí ako kompozitor protokolu wayland"
# cmd desc
#: ../src/core/main.c:223
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Spustí ako kompozitor s vnoreným režimom"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "Spustí ako plnohodnotný zobrazovací server, namiesto vnoreného režimu"
@@ -694,10 +704,15 @@ msgstr ""
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Obrazovka č. %d na displeji „%s“ nie je platná\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Prepínač režimu: Režim č. %d"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
@@ -707,7 +722,7 @@ msgstr ""
"prihlásení ich budete musieť znovu spustiť ručne."
# window title; wm_client_machine
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (na %s)"

View File

@@ -11,18 +11,18 @@ msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-03-05 21:12+0100\n"
"PO-Revision-Date: 2016-03-05 21:12+0100\n"
"POT-Creation-Date: 2016-08-18 22:38+0200\n"
"PO-Revision-Date: 2016-08-18 22:39+0200\n"
"Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n"
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
"Language: sl\n"
"Language: sl_SI\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
"%100==4 ? 3 : 0);\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 1.8.4\n"
"X-Generator: Poedit 1.8.7.1\n"
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
@@ -455,29 +455,37 @@ msgstr "Preklopi na VT 11"
msgid "Switch to VT 12"
msgstr "Preklopi na VT 12"
#: ../src/backends/meta-monitor-manager.c:518
#: ../src/backends/meta-input-settings.c:1707
msgid "Switch monitor"
msgstr "Nadzornik preklopa"
#: ../src/backends/meta-input-settings.c:1709
msgid "Show on-screen help"
msgstr "Pokaži zaslonsko pomoč"
#: ../src/backends/meta-monitor-manager.c:514
msgid "Built-in display"
msgstr "Vgrajen zaslon"
#: ../src/backends/meta-monitor-manager.c:544
#: ../src/backends/meta-monitor-manager.c:537
msgid "Unknown"
msgstr "Neznano"
#: ../src/backends/meta-monitor-manager.c:546
#: ../src/backends/meta-monitor-manager.c:539
msgid "Unknown Display"
msgstr "Neznan zaslon"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#: ../src/backends/meta-monitor-manager.c:547
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:463
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -485,7 +493,7 @@ msgid ""
msgstr ""
"Drug upravljalnik sestavljanja je že zagnan na zaslonu %i prikaza \"%s\"."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Dogodek zvonjenja"
@@ -514,44 +522,44 @@ msgstr "_Počakaj"
msgid "_Force Quit"
msgstr "_Vsili konec"
#: ../src/core/display.c:555
#: ../src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Ni mogoče odpreti zaslona '%s' okenskega sistema X\n"
#: ../src/core/main.c:181
#: ../src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "Onemogoči povezavo z upravljalnikom sej"
#: ../src/core/main.c:187
#: ../src/core/main.c:188
msgid "Replace the running window manager"
msgstr "Zamenjaj trenutni upravljalnik oken"
#: ../src/core/main.c:193
#: ../src/core/main.c:194
msgid "Specify session management ID"
msgstr "Navedite ID upravljanja seje"
#: ../src/core/main.c:198
#: ../src/core/main.c:199
msgid "X Display to use"
msgstr "Zaslon X za uporabo"
#: ../src/core/main.c:204
#: ../src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "Začni sejo iz shranjene datoteke"
#: ../src/core/main.c:210
#: ../src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "Uskladi klice X"
#: ../src/core/main.c:217
#: ../src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "Zaženi izbirnik wayland"
#: ../src/core/main.c:223
#: ../src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "Zaženi kot gnezden vpisovalnik"
#: ../src/core/main.c:231
#: ../src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "Zaženi kot polni strežnik zaslona in ne vstavljeno"
@@ -593,16 +601,21 @@ msgstr ""
"Zaslon \"%s\" že ima določen upravljalnik oken; poskušajte uporabiti možnost "
"--replace za zamenjavo trenutnega upravljalnika zaslona."
#: ../src/core/screen.c:603
#: ../src/core/screen.c:606
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Zaslon %d na prikazu '%s' ni veljaven\n"
#: ../src/core/util.c:121
#: ../src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr ""
"Program Mutter je kodno preveden brez podpore za podrobni način izpisovanja\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Način preklopa: način %d"
# G:2 K:6 O:0
#: ../src/x11/session.c:1815
msgid ""
@@ -612,7 +625,7 @@ msgstr ""
"Ta okna ne podpirajo možnosti &quot;shranjevanja trenutnih nastavitev&quot;, "
"zato jih bo treba ob naslednji prijavi zagnati ročno."
#: ../src/x11/window-props.c:549
#: ../src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s (na %s)"

View File

@@ -71,6 +71,9 @@ struct _MetaInputSettingsClass
void (* set_edge_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_two_finger_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_scroll_button) (MetaInputSettings *settings,
ClutterInputDevice *device,
guint button);
@@ -97,6 +100,13 @@ struct _MetaInputSettingsClass
gdouble padding_right,
gdouble padding_top,
gdouble padding_bottom);
void (* set_mouse_accel_profile) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile);
void (* set_trackball_accel_profile) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile);
};
GType meta_input_settings_get_type (void) G_GNUC_CONST;
@@ -137,4 +147,6 @@ WacomDevice * meta_input_settings_get_tablet_wacom_device (MetaInputSettings *se
ClutterInputDevice *device);
#endif
gboolean meta_input_device_is_trackball (ClutterInputDevice *device);
#endif /* META_INPUT_SETTINGS_PRIVATE_H */

View File

@@ -310,6 +310,63 @@ update_mouse_left_handed (MetaInputSettings *input_settings,
}
}
static void
do_update_pointer_accel_profile (MetaInputSettings *input_settings,
GSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
MetaInputSettingsPrivate *priv =
meta_input_settings_get_instance_private (input_settings);
MetaInputSettingsClass *input_settings_class =
META_INPUT_SETTINGS_GET_CLASS (input_settings);
if (settings == priv->mouse_settings)
input_settings_class->set_mouse_accel_profile (input_settings,
device,
profile);
else if (settings == priv->trackball_settings)
input_settings_class->set_trackball_accel_profile (input_settings,
device,
profile);
}
static void
update_pointer_accel_profile (MetaInputSettings *input_settings,
GSettings *settings,
ClutterInputDevice *device)
{
GDesktopPointerAccelProfile profile;
profile = g_settings_get_enum (settings, "accel-profile");
if (device)
{
do_update_pointer_accel_profile (input_settings, settings,
device, profile);
}
else
{
MetaInputSettingsPrivate *priv =
meta_input_settings_get_instance_private (input_settings);
const GSList *devices;
const GSList *l;
devices = clutter_device_manager_peek_devices (priv->device_manager);
for (l = devices; l; l = l->next)
{
device = l->data;
if (clutter_input_device_get_device_mode (device) ==
CLUTTER_INPUT_MODE_MASTER)
continue;
do_update_pointer_accel_profile (input_settings, settings,
device, profile);
}
}
}
static GSettings *
get_settings_for_device_type (MetaInputSettings *input_settings,
ClutterInputDeviceType type)
@@ -449,6 +506,36 @@ update_touchpad_edge_scroll (MetaInputSettings *input_settings,
}
}
static void
update_touchpad_two_finger_scroll (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
MetaInputSettingsClass *input_settings_class;
gboolean two_finger_scroll_enabled;
MetaInputSettingsPrivate *priv;
if (device &&
clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
return;
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
two_finger_scroll_enabled = g_settings_get_boolean (priv->touchpad_settings, "two-finger-scrolling-enabled");
if (device)
{
settings_device_set_bool_setting (input_settings, device,
input_settings_class->set_two_finger_scroll,
two_finger_scroll_enabled);
}
else
{
settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
(ConfigBoolFunc) input_settings_class->set_two_finger_scroll,
two_finger_scroll_enabled);
}
}
static void
update_touchpad_click_method (MetaInputSettings *input_settings,
ClutterInputDevice *device)
@@ -509,8 +596,8 @@ update_touchpad_send_events (MetaInputSettings *input_settings,
}
}
static gboolean
device_is_trackball (ClutterInputDevice *device)
gboolean
meta_input_device_is_trackball (ClutterInputDevice *device)
{
gboolean is_trackball;
char *name;
@@ -533,7 +620,7 @@ update_trackball_scroll_button (MetaInputSettings *input_settings,
MetaInputSettingsPrivate *priv;
guint button;
if (device && !device_is_trackball (device))
if (device && !meta_input_device_is_trackball (device))
return;
priv = meta_input_settings_get_instance_private (input_settings);
@@ -556,7 +643,7 @@ update_trackball_scroll_button (MetaInputSettings *input_settings,
{
device = devices->data;
if (device_is_trackball (device))
if (meta_input_device_is_trackball (device))
input_settings_class->set_scroll_button (input_settings, device, button);
devices = devices->next;
@@ -822,6 +909,8 @@ meta_input_settings_changed_cb (GSettings *settings,
update_device_speed (input_settings, NULL);
else if (strcmp (key, "natural-scroll") == 0)
update_device_natural_scroll (input_settings, NULL);
else if (strcmp (key, "accel-profile") == 0)
update_pointer_accel_profile (input_settings, settings, NULL);
}
else if (settings == priv->touchpad_settings)
{
@@ -837,6 +926,8 @@ meta_input_settings_changed_cb (GSettings *settings,
update_touchpad_send_events (input_settings, NULL);
else if (strcmp (key, "edge-scrolling-enabled") == 0)
update_touchpad_edge_scroll (input_settings, NULL);
else if (strcmp (key, "two-finger-scrolling-enabled") == 0)
update_touchpad_two_finger_scroll (input_settings, NULL);
else if (strcmp (key, "click-method") == 0)
update_touchpad_click_method (input_settings, NULL);
}
@@ -844,6 +935,8 @@ meta_input_settings_changed_cb (GSettings *settings,
{
if (strcmp (key, "scroll-wheel-emulation-button") == 0)
update_trackball_scroll_button (input_settings, NULL);
else if (strcmp (key, "accel-profile") == 0)
update_pointer_accel_profile (input_settings, settings, NULL);
}
else if (settings == priv->keyboard_settings)
{
@@ -1140,19 +1233,28 @@ static void
apply_device_settings (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
update_mouse_left_handed (input_settings, device);
MetaInputSettingsPrivate *priv =
meta_input_settings_get_instance_private (input_settings);
update_device_speed (input_settings, device);
update_device_natural_scroll (input_settings, device);
update_mouse_left_handed (input_settings, device);
update_pointer_accel_profile (input_settings,
priv->mouse_settings,
device);
update_touchpad_left_handed (input_settings, device);
update_device_speed (input_settings, device);
update_device_natural_scroll (input_settings, device);
update_touchpad_tap_enabled (input_settings, device);
update_touchpad_send_events (input_settings, device);
update_touchpad_edge_scroll (input_settings, device);
update_touchpad_two_finger_scroll (input_settings, device);
update_touchpad_click_method (input_settings, device);
update_trackball_scroll_button (input_settings, device);
update_pointer_accel_profile (input_settings,
priv->trackball_settings,
device);
}
static void

View File

@@ -273,6 +273,8 @@ meta_monitor_config_finalize (GObject *object)
MetaMonitorConfig *self = META_MONITOR_CONFIG (object);
g_hash_table_destroy (self->configs);
G_OBJECT_CLASS (meta_monitor_config_parent_class)->finalize (object);
}
static void

View File

@@ -270,11 +270,10 @@ make_logical_config (MetaMonitorManager *manager)
info->outputs[0] = output;
info->n_outputs = 1;
info->scale = output->scale;
if (output->is_primary || info->winsys_id == 0)
{
info->scale = output->scale;
info->winsys_id = output->winsys_id;
}
info->winsys_id = output->winsys_id;
if (info->is_primary)
manager->primary_monitor_index = info->number;

View File

@@ -35,7 +35,7 @@ static GParamSpec *obj_props[PROP_LAST];
struct _MetaRendererView
{
ClutterStageView parent;
ClutterStageViewCogl parent;
MetaMonitorInfo *monitor_info;
};

View File

@@ -54,6 +54,8 @@ meta_input_settings_native_set_send_events (MetaInputSettings *settings,
}
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
libinput_device_config_send_events_set_mode (libinput_device, libinput_mode);
}
@@ -65,6 +67,8 @@ meta_input_settings_native_set_matrix (MetaInputSettings *settings,
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
if (libinput_device_config_calibration_has_matrix (libinput_device) > 0)
libinput_device_config_calibration_set_matrix (libinput_device, matrix);
@@ -78,6 +82,8 @@ meta_input_settings_native_set_speed (MetaInputSettings *settings,
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
libinput_device_config_accel_set_speed (libinput_device,
CLAMP (speed, -1, 1));
}
@@ -90,6 +96,8 @@ meta_input_settings_native_set_left_handed (MetaInputSettings *settings,
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
if (libinput_device_config_left_handed_is_available (libinput_device))
libinput_device_config_left_handed_set (libinput_device, enabled);
@@ -103,6 +111,8 @@ meta_input_settings_native_set_tap_enabled (MetaInputSettings *settings,
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
if (libinput_device_config_tap_get_finger_count (libinput_device) > 0)
libinput_device_config_tap_set_enabled (libinput_device,
@@ -119,6 +129,8 @@ meta_input_settings_native_set_invert_scroll (MetaInputSettings *settings,
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
if (libinput_device_config_scroll_has_natural_scroll (libinput_device))
libinput_device_config_scroll_set_natural_scroll_enabled (libinput_device,
@@ -161,16 +173,20 @@ meta_input_settings_native_set_edge_scroll (MetaInputSettings *settin
enum libinput_config_scroll_method scroll_method = 0;
struct libinput_device *libinput_device;
enum libinput_config_scroll_method supported;
enum libinput_config_scroll_method current;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
supported = libinput_device_config_scroll_get_methods (libinput_device);
current = libinput_device_config_scroll_get_method (libinput_device);
if (supported & LIBINPUT_CONFIG_SCROLL_2FG)
{
scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
}
else if (supported & LIBINPUT_CONFIG_SCROLL_EDGE &&
edge_scrolling_enabled)
/* Don't set edge scrolling if two-finger scrolling is enabled and available */
if (current == LIBINPUT_CONFIG_SCROLL_2FG)
return;
if (supported & LIBINPUT_CONFIG_SCROLL_EDGE &&
edge_scrolling_enabled)
{
scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE;
}
@@ -182,6 +198,38 @@ meta_input_settings_native_set_edge_scroll (MetaInputSettings *settin
device_set_scroll_method (libinput_device, scroll_method);
}
static void
meta_input_settings_native_set_two_finger_scroll (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean two_finger_scroll_enabled)
{
enum libinput_config_scroll_method scroll_method = 0;
struct libinput_device *libinput_device;
enum libinput_config_scroll_method supported;
enum libinput_config_scroll_method current;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
supported = libinput_device_config_scroll_get_methods (libinput_device);
current = libinput_device_config_scroll_get_method (libinput_device);
if (two_finger_scroll_enabled &&
!(supported & LIBINPUT_CONFIG_SCROLL_2FG))
return;
if (two_finger_scroll_enabled)
{
scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
}
else if (current != LIBINPUT_CONFIG_SCROLL_EDGE)
{
scroll_method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
}
else
return;
device_set_scroll_method (libinput_device, scroll_method);
}
static void
meta_input_settings_native_set_scroll_button (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -190,6 +238,8 @@ meta_input_settings_native_set_scroll_button (MetaInputSettings *settings,
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
if (!device_set_scroll_method (libinput_device,
LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN))
@@ -207,6 +257,8 @@ meta_input_settings_native_set_click_method (MetaInputSettings *settin
struct libinput_device *libinput_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return;
switch (mode)
{
@@ -241,6 +293,112 @@ meta_input_settings_native_set_keyboard_repeat (MetaInputSettings *settings,
clutter_evdev_set_keyboard_repeat (manager, enabled, delay, interval);
}
static void
set_device_accel_profile (ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
struct libinput_device *libinput_device;
enum libinput_config_accel_profile libinput_profile;
uint32_t profiles;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
switch (profile)
{
case G_DESKTOP_POINTER_ACCEL_PROFILE_FLAT:
libinput_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
break;
case G_DESKTOP_POINTER_ACCEL_PROFILE_ADAPTIVE:
libinput_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
break;
default:
g_warn_if_reached ();
case G_DESKTOP_POINTER_ACCEL_PROFILE_DEFAULT:
libinput_profile =
libinput_device_config_accel_get_default_profile (libinput_device);
}
profiles = libinput_device_config_accel_get_profiles (libinput_device);
if ((profiles & libinput_profile) == 0)
{
libinput_profile =
libinput_device_config_accel_get_default_profile (libinput_device);
}
libinput_device_config_accel_set_profile (libinput_device,
libinput_profile);
}
static gboolean
has_udev_property (ClutterInputDevice *device,
const char *property)
{
struct libinput_device *libinput_device;
struct udev_device *udev_device;
struct udev_device *parent_udev_device;
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
if (!libinput_device)
return FALSE;
udev_device = libinput_device_get_udev_device (libinput_device);
if (!udev_device)
return FALSE;
if (NULL != udev_device_get_property_value (udev_device, property))
{
udev_device_unref (udev_device);
return TRUE;
}
parent_udev_device = udev_device_get_parent (udev_device);
udev_device_unref (udev_device);
if (!parent_udev_device)
return FALSE;
if (NULL != udev_device_get_property_value (parent_udev_device, property))
return TRUE;
return FALSE;
}
static gboolean
is_mouse_device (ClutterInputDevice *device)
{
return (has_udev_property (device, "ID_INPUT_MOUSE") &&
!has_udev_property (device, "ID_INPUT_POINTINGSTICK"));
}
static gboolean
is_trackball_device (ClutterInputDevice *device)
{
return meta_input_device_is_trackball (device);
}
static void
meta_input_settings_native_set_mouse_accel_profile (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
if (!is_mouse_device (device))
return;
set_device_accel_profile (device, profile);
}
static void
meta_input_settings_native_set_trackball_accel_profile (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
if (!is_trackball_device (device))
return;
set_device_accel_profile (device, profile);
}
static void
meta_input_settings_native_set_tablet_mapping (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -290,6 +448,7 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
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_edge_scroll = meta_input_settings_native_set_edge_scroll;
input_settings_class->set_two_finger_scroll = meta_input_settings_native_set_two_finger_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;
@@ -297,6 +456,9 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
input_settings_class->set_tablet_mapping = meta_input_settings_native_set_tablet_mapping;
input_settings_class->set_tablet_keep_aspect = meta_input_settings_native_set_tablet_keep_aspect;
input_settings_class->set_tablet_area = meta_input_settings_native_set_tablet_area;
input_settings_class->set_mouse_accel_profile = meta_input_settings_native_set_mouse_accel_profile;
input_settings_class->set_trackball_accel_profile = meta_input_settings_native_set_trackball_accel_profile;
}
static void

View File

@@ -54,7 +54,10 @@ typedef struct {
drmModeEncoderPtr *encoders;
drmModeEncoderPtr current_encoder;
/* bitmasks of encoder position in the resources array */
/*
* Bitmasks of encoder position in the resources array (used during clone
* setup).
*/
uint32_t encoder_mask;
uint32_t enc_clone_mask;
@@ -369,6 +372,33 @@ find_meta_mode (MetaMonitorManager *manager,
return NULL;
}
static void
init_mode (MetaMonitorMode *mode,
drmModeModeInfo *drm_mode,
long mode_id)
{
mode->mode_id = mode_id;
mode->name = g_strndup (drm_mode->name, DRM_DISPLAY_MODE_LEN);
mode->width = drm_mode->hdisplay;
mode->height = drm_mode->vdisplay;
mode->flags = drm_mode->flags;
/* Calculate refresh rate in milliHz first for extra precision. */
mode->refresh_rate = (drm_mode->clock * 1000000LL) / drm_mode->htotal;
mode->refresh_rate += (drm_mode->vtotal / 2);
mode->refresh_rate /= drm_mode->vtotal;
if (drm_mode->flags & DRM_MODE_FLAG_INTERLACE)
mode->refresh_rate *= 2;
if (drm_mode->flags & DRM_MODE_FLAG_DBLSCAN)
mode->refresh_rate /= 2;
if (drm_mode->vscan > 1)
mode->refresh_rate /= drm_mode->vscan;
mode->refresh_rate /= 1000.0;
mode->driver_private = g_slice_dup (drmModeModeInfo, drm_mode);
mode->driver_notify = (GDestroyNotify)meta_monitor_mode_destroy_notify;
}
static MetaOutput *
find_output_by_id (MetaOutput *outputs,
unsigned n_outputs,
@@ -580,342 +610,250 @@ init_crtc_rotations (MetaMonitorManager *manager,
}
static void
meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
init_crtc (MetaCRTC *crtc,
MetaMonitorManager *manager,
drmModeCrtc *drm_crtc)
{
unsigned int i;
crtc->crtc_id = drm_crtc->crtc_id;
crtc->rect.x = drm_crtc->x;
crtc->rect.y = drm_crtc->y;
crtc->rect.width = drm_crtc->width;
crtc->rect.height = drm_crtc->height;
crtc->is_dirty = FALSE;
crtc->transform = META_MONITOR_TRANSFORM_NORMAL;
/* FIXME: implement! */
crtc->all_transforms = 1 << META_MONITOR_TRANSFORM_NORMAL;
if (drm_crtc->mode_valid)
{
for (i = 0; i < manager->n_modes; i++)
{
if (drm_mode_equal (&drm_crtc->mode, manager->modes[i].driver_private))
{
crtc->current_mode = &manager->modes[i];
break;
}
}
}
crtc->driver_private = g_new0 (MetaCRTCKms, 1);
crtc->driver_notify = (GDestroyNotify) meta_crtc_destroy_notify;
}
static void
init_output (MetaOutput *output,
MetaMonitorManager *manager,
drmModeConnector *connector,
MetaOutput *old_output)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
drmModeRes *resources;
drmModeEncoder **encoders;
GHashTable *modes;
GHashTableIter iter;
drmModeModeInfo *mode;
unsigned int i, j, k;
unsigned int n_actual_outputs;
int width, height;
MetaOutput *old_outputs;
unsigned int n_old_outputs;
MetaOutputKms *output_kms;
GArray *crtcs;
GBytes *edid;
unsigned int i;
unsigned int crtc_mask;
resources = drmModeGetResources(manager_kms->fd);
modes = g_hash_table_new (drm_mode_hash, drm_mode_equal);
output_kms = g_slice_new0 (MetaOutputKms);
output->driver_private = output_kms;
output->driver_notify = (GDestroyNotify)meta_output_destroy_notify;
manager->max_screen_width = resources->max_width;
manager->max_screen_height = resources->max_height;
output->winsys_id = connector->connector_id;
output->name = make_output_name (connector);
output->width_mm = connector->mmWidth;
output->height_mm = connector->mmHeight;
manager->power_save_mode = META_POWER_SAVE_ON;
old_outputs = manager->outputs;
n_old_outputs = manager->n_outputs;
/* Note: we must not free the public structures (output, crtc, monitor
mode and monitor info) here, they must be kept alive until the API
users are done with them after we emit monitors-changed, and thus
are freed by the platform-independent layer. */
free_resources (manager_kms);
manager_kms->n_connectors = resources->count_connectors;
manager_kms->connectors = g_new (drmModeConnector *, manager_kms->n_connectors);
for (i = 0; i < manager_kms->n_connectors; i++)
switch (connector->subpixel)
{
drmModeConnector *connector;
case DRM_MODE_SUBPIXEL_NONE:
output->subpixel_order = COGL_SUBPIXEL_ORDER_NONE;
break;
case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_RGB;
break;
case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_BGR;
break;
case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_RGB;
break;
case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_BGR;
break;
case DRM_MODE_SUBPIXEL_UNKNOWN:
default:
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
break;
}
connector = drmModeGetConnector (manager_kms->fd, resources->connectors[i]);
manager_kms->connectors[i] = connector;
output->preferred_mode = NULL;
output->n_modes = connector->count_modes;
output->modes = g_new0 (MetaMonitorMode *, output->n_modes);
for (i = 0; i < output->n_modes; i++) {
output->modes[i] = find_meta_mode (manager, &connector->modes[i]);
if (connector->modes[i].type & DRM_MODE_TYPE_PREFERRED)
output->preferred_mode = output->modes[i];
}
if (connector && connector->connection == DRM_MODE_CONNECTED)
if (!output->preferred_mode)
output->preferred_mode = output->modes[0];
output_kms->connector = connector;
output_kms->n_encoders = connector->count_encoders;
output_kms->encoders = g_new0 (drmModeEncoderPtr, output_kms->n_encoders);
crtc_mask = ~(unsigned int) 0;
for (i = 0; i < output_kms->n_encoders; i++)
{
output_kms->encoders[i] = drmModeGetEncoder (manager_kms->fd,
connector->encoders[i]);
if (!output_kms->encoders[i])
continue;
/* We only list CRTCs as supported if they are supported by all encoders
for this connectors.
This is what xf86-video-modesetting does (see drmmode_output_init())
*/
crtc_mask &= output_kms->encoders[i]->possible_crtcs;
if (output_kms->encoders[i]->encoder_id == connector->encoder_id)
output_kms->current_encoder = output_kms->encoders[i];
}
crtcs = g_array_new (FALSE, FALSE, sizeof (MetaCRTC*));
for (i = 0; i < manager->n_crtcs; i++)
{
if (crtc_mask & (1 << i))
{
/* Collect all modes for this connector */
for (j = 0; j < (unsigned)connector->count_modes; j++)
g_hash_table_add (modes, &connector->modes[j]);
MetaCRTC *crtc = &manager->crtcs[i];
g_array_append_val (crtcs, crtc);
}
}
encoders = g_new (drmModeEncoder *, resources->count_encoders);
for (i = 0; i < (unsigned)resources->count_encoders; i++)
output->n_possible_crtcs = crtcs->len;
output->possible_crtcs = (void*)g_array_free (crtcs, FALSE);
if (output_kms->current_encoder && output_kms->current_encoder->crtc_id != 0)
{
for (i = 0; i < manager->n_crtcs; i++)
{
if (manager->crtcs[i].crtc_id == output_kms->current_encoder->crtc_id)
{
output->crtc = &manager->crtcs[i];
break;
}
}
}
else
{
output->crtc = NULL;
}
if (old_output)
{
output->is_primary = old_output->is_primary;
output->is_presentation = old_output->is_presentation;
}
else
{
output->is_primary = FALSE;
output->is_presentation = FALSE;
}
find_connector_properties (manager_kms, output_kms);
output->suggested_x = output_kms->suggested_x;
output->suggested_y = output_kms->suggested_y;
output->hotplug_mode_update = output_kms->hotplug_mode_update;
edid = read_output_edid (manager_kms, output);
meta_output_parse_edid (output, edid);
g_bytes_unref (edid);
/* MetaConnectorType matches DRM's connector types */
output->connector_type = (MetaConnectorType) connector->connector_type;
output->scale = get_output_scale (manager, output);
output_get_tile_info (manager_kms, output);
/* FIXME: backlight is a very driver specific thing unfortunately,
every DDX does its own thing, and the dumb KMS API does not include it.
For example, xf86-video-intel has a list of paths to probe in /sys/class/backlight
(one for each major HW maker, and then some).
We can't do the same because we're not root.
It might be best to leave backlight out of the story and rely on the setuid
helper in gnome-settings-daemon.
*/
output->backlight_min = 0;
output->backlight_max = 0;
output->backlight = -1;
}
static void
detect_and_setup_output_clones (MetaMonitorManager *manager,
drmModeRes *resources)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
drmModeEncoder **encoders;
unsigned int i, n_encoders;
n_encoders = (unsigned int) resources->count_encoders;
encoders = g_new (drmModeEncoder *, n_encoders);
for (i = 0; i < n_encoders; i++)
encoders[i] = drmModeGetEncoder (manager_kms->fd, resources->encoders[i]);
manager->n_modes = g_hash_table_size (modes);
manager->modes = g_new0 (MetaMonitorMode, manager->n_modes);
g_hash_table_iter_init (&iter, modes);
i = 0;
while (g_hash_table_iter_next (&iter, NULL, (gpointer)&mode))
{
MetaMonitorMode *meta_mode;
meta_mode = &manager->modes[i];
meta_mode->mode_id = i;
meta_mode->name = g_strndup (mode->name, DRM_DISPLAY_MODE_LEN);
meta_mode->width = mode->hdisplay;
meta_mode->height = mode->vdisplay;
meta_mode->flags = mode->flags;
/* 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;
i++;
}
g_hash_table_destroy (modes);
manager->n_crtcs = resources->count_crtcs;
manager->crtcs = g_new0 (MetaCRTC, manager->n_crtcs);
width = 0; height = 0;
for (i = 0; i < (unsigned)resources->count_crtcs; i++)
{
drmModeCrtc *crtc;
MetaCRTC *meta_crtc;
crtc = drmModeGetCrtc (manager_kms->fd, resources->crtcs[i]);
meta_crtc = &manager->crtcs[i];
meta_crtc->crtc_id = crtc->crtc_id;
meta_crtc->rect.x = crtc->x;
meta_crtc->rect.y = crtc->y;
meta_crtc->rect.width = crtc->width;
meta_crtc->rect.height = crtc->height;
meta_crtc->is_dirty = FALSE;
meta_crtc->transform = META_MONITOR_TRANSFORM_NORMAL;
/* FIXME: implement! */
meta_crtc->all_transforms = 1 << META_MONITOR_TRANSFORM_NORMAL;
if (crtc->mode_valid)
{
for (j = 0; j < manager->n_modes; j++)
{
if (drm_mode_equal (&crtc->mode, manager->modes[j].driver_private))
{
meta_crtc->current_mode = &manager->modes[j];
break;
}
}
width = MAX (width, meta_crtc->rect.x + meta_crtc->rect.width);
height = MAX (height, meta_crtc->rect.y + meta_crtc->rect.height);
}
meta_crtc->driver_private = g_new0 (MetaCRTCKms, 1);
meta_crtc->driver_notify = (GDestroyNotify) meta_crtc_destroy_notify;
find_crtc_properties (manager_kms, meta_crtc);
init_crtc_rotations (manager, meta_crtc, i);
drmModeFreeCrtc (crtc);
}
manager->screen_width = width;
manager->screen_height = height;
manager->outputs = g_new0 (MetaOutput, manager_kms->n_connectors);
n_actual_outputs = 0;
for (i = 0; i < manager_kms->n_connectors; i++)
{
MetaOutput *meta_output, *old_output;
MetaOutputKms *output_kms;
drmModeConnector *connector;
GArray *crtcs;
unsigned int crtc_mask;
GBytes *edid;
connector = manager_kms->connectors[i];
meta_output = &manager->outputs[n_actual_outputs];
if (connector && connector->connection == DRM_MODE_CONNECTED)
{
meta_output->driver_private = output_kms = g_slice_new0 (MetaOutputKms);
meta_output->driver_notify = (GDestroyNotify)meta_output_destroy_notify;
meta_output->winsys_id = connector->connector_id;
meta_output->name = make_output_name (connector);
meta_output->width_mm = connector->mmWidth;
meta_output->height_mm = connector->mmHeight;
switch (connector->subpixel)
{
case DRM_MODE_SUBPIXEL_NONE:
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_NONE;
break;
case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_RGB;
break;
case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_BGR;
break;
case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_RGB;
break;
case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_BGR;
break;
case DRM_MODE_SUBPIXEL_UNKNOWN:
default:
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
break;
}
meta_output->preferred_mode = NULL;
meta_output->n_modes = connector->count_modes;
meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
for (j = 0; j < meta_output->n_modes; j++) {
meta_output->modes[j] = find_meta_mode (manager, &connector->modes[j]);
if (connector->modes[j].type & DRM_MODE_TYPE_PREFERRED)
meta_output->preferred_mode = meta_output->modes[j];
}
if (!meta_output->preferred_mode)
meta_output->preferred_mode = meta_output->modes[0];
output_kms->connector = connector;
output_kms->n_encoders = connector->count_encoders;
output_kms->encoders = g_new0 (drmModeEncoderPtr, output_kms->n_encoders);
crtc_mask = ~(unsigned int)0;
for (j = 0; j < output_kms->n_encoders; j++)
{
output_kms->encoders[j] = drmModeGetEncoder (manager_kms->fd, connector->encoders[j]);
if (!output_kms->encoders[j])
continue;
/* We only list CRTCs as supported if they are supported by all encoders
for this connectors.
This is what xf86-video-modesetting does (see drmmode_output_init())
*/
crtc_mask &= output_kms->encoders[j]->possible_crtcs;
if (output_kms->encoders[j]->encoder_id == connector->encoder_id)
output_kms->current_encoder = output_kms->encoders[j];
}
crtcs = g_array_new (FALSE, FALSE, sizeof (MetaCRTC*));
for (j = 0; j < manager->n_crtcs; j++)
{
if (crtc_mask & (1 << j))
{
MetaCRTC *crtc = &manager->crtcs[j];
g_array_append_val (crtcs, crtc);
}
}
meta_output->n_possible_crtcs = crtcs->len;
meta_output->possible_crtcs = (void*)g_array_free (crtcs, FALSE);
if (output_kms->current_encoder && output_kms->current_encoder->crtc_id != 0)
{
for (j = 0; j < manager->n_crtcs; j++)
{
if (manager->crtcs[j].crtc_id == output_kms->current_encoder->crtc_id)
{
meta_output->crtc = &manager->crtcs[j];
break;
}
}
}
else
meta_output->crtc = NULL;
old_output = find_output_by_id (old_outputs, n_old_outputs,
meta_output->winsys_id);
if (old_output)
{
meta_output->is_primary = old_output->is_primary;
meta_output->is_presentation = old_output->is_presentation;
}
else
{
meta_output->is_primary = FALSE;
meta_output->is_presentation = FALSE;
}
find_connector_properties (manager_kms, output_kms);
meta_output->suggested_x = output_kms->suggested_x;
meta_output->suggested_y = output_kms->suggested_y;
meta_output->hotplug_mode_update = output_kms->hotplug_mode_update;
edid = read_output_edid (manager_kms, meta_output);
meta_output_parse_edid (meta_output, edid);
g_bytes_unref (edid);
/* MetaConnectorType matches DRM's connector types */
meta_output->connector_type = (MetaConnectorType) connector->connector_type;
meta_output->scale = get_output_scale (manager, meta_output);
output_get_tile_info (manager_kms, meta_output);
/* FIXME: backlight is a very driver specific thing unfortunately,
every DDX does its own thing, and the dumb KMS API does not include it.
For example, xf86-video-intel has a list of paths to probe in /sys/class/backlight
(one for each major HW maker, and then some).
We can't do the same because we're not root.
It might be best to leave backlight out of the story and rely on the setuid
helper in gnome-settings-daemon.
*/
meta_output->backlight_min = 0;
meta_output->backlight_max = 0;
meta_output->backlight = -1;
n_actual_outputs++;
}
}
manager->n_outputs = n_actual_outputs;
manager->outputs = g_renew (MetaOutput, manager->outputs, manager->n_outputs);
/* Sort the outputs for easier handling in MetaMonitorConfig */
qsort (manager->outputs, manager->n_outputs, sizeof (MetaOutput), compare_outputs);
/* Now fix the clones.
Code mostly inspired by xf86-video-modesetting. */
/* XXX: intel hardware doesn't usually have clones, but I only have laptops with
intel cards, so this code was never tested! */
/*
* Setup encoder position mask and encoder clone mask.
*/
for (i = 0; i < manager->n_outputs; i++)
{
MetaOutput *meta_output;
MetaOutput *output;
MetaOutputKms *output_kms;
unsigned int j;
meta_output = &manager->outputs[i];
output_kms = meta_output->driver_private;
output = &manager->outputs[i];
output_kms = output->driver_private;
output_kms->enc_clone_mask = 0xff;
output_kms->encoder_mask = 0;
for (j = 0; j < output_kms->n_encoders; j++)
{
for (k = 0; k < (unsigned)resources->count_encoders; k++)
{
{
unsigned int k;
for (k = 0; k < n_encoders; k++)
{
if (output_kms->encoders[j] && encoders[k] &&
output_kms->encoders[j]->encoder_id == encoders[k]->encoder_id)
{
{
output_kms->encoder_mask |= (1 << k);
break;
}
}
break;
}
}
output_kms->enc_clone_mask &= output_kms->encoders[j]->possible_clones;
}
}
}
for (i = 0; i < (unsigned)resources->count_encoders; i++)
drmModeFreeEncoder (encoders[i]);
g_free (encoders);
/*
* Setup MetaOutput <-> MetaOutput clone associations.
*/
for (i = 0; i < manager->n_outputs; i++)
{
MetaOutput *meta_output;
MetaOutput *output;
MetaOutputKms *output_kms;
unsigned int j;
meta_output = &manager->outputs[i];
output_kms = meta_output->driver_private;
output = &manager->outputs[i];
output_kms = output->driver_private;
if (output_kms->enc_clone_mask == 0)
continue;
@@ -928,7 +866,7 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
meta_clone = &manager->outputs[i];
clone_kms = meta_clone->driver_private;
if (meta_clone == meta_output)
if (meta_clone == output)
continue;
if (clone_kms->encoder_mask == 0)
@@ -936,18 +874,198 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
if (clone_kms->encoder_mask == output_kms->enc_clone_mask)
{
meta_output->n_possible_clones++;
meta_output->possible_clones = g_renew (MetaOutput *,
meta_output->possible_clones,
meta_output->n_possible_clones);
meta_output->possible_clones[meta_output->n_possible_clones - 1] = meta_clone;
output->n_possible_clones++;
output->possible_clones = g_renew (MetaOutput *,
output->possible_clones,
output->n_possible_clones);
output->possible_clones[output->n_possible_clones - 1] = meta_clone;
}
}
}
}
for (i = 0; i < (unsigned)resources->count_encoders; i++)
drmModeFreeEncoder (encoders[i]);
g_free (encoders);
static void
init_connectors (MetaMonitorManager *manager,
drmModeRes *resources)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
unsigned int i;
manager_kms->n_connectors = resources->count_connectors;
manager_kms->connectors = g_new (drmModeConnector *, manager_kms->n_connectors);
for (i = 0; i < manager_kms->n_connectors; i++)
{
drmModeConnector *drm_connector;
drm_connector = drmModeGetConnector (manager_kms->fd,
resources->connectors[i]);
manager_kms->connectors[i] = drm_connector;
}
}
static void
init_modes (MetaMonitorManager *manager,
drmModeRes *resources)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
GHashTable *modes;
GHashTableIter iter;
drmModeModeInfo *drm_mode;
unsigned int i;
long mode_id;
/*
* Gather all modes on all connected connectors.
*/
modes = g_hash_table_new (drm_mode_hash, drm_mode_equal);
for (i = 0; i < manager_kms->n_connectors; i++)
{
drmModeConnector *drm_connector;
drm_connector = manager_kms->connectors[i];
if (drm_connector && drm_connector->connection == DRM_MODE_CONNECTED)
{
unsigned int j;
for (j = 0; j < (unsigned int) drm_connector->count_modes; j++)
g_hash_table_add (modes, &drm_connector->modes[j]);
}
}
manager->n_modes = g_hash_table_size (modes);
manager->modes = g_new0 (MetaMonitorMode, manager->n_modes);
g_hash_table_iter_init (&iter, modes);
mode_id = 0;
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &drm_mode))
{
MetaMonitorMode *mode;
mode = &manager->modes[mode_id];
init_mode (mode, drm_mode, (long) mode_id);
mode_id++;
}
g_hash_table_destroy (modes);
}
static void
init_crtcs (MetaMonitorManager *manager,
drmModeRes *resources)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
unsigned int i;
manager->n_crtcs = resources->count_crtcs;
manager->crtcs = g_new0 (MetaCRTC, manager->n_crtcs);
for (i = 0; i < (unsigned)resources->count_crtcs; i++)
{
drmModeCrtc *drm_crtc;
MetaCRTC *crtc;
drm_crtc = drmModeGetCrtc (manager_kms->fd, resources->crtcs[i]);
crtc = &manager->crtcs[i];
init_crtc (crtc, manager, drm_crtc);
find_crtc_properties (manager_kms, crtc);
init_crtc_rotations (manager, crtc, i);
drmModeFreeCrtc (drm_crtc);
}
}
static void
init_outputs (MetaMonitorManager *manager,
drmModeRes *resources)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
MetaOutput *old_outputs;
unsigned int n_old_outputs;
unsigned int n_actual_outputs;
unsigned int i;
old_outputs = manager->outputs;
n_old_outputs = manager->n_outputs;
manager->outputs = g_new0 (MetaOutput, manager_kms->n_connectors);
n_actual_outputs = 0;
for (i = 0; i < manager_kms->n_connectors; i++)
{
drmModeConnector *connector;
MetaOutput *output;
connector = manager_kms->connectors[i];
output = &manager->outputs[n_actual_outputs];
if (connector && connector->connection == DRM_MODE_CONNECTED)
{
MetaOutput *old_output;
old_output = find_output_by_id (old_outputs, n_old_outputs,
output->winsys_id);
init_output (output, manager, connector, old_output);
n_actual_outputs++;
}
}
manager->n_outputs = n_actual_outputs;
manager->outputs = g_renew (MetaOutput, manager->outputs, manager->n_outputs);
/* Sort the outputs for easier handling in MetaMonitorConfig */
qsort (manager->outputs, manager->n_outputs, sizeof (MetaOutput),
compare_outputs);
detect_and_setup_output_clones (manager, resources);
}
static void
calculate_screen_size (MetaMonitorManager *manager)
{
unsigned int i;
int width = 0, height = 0;
for (i = 0; i < manager->n_crtcs; i++)
{
MetaCRTC *crtc = &manager->crtcs[i];
width = MAX (width, crtc->rect.x + crtc->rect.width);
height = MAX (height, crtc->rect.y + crtc->rect.height);
}
manager->screen_width = width;
manager->screen_height = height;
}
static void
meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
drmModeRes *resources;
resources = drmModeGetResources(manager_kms->fd);
/* TODO: max screen width only matters for stage views is not enabled. */
manager->max_screen_width = resources->max_width;
manager->max_screen_height = resources->max_height;
manager->power_save_mode = META_POWER_SAVE_ON;
/* Note: we must not free the public structures (output, crtc, monitor
mode and monitor info) here, they must be kept alive until the API
users are done with them after we emit monitors-changed, and thus
are freed by the platform-independent layer. */
free_resources (manager_kms);
init_connectors (manager, resources);
init_modes (manager, resources);
init_crtcs (manager, resources);
init_outputs (manager, resources);
calculate_screen_size (manager);
drmModeFreeResources (resources);
}
@@ -1085,14 +1203,6 @@ meta_monitor_manager_kms_apply_configuration (MetaMonitorManager *manager,
mode = crtc_info->mode;
for (j = 0; j < crtc_info->outputs->len; j++)
{
MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
output->is_dirty = TRUE;
output->crtc = crtc;
}
if (meta_monitor_transform_is_rotated (crtc_info->transform))
{
width = mode->height;
@@ -1113,6 +1223,15 @@ meta_monitor_manager_kms_apply_configuration (MetaMonitorManager *manager,
crtc->rect.height = height;
crtc->current_mode = mode;
crtc->transform = crtc_info->transform;
for (j = 0; j < crtc_info->outputs->len; j++)
{
MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
output->is_dirty = TRUE;
output->crtc = crtc;
output->scale = get_output_scale (manager, output);
}
}
if (crtc->all_transforms & (1 << crtc->transform))

View File

@@ -817,7 +817,8 @@ meta_backend_x11_update_screen_size (MetaBackend *backend,
ClutterActor *stage = meta_backend_get_stage (backend);
MetaRenderer *renderer = meta_backend_get_renderer (backend);
meta_renderer_rebuild_views (renderer);
if (meta_is_stage_views_enabled ())
meta_renderer_rebuild_views (renderer);
clutter_actor_set_size (stage, width, height);
}
else

View File

@@ -31,10 +31,28 @@
#include <X11/Xatom.h>
#include <X11/extensions/XInput2.h>
#include <X11/XKBlib.h>
#ifdef HAVE_LIBGUDEV
#include <gudev/gudev.h>
#endif
#include <meta/errors.h>
G_DEFINE_TYPE (MetaInputSettingsX11, meta_input_settings_x11, META_TYPE_INPUT_SETTINGS)
typedef struct _MetaInputSettingsX11Private
{
#ifdef HAVE_LIBGUDEV
GUdevClient *udev_client;
#endif
} MetaInputSettingsX11Private;
G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettingsX11, meta_input_settings_x11,
META_TYPE_INPUT_SETTINGS)
enum {
SCROLL_METHOD_FIELD_2FG,
SCROLL_METHOD_FIELD_EDGE,
SCROLL_METHOD_FIELD_BUTTON,
SCROLL_METHOD_NUM_FIELDS
};
static void *
get_property (ClutterInputDevice *device,
@@ -203,31 +221,79 @@ 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 values[SCROLL_METHOD_NUM_FIELDS] = { 0 }; /* 2fg, edge, button. The last value is unused */
guchar *defaults;
guchar *available;
available = get_property (device, "libinput Scroll Methods Available",
XA_INTEGER, 8, 3);
if (!available)
return;
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
defaults = get_property (device, "libinput Scroll Method Enabled",
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
if (!available || !defaults)
goto out;
if (available[0])
memcpy (values, defaults, SCROLL_METHOD_NUM_FIELDS);
/* Don't set edge scrolling if two-finger scrolling is enabled and available */
if (available[SCROLL_METHOD_FIELD_EDGE] &&
!(available[SCROLL_METHOD_FIELD_2FG] && values[SCROLL_METHOD_FIELD_2FG]))
{
values[0] = 1;
}
else if (available[1] && edge_scroll_enabled)
{
values[1] = 1;
}
else
{
/* Disabled */
values[1] = !!edge_scroll_enabled;
change_property (device, "libinput Scroll Method Enabled",
XA_INTEGER, 8, &values, SCROLL_METHOD_NUM_FIELDS);
}
change_property (device, "libinput Scroll Method Enabled",
XA_INTEGER, 8, &values, 3);
out:
if (available)
meta_XFree (available);
if (defaults)
meta_XFree (defaults);
}
meta_XFree (available);
static void
meta_input_settings_x11_set_two_finger_scroll (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean two_finger_scroll_enabled)
{
guchar values[SCROLL_METHOD_NUM_FIELDS] = { 0 }; /* 2fg, edge, button. The last value is unused */
guchar *defaults;
guchar *available;
gboolean changed;
available = get_property (device, "libinput Scroll Methods Available",
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
defaults = get_property (device, "libinput Scroll Method Enabled",
XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS);
if (!available || !defaults)
goto out;
memcpy (values, defaults, SCROLL_METHOD_NUM_FIELDS);
changed = FALSE;
if (available[SCROLL_METHOD_FIELD_2FG])
{
values[SCROLL_METHOD_FIELD_2FG] = !!two_finger_scroll_enabled;
changed = TRUE;
}
/* Disable edge scrolling when two-finger scrolling is enabled */
if (values[SCROLL_METHOD_FIELD_2FG] && values[SCROLL_METHOD_FIELD_EDGE])
{
values[SCROLL_METHOD_FIELD_EDGE] = 0;
changed = TRUE;
}
if (changed)
{
change_property (device, "libinput Scroll Method Enabled",
XA_INTEGER, 8, &values, SCROLL_METHOD_NUM_FIELDS);
}
out:
if (available)
meta_XFree (available);
if (defaults)
meta_XFree (defaults);
}
static void
@@ -305,6 +371,135 @@ meta_input_settings_x11_set_keyboard_repeat (MetaInputSettings *settings,
}
}
static gboolean
has_udev_property (MetaInputSettings *settings,
ClutterInputDevice *device,
const char *property_name)
{
#ifdef HAVE_LIBGUDEV
MetaInputSettingsX11 *settings_x11 = META_INPUT_SETTINGS_X11 (settings);
MetaInputSettingsX11Private *priv =
meta_input_settings_x11_get_instance_private (settings_x11);
const char *device_node;
GUdevDevice *udev_device = NULL;
GUdevDevice *parent_udev_device = NULL;
device_node = clutter_input_device_get_device_node (device);
if (!device_node)
return FALSE;
udev_device = g_udev_client_query_by_device_file (priv->udev_client,
device_node);
if (!udev_device)
return FALSE;
if (NULL != g_udev_device_get_property (udev_device, property_name))
{
g_object_unref (udev_device);
return TRUE;
}
parent_udev_device = g_udev_device_get_parent (udev_device);
g_object_unref (udev_device);
if (!parent_udev_device)
return FALSE;
if (NULL != g_udev_device_get_property (parent_udev_device, property_name))
{
g_object_unref (parent_udev_device);
return TRUE;
}
g_object_unref (parent_udev_device);
return FALSE;
#else
g_warning ("Failed to set acceleration profile: no udev support");
return FALSE;
#endif
}
static gboolean
is_mouse (MetaInputSettings *settings,
ClutterInputDevice *device)
{
return (has_udev_property (settings, device, "ID_INPUT_MOUSE") &&
!has_udev_property (settings, device, "ID_INPUT_POINTINGSTICK"));
}
static gboolean
is_trackball (MetaInputSettings *settings,
ClutterInputDevice *device)
{
return meta_input_device_is_trackball (device);
}
static void
set_device_accel_profile (ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
guchar *defaults, *available;
guchar values[2] = { 0 }; /* adaptive, flat */
defaults = get_property (device, "libinput Accel Profile Enabled Default",
XA_INTEGER, 8, 2);
if (!defaults)
return;
available = get_property (device, "libinput Accel Profiles Available",
XA_INTEGER, 8, 2);
if (!available)
goto err_available;
switch (profile)
{
case G_DESKTOP_POINTER_ACCEL_PROFILE_FLAT:
values[0] = 0;
values[1] = 1;
break;
case G_DESKTOP_POINTER_ACCEL_PROFILE_ADAPTIVE:
values[0] = 1;
values[1] = 0;
break;
default:
g_warn_if_reached ();
case G_DESKTOP_POINTER_ACCEL_PROFILE_DEFAULT:
values[0] = defaults[0];
values[1] = defaults[1];
break;
}
change_property (device, "libinput Accel Profile Enabled",
XA_INTEGER, 8, &values, 2);
meta_XFree (available);
err_available:
meta_XFree (defaults);
}
static void
meta_input_settings_x11_set_mouse_accel_profile (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
if (!is_mouse (settings, device))
return;
set_device_accel_profile (device, profile);
}
static void
meta_input_settings_x11_set_trackball_accel_profile (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile)
{
if (!is_trackball (settings, device))
return;
set_device_accel_profile (device, profile);
}
static void
meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
ClutterInputDevice *device,
@@ -330,11 +525,28 @@ meta_input_settings_x11_set_tablet_area (MetaInputSettings *settings,
{
}
static void
meta_input_settings_x11_dispose (GObject *object)
{
#ifdef HAVE_LIBGUDEV
MetaInputSettingsX11 *settings_x11 = META_INPUT_SETTINGS_X11 (object);
MetaInputSettingsX11Private *priv =
meta_input_settings_x11_get_instance_private (settings_x11);
g_clear_object (&priv->udev_client);
#endif
G_OBJECT_CLASS (meta_input_settings_x11_parent_class)->dispose (object);
}
static void
meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaInputSettingsClass *input_settings_class = META_INPUT_SETTINGS_CLASS (klass);
object_class->dispose = meta_input_settings_x11_dispose;
input_settings_class->set_send_events = meta_input_settings_x11_set_send_events;
input_settings_class->set_matrix = meta_input_settings_x11_set_matrix;
input_settings_class->set_speed = meta_input_settings_x11_set_speed;
@@ -342,6 +554,7 @@ meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
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_edge_scroll = meta_input_settings_x11_set_edge_scroll;
input_settings_class->set_two_finger_scroll = meta_input_settings_x11_set_two_finger_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;
@@ -349,9 +562,19 @@ meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
input_settings_class->set_tablet_mapping = meta_input_settings_x11_set_tablet_mapping;
input_settings_class->set_tablet_keep_aspect = meta_input_settings_x11_set_tablet_keep_aspect;
input_settings_class->set_tablet_area = meta_input_settings_x11_set_tablet_area;
input_settings_class->set_mouse_accel_profile = meta_input_settings_x11_set_mouse_accel_profile;
input_settings_class->set_trackball_accel_profile = meta_input_settings_x11_set_trackball_accel_profile;
}
static void
meta_input_settings_x11_init (MetaInputSettingsX11 *settings)
{
#ifdef HAVE_LIBGUDEV
MetaInputSettingsX11Private *priv =
meta_input_settings_x11_get_instance_private (settings);
const char *subsystems[] = { NULL };
priv->udev_client = g_udev_client_new (subsystems);
#endif
}

View File

@@ -78,6 +78,7 @@ meta_renderer_x11_create_view (MetaRenderer *renderer,
int width, height;
CoglTexture2D *texture_2d;
CoglOffscreen *offscreen;
GError *error = NULL;
g_assert (meta_is_wayland_compositor ());
@@ -86,6 +87,9 @@ meta_renderer_x11_create_view (MetaRenderer *renderer,
texture_2d = cogl_texture_2d_new_with_size (cogl_context, width, height);
offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (texture_2d));
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (offscreen), &error))
meta_fatal ("Couldn't allocate framebuffer: %s", error->message);
return g_object_new (META_TYPE_RENDERER_VIEW,
"layout", &monitor_info->rect,
"framebuffer", COGL_FRAMEBUFFER (offscreen),

View File

@@ -66,7 +66,10 @@ meta_stage_x11_nested_get_views (ClutterStageWindow *stage_window)
MetaBackend *backend = meta_get_backend ();
MetaRenderer *renderer = meta_backend_get_renderer (backend);
return meta_renderer_get_views (renderer);
if (meta_is_stage_views_enabled ())
return meta_renderer_get_views (renderer);
else
return clutter_stage_window_parent_iface->get_views (stage_window);
}
static void
@@ -80,6 +83,12 @@ meta_stage_x11_nested_finish_frame (ClutterStageWindow *stage_window)
CoglFramebuffer *onscreen = COGL_FRAMEBUFFER (stage_x11->onscreen);
GList *l;
/*
* If we are in legacy mode, the stage is already on the onscreen.
*/
if (!meta_is_stage_views_enabled ())
return;
if (!stage_nested->pipeline)
stage_nested->pipeline = cogl_pipeline_new (clutter_backend->cogl_context);

View File

@@ -299,7 +299,7 @@ struct _MetaPluginVersion
GType meta_plugin_register_type (GTypeModule *type_module); \
\
GType \
object_name##_get_type () \
object_name##_get_type (void) \
{ \
return g_define_type_id; \
} \

View File

@@ -299,7 +299,8 @@ create_lock_file (int display, int *display_out)
}
static int
bind_to_abstract_socket (int display)
bind_to_abstract_socket (int display,
gboolean *fatal)
{
struct sockaddr_un addr;
socklen_t size, name_size;
@@ -307,7 +308,11 @@ bind_to_abstract_socket (int display)
fd = socket (PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (fd < 0)
return -1;
{
*fatal = TRUE;
g_warning ("Failed to create socket: %m");
return -1;
}
addr.sun_family = AF_LOCAL;
name_size = snprintf (addr.sun_path, sizeof addr.sun_path,
@@ -315,6 +320,7 @@ bind_to_abstract_socket (int display)
size = offsetof (struct sockaddr_un, sun_path) + name_size;
if (bind (fd, (struct sockaddr *) &addr, size) < 0)
{
*fatal = errno != EADDRINUSE;
g_warning ("failed to bind to @%s: %m", addr.sun_path + 1);
close (fd);
return -1;
@@ -322,6 +328,9 @@ bind_to_abstract_socket (int display)
if (listen (fd, 1) < 0)
{
*fatal = errno != EADDRINUSE;
g_warning ("Failed to listen on abstract socket @%s: %m",
addr.sun_path + 1);
close (fd);
return -1;
}
@@ -394,6 +403,7 @@ choose_xdisplay (MetaXWaylandManager *manager)
{
int display = 0;
char *lock_file = NULL;
gboolean fatal = FALSE;
/* Hack to keep the unused Xwayland instance on
* the login screen from taking the prime :0 display
@@ -411,22 +421,25 @@ choose_xdisplay (MetaXWaylandManager *manager)
return FALSE;
}
manager->abstract_fd = bind_to_abstract_socket (display);
manager->abstract_fd = bind_to_abstract_socket (display, &fatal);
if (manager->abstract_fd < 0)
{
unlink (lock_file);
if (errno == EADDRINUSE)
if (!fatal)
{
display++;
continue;
}
else
return FALSE;
{
g_warning ("Failed to bind abstract socket");
return FALSE;
}
}
manager->unix_fd = bind_to_unix_socket (display);
if (manager->abstract_fd < 0)
if (manager->unix_fd < 0)
{
unlink (lock_file);
close (manager->abstract_fd);