Compare commits
69 Commits
wip/carlos
...
gnome-3-24
Author | SHA1 | Date | |
---|---|---|---|
6a3c5dfa42 | |||
208a1adeca | |||
229c148896 | |||
4eb8d71311 | |||
c9c157ed64 | |||
06d56421cb | |||
25f9cdced3 | |||
e82d039ec2 | |||
4c3e166469 | |||
9d0b49439e | |||
eb6f74987e | |||
726296f022 | |||
901490545c | |||
8478d8a002 | |||
81dd9aa1da | |||
5d7b94abb8 | |||
cdb5ead795 | |||
0159efe34b | |||
9f68507f0c | |||
e52408d259 | |||
45014a27a4 | |||
d4e02527d3 | |||
7f594bbe46 | |||
e66091d8aa | |||
d538016ce7 | |||
6d34b2e7dd | |||
f0b758b891 | |||
a150225a59 | |||
2df1bd3dda | |||
c02638e614 | |||
aa45fa1e26 | |||
19f4342b46 | |||
5fc6200375 | |||
8a7b564219 | |||
48d1bf9ea9 | |||
02798ceeb6 | |||
ee07580365 | |||
e22c75377b | |||
0f7c3f3678 | |||
bbed0d8045 | |||
8699aca7d7 | |||
2ec91abf38 | |||
28b2added7 | |||
a8ceceed1a | |||
7801df7ef6 | |||
1b4cd1b47d | |||
7f0f880fba | |||
ca31e4dc14 | |||
dfdc15c72c | |||
3254103d3e | |||
57d07bd38b | |||
a3b4ee5689 | |||
d8adfa9a31 | |||
a6678a262c | |||
317517fcb5 | |||
0f5ac1dc28 | |||
01b6e32e87 | |||
bff311da88 | |||
6883a1f350 | |||
de3a01b5f5 | |||
1ab02344a7 | |||
90633660c7 | |||
0e65bfcd3a | |||
79cf22324d | |||
ebfba766d1 | |||
bb481fafdb | |||
eb394f19d3 | |||
c6d3113416 | |||
196e524703 |
70
NEWS
70
NEWS
@ -1,3 +1,73 @@
|
||||
3.24.4
|
||||
======
|
||||
* Fix wacom cursor offset on wayland [Jason; #784009]
|
||||
* Do not throttle motion events on tablet tools [Carlos; #783535]
|
||||
* Handle left-handed mode on pen/eraser devices [Carlos; #782027]
|
||||
* Fix crash when decreasing number of workspaces [Florian; #784223]
|
||||
* Fix crash when moving across on-adjacent monitors [Jonas; #783630]
|
||||
* Fix window moving/resizing via tablet tools [Jason; #777333]
|
||||
* Improve stability of tablet plugs/unplugs [Carlos; #784881]
|
||||
* Implement tablet rings/strips configuration [Carlos; #782033]
|
||||
* Support tablet wheel events on wayland [Jason; #783716]
|
||||
* Misc. bug fixes [Carlos, Jonas; #784402, #784867, #781723]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Carlos Garnacho, Jason Gerecke, Florian Müllner
|
||||
|
||||
Translations:
|
||||
Jordi Mas [ca]
|
||||
|
||||
3.24.3
|
||||
======
|
||||
* Fix handling of tiled monitors [Jonas; #781723]
|
||||
* Fix swapped red and blue channels in CoglTexture data [Carlos; #779234]
|
||||
* Fix glitches when opening a window maximized [Olivier; #781353, #782183]
|
||||
* Implement support for disable-while-typing option [Evan; #764852]
|
||||
* Consider subsurfaces when grabbing [mindtree; #781811]
|
||||
* Fix handling of left-handed mode on pen/eraser devices [Carlos; #782027]
|
||||
* Fix output cycling in non-display-attached tablets [Carlos; #782032]
|
||||
* Fix wacom cursor offset on wayland [Jason; #784009]
|
||||
* Handle EXIF orientation of backgrounds [Silvère; #783125]
|
||||
* Misc. bug fixes [Jonas, Bastien, Ikey, Carlos; #782156, #780407, #757661,
|
||||
#783113, #781703]
|
||||
|
||||
Contributors:
|
||||
mitchmindtree, Jonas Ådahl, Ikey Doherty, Olivier Fourdan, Carlos Garnacho,
|
||||
Jason Gerecke, Silvère Latchurié, Bastien Nocera, Evan Welsh
|
||||
|
||||
3.24.2
|
||||
======
|
||||
* Don't crash when wayland clients commit to destroyed surfaces [Jonas; #781391]
|
||||
* Fix frame updates on hide-titlebar-when-maximized changes [Florian; #781862]
|
||||
* Fix accessible screen coordinates on X11 [Florian; #781902]
|
||||
* Fix copy+paste of UTF8 strings between X11 and wayland [Carlos; #782472]
|
||||
* Fix non-wayland builds [Chris; #780533]
|
||||
* Misc. bug fixes [Philip, Matthias, Nigel; #781242, #780215, #759085]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Philip Chimento, Carlos Garnacho, Matthias Liertzer,
|
||||
Florian Müllner, Nigel Taylor, Chris Vine
|
||||
|
||||
Translations:
|
||||
Jordi Mas [ca]
|
||||
|
||||
3.24.1
|
||||
======
|
||||
* Always sync window geometry on state changes [Jonas; #780292]
|
||||
* Use EGL instead of GLX when drawing using GLES [Jonas; #771636]
|
||||
* Fix HiDPI detection on vertical monitor layouts [Carlos; #777687]
|
||||
* Get double-click timing from desktop mouse settings [Armin; #771576]
|
||||
* Scale relative motion deltas with monitor scale [Jonas, Carlos; #778119]
|
||||
* Use texture fallback when setting hardware cursor fails [Jente; #770020]
|
||||
* Fix lock-up when using additional theme variants [Shantanu; #780254]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Carlos Garnacho, Shantanu Goel, Jente Hidskes, Armin Krezović,
|
||||
Florian Müllner
|
||||
|
||||
Translations:
|
||||
Yuras Shumovich [be], Yosef Or Boczko [he], Tom Tryfonidis [el]
|
||||
|
||||
3.24.0
|
||||
======
|
||||
|
||||
|
@ -6,7 +6,9 @@ test -z "$srcdir" && srcdir=.
|
||||
|
||||
REQUIRED_AUTOMAKE_VERSION=1.11
|
||||
|
||||
pushd $srcdir
|
||||
olddir="$(pwd)"
|
||||
|
||||
cd "${srcdir}"
|
||||
|
||||
(test -f configure.ac \
|
||||
&& test -d src) || {
|
||||
@ -19,8 +21,8 @@ aclocal --install || exit 1
|
||||
intltoolize --force --copy --automake || exit 1
|
||||
autoreconf --verbose --force --install || exit 1
|
||||
|
||||
popd
|
||||
cd "${olddir}"
|
||||
|
||||
if [ "$NOCONFIGURE" = "" ]; then
|
||||
$srcdir/configure "$@" || exit 1
|
||||
"${srcdir}/configure" "$@" || exit 1
|
||||
fi
|
||||
|
@ -781,7 +781,7 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
"position of the stage");
|
||||
}
|
||||
else
|
||||
#else
|
||||
#endif
|
||||
{
|
||||
static gboolean yet_warned = FALSE;
|
||||
|
||||
@ -793,7 +793,6 @@ _cally_actor_get_top_level_origin (ClutterActor *actor,
|
||||
"atk_component_get_extents() with ATK_XY_SCREEN.");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (xp)
|
||||
*xp = x;
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include "clutter-debug.h"
|
||||
|
||||
/* XXX - keep in sync with the ClutterStaticColor enumeration order */
|
||||
static const ClutterColor const static_colors[] = {
|
||||
static const ClutterColor static_colors[] = {
|
||||
/* CGA/EGA color palette */
|
||||
{ 0xff, 0xff, 0xff, 0xff }, /* white */
|
||||
{ 0x00, 0x00, 0x00, 0xff }, /* black */
|
||||
|
@ -2179,3 +2179,61 @@ clutter_event_get_mode_group (const ClutterEvent *event)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_event_get_pad_event_details:
|
||||
* @event: a pad event
|
||||
* @number: (out) (optional): ring/strip/button number
|
||||
* @mode: (out) (optional): pad mode as per the event
|
||||
* @value: (out) (optional): event axis value
|
||||
*
|
||||
* Returns the details of a pad event.
|
||||
*
|
||||
* Returns: #TRUE if event details could be obtained
|
||||
**/
|
||||
gboolean
|
||||
clutter_event_get_pad_event_details (const ClutterEvent *event,
|
||||
guint *number,
|
||||
guint *mode,
|
||||
gdouble *value)
|
||||
{
|
||||
guint n, m;
|
||||
gdouble v;
|
||||
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
g_return_val_if_fail (event->type == CLUTTER_PAD_BUTTON_PRESS ||
|
||||
event->type == CLUTTER_PAD_BUTTON_RELEASE ||
|
||||
event->type == CLUTTER_PAD_RING ||
|
||||
event->type == CLUTTER_PAD_STRIP, FALSE);
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PAD_BUTTON_PRESS:
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
n = event->pad_button.button;
|
||||
m = event->pad_button.mode;
|
||||
v = 0.0;
|
||||
break;
|
||||
case CLUTTER_PAD_RING:
|
||||
n = event->pad_ring.ring_number;
|
||||
m = event->pad_ring.mode;
|
||||
v = event->pad_ring.angle;
|
||||
break;
|
||||
case CLUTTER_PAD_STRIP:
|
||||
n = event->pad_strip.strip_number;
|
||||
m = event->pad_strip.mode;
|
||||
v = event->pad_strip.value;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (number)
|
||||
*number = n;
|
||||
if (mode)
|
||||
*mode = m;
|
||||
if (value)
|
||||
*value = v;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -778,6 +778,12 @@ ClutterScrollFinishFlags clutter_event_get_scroll_finish_flags (const Clut
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
guint clutter_event_get_mode_group (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_AVAILABLE_IN_MUTTER
|
||||
gboolean clutter_event_get_pad_event_details (const ClutterEvent *event,
|
||||
guint *number,
|
||||
guint *mode,
|
||||
gdouble *value);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -2243,10 +2243,15 @@ clutter_input_device_get_device_node (ClutterInputDevice *device)
|
||||
ClutterInputDeviceMapping
|
||||
clutter_input_device_get_mapping_mode (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDeviceType device_type;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device),
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE);
|
||||
g_return_val_if_fail (clutter_input_device_get_device_type (device) ==
|
||||
CLUTTER_TABLET_DEVICE,
|
||||
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
g_return_val_if_fail (device_type == CLUTTER_TABLET_DEVICE ||
|
||||
device_type == CLUTTER_PEN_DEVICE ||
|
||||
device_type == CLUTTER_ERASER_DEVICE,
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE);
|
||||
|
||||
return device->mapping_mode;
|
||||
@ -2256,9 +2261,14 @@ void
|
||||
clutter_input_device_set_mapping_mode (ClutterInputDevice *device,
|
||||
ClutterInputDeviceMapping mapping)
|
||||
{
|
||||
ClutterInputDeviceType device_type;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
g_return_if_fail (clutter_input_device_get_device_type (device) ==
|
||||
CLUTTER_TABLET_DEVICE);
|
||||
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
g_return_if_fail (device_type == CLUTTER_TABLET_DEVICE ||
|
||||
device_type == CLUTTER_PEN_DEVICE ||
|
||||
device_type == CLUTTER_ERASER_DEVICE);
|
||||
|
||||
if (device->mapping_mode == mapping)
|
||||
return;
|
||||
|
@ -971,6 +971,7 @@ _clutter_stage_process_queued_events (ClutterStage *stage)
|
||||
ClutterEvent *next_event;
|
||||
ClutterInputDevice *device;
|
||||
ClutterInputDevice *next_device;
|
||||
ClutterInputDeviceType device_type;
|
||||
gboolean check_device = FALSE;
|
||||
|
||||
event = l->data;
|
||||
@ -986,8 +987,16 @@ _clutter_stage_process_queued_events (ClutterStage *stage)
|
||||
if (device != NULL && next_device != NULL)
|
||||
check_device = TRUE;
|
||||
|
||||
/* Skip consecutive motion events coming from the same device */
|
||||
if (priv->throttle_motion_events && next_event != NULL)
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
|
||||
/* Skip consecutive motion events coming from the same device,
|
||||
* except those of tablet tools, since users of these events
|
||||
* want no precision loss.
|
||||
*/
|
||||
if (priv->throttle_motion_events && next_event != NULL &&
|
||||
device_type != CLUTTER_TABLET_DEVICE &&
|
||||
device_type != CLUTTER_PEN_DEVICE &&
|
||||
device_type != CLUTTER_ERASER_DEVICE)
|
||||
{
|
||||
if (event->type == CLUTTER_MOTION &&
|
||||
(next_event->type == CLUTTER_MOTION ||
|
||||
|
@ -163,6 +163,9 @@ clutter_input_device_evdev_update_from_tool (ClutterInputDevice *device,
|
||||
if (libinput_tablet_tool_has_slider (evdev_tool->tool))
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_SLIDER, -1, 1, 0);
|
||||
|
||||
if (libinput_tablet_tool_has_wheel (evdev_tool->tool))
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_WHEEL, -180, 180, 0);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (device));
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,14 @@ static const char *clutter_input_axis_atom_names[] = {
|
||||
|
||||
#define N_AXIS_ATOMS G_N_ELEMENTS (clutter_input_axis_atom_names)
|
||||
|
||||
enum {
|
||||
PAD_AXIS_FIRST = 3, /* First axes are always x/y/pressure, ignored in pads */
|
||||
PAD_AXIS_STRIP1 = PAD_AXIS_FIRST,
|
||||
PAD_AXIS_STRIP2,
|
||||
PAD_AXIS_RING1,
|
||||
PAD_AXIS_RING2,
|
||||
};
|
||||
|
||||
static Atom clutter_input_axis_atoms[N_AXIS_ATOMS] = { 0, };
|
||||
|
||||
static void clutter_event_translator_iface_init (ClutterEventTranslatorIface *iface);
|
||||
@ -359,6 +367,36 @@ get_device_node_path (ClutterBackendX11 *backend_x11,
|
||||
return node_path;
|
||||
}
|
||||
|
||||
static void
|
||||
get_pad_features (XIDeviceInfo *info,
|
||||
guint *n_rings,
|
||||
guint *n_strips)
|
||||
{
|
||||
gint i, rings = 0, strips = 0;
|
||||
|
||||
for (i = PAD_AXIS_FIRST; i < info->num_classes; i++)
|
||||
{
|
||||
XIValuatorClassInfo *valuator = (XIValuatorClassInfo*) info->classes[i];
|
||||
int axis = valuator->number;
|
||||
|
||||
if (valuator->type != XIValuatorClass)
|
||||
continue;
|
||||
if (valuator->max <= 1)
|
||||
continue;
|
||||
|
||||
/* Ring/strip axes are fixed in pad devices as handled by the
|
||||
* wacom driver. Match those to detect pad features.
|
||||
*/
|
||||
if (axis == PAD_AXIS_STRIP1 || axis == PAD_AXIS_STRIP2)
|
||||
strips++;
|
||||
else if (axis == PAD_AXIS_RING1 || axis == PAD_AXIS_RING2)
|
||||
rings++;
|
||||
}
|
||||
|
||||
*n_rings = rings;
|
||||
*n_strips = strips;
|
||||
}
|
||||
|
||||
static ClutterInputDevice *
|
||||
create_device (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
ClutterBackendX11 *backend_x11,
|
||||
@ -368,7 +406,7 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
ClutterInputDevice *retval;
|
||||
ClutterInputMode mode;
|
||||
gboolean is_enabled;
|
||||
guint num_touches = 0;
|
||||
guint num_touches = 0, num_rings = 0, num_strips = 0;
|
||||
gchar *vendor_id = NULL, *product_id = NULL, *node_path = NULL;
|
||||
|
||||
if (info->use == XIMasterKeyboard || info->use == XISlaveKeyboard)
|
||||
@ -436,6 +474,12 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
node_path = get_device_node_path (backend_x11, info);
|
||||
}
|
||||
|
||||
if (source == CLUTTER_PAD_DEVICE)
|
||||
{
|
||||
is_enabled = TRUE;
|
||||
get_pad_features (info, &num_rings, &num_strips);
|
||||
}
|
||||
|
||||
retval = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_XI2,
|
||||
"name", info->name,
|
||||
"id", info->deviceid,
|
||||
@ -448,6 +492,8 @@ create_device (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
"vendor-id", vendor_id,
|
||||
"product-id", product_id,
|
||||
"device-node", node_path,
|
||||
"n-rings", num_rings,
|
||||
"n-strips", num_strips,
|
||||
NULL);
|
||||
|
||||
translate_device_classes (backend_x11->xdpy, retval,
|
||||
@ -847,6 +893,54 @@ translate_axes (ClutterInputDevice *device,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
translate_pad_axis (ClutterInputDevice *device,
|
||||
XIValuatorState *valuators,
|
||||
ClutterEventType *evtype,
|
||||
guint *number,
|
||||
gdouble *value)
|
||||
{
|
||||
double *values;
|
||||
gint i;
|
||||
|
||||
values = valuators->values;
|
||||
|
||||
for (i = PAD_AXIS_FIRST; i < valuators->mask_len * 8; i++)
|
||||
{
|
||||
gdouble val;
|
||||
guint axis_number = 0;
|
||||
|
||||
if (!XIMaskIsSet (valuators->mask, i))
|
||||
continue;
|
||||
|
||||
val = *values++;
|
||||
if (val <= 0)
|
||||
continue;
|
||||
|
||||
_clutter_input_device_translate_axis (device, i, val, value);
|
||||
|
||||
if (i == PAD_AXIS_RING1 || i == PAD_AXIS_RING2)
|
||||
{
|
||||
*evtype = CLUTTER_PAD_RING;
|
||||
(*value) *= 360.0;
|
||||
}
|
||||
else if (i == PAD_AXIS_STRIP1 || i == PAD_AXIS_STRIP2)
|
||||
{
|
||||
*evtype = CLUTTER_PAD_STRIP;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
|
||||
if (i == PAD_AXIS_STRIP2 || i == PAD_AXIS_RING2)
|
||||
axis_number++;
|
||||
|
||||
*number = axis_number;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
translate_coords (ClutterStageX11 *stage_x11,
|
||||
gdouble event_x,
|
||||
@ -1025,6 +1119,54 @@ handle_property_event (ClutterDeviceManagerXI2 *manager_xi2,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
translate_pad_event (ClutterEvent *event,
|
||||
XIDeviceEvent *xev,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
gdouble value;
|
||||
guint number;
|
||||
|
||||
if (!translate_pad_axis (device, &xev->valuators,
|
||||
&event->any.type,
|
||||
&number, &value))
|
||||
return FALSE;
|
||||
|
||||
/* When touching a ring/strip a first XI_Motion event
|
||||
* is generated. Use it to reset the pad state, so
|
||||
* later events actually have a directionality.
|
||||
*/
|
||||
if (xev->evtype == XI_Motion)
|
||||
value = -1;
|
||||
|
||||
if (event->any.type == CLUTTER_PAD_RING)
|
||||
{
|
||||
event->pad_ring.ring_number = number;
|
||||
event->pad_ring.angle = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->pad_strip.strip_number = number;
|
||||
event->pad_strip.value = value;
|
||||
}
|
||||
|
||||
event->any.time = xev->time;
|
||||
clutter_event_set_device (event, device);
|
||||
clutter_event_set_source_device (event, device);
|
||||
|
||||
CLUTTER_NOTE (EVENT,
|
||||
"%s: win:0x%x, device:%d '%s', time:%d "
|
||||
"(value:%f)",
|
||||
event->any.type == CLUTTER_PAD_RING
|
||||
? "pad ring "
|
||||
: "pad strip",
|
||||
(unsigned int) xev->event,
|
||||
device->id,
|
||||
device->device_name,
|
||||
event->any.time, value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static ClutterTranslateReturn
|
||||
clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
|
||||
gpointer native,
|
||||
@ -1206,15 +1348,23 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
|
||||
XIAsyncDevice,
|
||||
xev->time);
|
||||
|
||||
/* Ignore 4-7 buttons */
|
||||
if (xev->detail >= 4 && xev->detail <= 7)
|
||||
return CLUTTER_TRANSLATE_REMOVE;
|
||||
event->any.stage = stage;
|
||||
|
||||
event->pad_button.type =
|
||||
if (xev->detail >= 4 && xev->detail <= 7)
|
||||
{
|
||||
retval = CLUTTER_TRANSLATE_REMOVE;
|
||||
|
||||
if (xi_event->evtype == XI_ButtonPress &&
|
||||
translate_pad_event (event, xev, source_device))
|
||||
retval = CLUTTER_TRANSLATE_QUEUE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
event->any.type =
|
||||
(xi_event->evtype == XI_ButtonPress) ? CLUTTER_PAD_BUTTON_PRESS
|
||||
: CLUTTER_PAD_BUTTON_RELEASE;
|
||||
event->pad_button.time = xev->time;
|
||||
event->pad_button.stage = stage;
|
||||
event->any.time = xev->time;
|
||||
|
||||
/* The 4-7 button range is taken as non-existent on pad devices,
|
||||
* let the buttons above that take over this range.
|
||||
@ -1224,6 +1374,7 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
|
||||
|
||||
/* Pad buttons are 0-indexed */
|
||||
event->pad_button.button = xev->detail - 1;
|
||||
clutter_event_set_device (event, device);
|
||||
clutter_event_set_source_device (event, source_device);
|
||||
|
||||
CLUTTER_NOTE (EVENT,
|
||||
@ -1380,6 +1531,15 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
|
||||
device = g_hash_table_lookup (manager_xi2->devices_by_id,
|
||||
GINT_TO_POINTER (xev->deviceid));
|
||||
|
||||
if (clutter_input_device_get_device_type (source_device) == CLUTTER_PAD_DEVICE)
|
||||
{
|
||||
event->any.stage = stage;
|
||||
|
||||
if (translate_pad_event (event, xev, source_device))
|
||||
retval = CLUTTER_TRANSLATE_QUEUE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set the stage for core events coming out of nowhere (see bug #684509) */
|
||||
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER &&
|
||||
clutter_input_device_get_pointer_stage (device) == NULL &&
|
||||
|
@ -350,7 +350,8 @@ actor_replace_child (void)
|
||||
g_assert_cmpstr (clutter_actor_get_name (iter), ==, "qux");
|
||||
|
||||
clutter_actor_add_child (actor, g_object_new (CLUTTER_TYPE_ACTOR,
|
||||
"name", "foo"));
|
||||
"name", "foo",
|
||||
NULL));
|
||||
|
||||
clutter_actor_replace_child (actor, iter,
|
||||
g_object_new (CLUTTER_TYPE_ACTOR,
|
||||
|
@ -198,6 +198,7 @@ struct _CoglTextureDriver
|
||||
CoglPixelFormat
|
||||
(* find_best_gl_get_data_format) (CoglContext *context,
|
||||
CoglPixelFormat format,
|
||||
CoglPixelFormat target_format,
|
||||
GLenum *closest_gl_format,
|
||||
GLenum *closest_gl_type);
|
||||
};
|
||||
|
@ -1059,6 +1059,7 @@ cogl_texture_get_data (CoglTexture *texture,
|
||||
|
||||
closest_format =
|
||||
ctx->texture_driver->find_best_gl_get_data_format (ctx,
|
||||
texture_format,
|
||||
format,
|
||||
&closest_gl_format,
|
||||
&closest_gl_type);
|
||||
|
@ -533,14 +533,16 @@ static CoglPixelFormat
|
||||
_cogl_texture_driver_find_best_gl_get_data_format
|
||||
(CoglContext *context,
|
||||
CoglPixelFormat format,
|
||||
CoglPixelFormat target_format,
|
||||
GLenum *closest_gl_format,
|
||||
GLenum *closest_gl_type)
|
||||
{
|
||||
return context->driver_vtable->pixel_format_to_gl (context,
|
||||
format,
|
||||
NULL, /* don't need */
|
||||
closest_gl_format,
|
||||
closest_gl_type);
|
||||
return context->driver_vtable->pixel_format_to_gl_with_target (context,
|
||||
format,
|
||||
target_format,
|
||||
NULL, /* don't need */
|
||||
closest_gl_format,
|
||||
closest_gl_type);
|
||||
}
|
||||
|
||||
const CoglTextureDriver
|
||||
|
@ -615,6 +615,7 @@ static CoglPixelFormat
|
||||
_cogl_texture_driver_find_best_gl_get_data_format
|
||||
(CoglContext *context,
|
||||
CoglPixelFormat format,
|
||||
CoglPixelFormat target_format,
|
||||
GLenum *closest_gl_format,
|
||||
GLenum *closest_gl_type)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [24])
|
||||
m4_define([mutter_micro_version], [0])
|
||||
m4_define([mutter_micro_version], [4])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
|
152
po/sl.po
152
po/sl.po
@ -9,19 +9,20 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2017-02-14 08:48+0100\n"
|
||||
"PO-Revision-Date: 2017-02-14 08:48+0100\n"
|
||||
"POT-Creation-Date: 2017-08-10 22:40+0200\n"
|
||||
"PO-Revision-Date: 2017-08-10 22:40+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_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"
|
||||
"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.9\n"
|
||||
"X-Generator: Poedit 2.0.1\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@ -274,15 +275,15 @@ msgstr "Spremenilnik, ki naj se uporabi za upravljanje oken"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:8
|
||||
msgid ""
|
||||
"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."
|
||||
"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."
|
||||
msgstr ""
|
||||
"Ta vrednost določa \"prevleko\", ki združuje predogled okna in zaganjalnik "
|
||||
"programa. Vrednost je zamišljena kot \"ključ oken\" na strojni opremi "
|
||||
"računalnika. Pričakovano je, da je vrednost določena privzeto ali pa ni "
|
||||
"določena."
|
||||
"Ta vrednost določa »prekrivno plast«, ki združuje predogled okna in "
|
||||
"zaganjalnik programa. Vrednost je zamišljena kot »ključ oken« na strojni "
|
||||
"opremi računalnika. Pričakovano je, da je vrednost določena privzeto ali pa "
|
||||
"ni določena."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:20
|
||||
msgid "Attach modal dialogs"
|
||||
@ -317,7 +318,7 @@ msgstr "Število delovnih površin je spremenljivo"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:41
|
||||
msgid ""
|
||||
"Determines whether workspaces are managed dynamically or whether there's a "
|
||||
"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)."
|
||||
msgstr ""
|
||||
@ -355,12 +356,12 @@ msgstr "Zamakni spremembe žarišča, dokler se kazalnik še premika"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:69
|
||||
msgid ""
|
||||
"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."
|
||||
"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."
|
||||
msgstr ""
|
||||
"Izbrana možnost omogoča, da se žarišče, v kolikor je izbran način \"sloppy\" "
|
||||
"ali \"miška\", ne spremeni takoj ob izbiri okna. Žarišče se spremeni, ko se "
|
||||
"Izbrana možnost omogoča, da se žarišče, v kolikor je izbran način »sloppy« "
|
||||
"ali »miška«, ne spremeni takoj ob izbiri okna. Žarišče se spremeni, ko se "
|
||||
"kazalnik preneha premikati."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:79
|
||||
@ -369,11 +370,11 @@ msgstr "Prilagodljiva obroba pravokotnika"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:80
|
||||
msgid ""
|
||||
"The amount of total draggable borders. If the theme's visible borders are "
|
||||
"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 ""
|
||||
"Delež skupne prilagodljive obrobe. V kolikor vidni robovi teme niso dovolj, "
|
||||
"so dodane nevidne obrobe, za dodatno prilagajanje."
|
||||
"so dodane nevidne obrobe za dodatno prilagajanje."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:89
|
||||
msgid "Auto maximize nearly monitor sized windows"
|
||||
@ -457,7 +458,7 @@ msgstr "Preklopi na VT 12"
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:1759
|
||||
#: src/backends/meta-input-settings.c:2141
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Preklop načina (skupina %d)"
|
||||
@ -465,43 +466,42 @@ msgstr "Preklop načina (skupina %d)"
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:1781
|
||||
#: src/backends/meta-input-settings.c:2164
|
||||
msgid "Switch monitor"
|
||||
msgstr "Nadzornik preklopa"
|
||||
|
||||
#: src/backends/meta-input-settings.c:1783
|
||||
#: src/backends/meta-input-settings.c:2166
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Pokaži zaslonsko pomoč"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:675
|
||||
#: src/backends/meta-monitor-manager.c:620
|
||||
msgid "Built-in display"
|
||||
msgstr "Vgrajen zaslon"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:698
|
||||
#: src/backends/meta-monitor-manager.c:643
|
||||
msgid "Unknown"
|
||||
msgstr "Neznano"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:700
|
||||
#: src/backends/meta-monitor-manager.c:645
|
||||
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:708
|
||||
#: src/backends/meta-monitor-manager.c:653
|
||||
#, 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:471
|
||||
#: src/compositor/compositor.c:476
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display \"%s"
|
||||
"\"."
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
msgstr ""
|
||||
"Drug upravljalnik sestavljanja je že zagnan na zaslonu %i prikaza \"%s\"."
|
||||
"Drug upravljalnik sestavljanja je že zagnan na zaslonu %i prikaza »%s«."
|
||||
|
||||
#: src/core/bell.c:194
|
||||
msgid "Bell event"
|
||||
@ -511,7 +511,7 @@ msgstr "Dogodek zvonjenja"
|
||||
#: src/core/delete.c:127
|
||||
#, c-format
|
||||
msgid "“%s” is not responding."
|
||||
msgstr "“%s” se ne odziva."
|
||||
msgstr "Okno »%s« se ne odziva."
|
||||
|
||||
#: src/core/delete.c:129
|
||||
msgid "Application is not responding."
|
||||
@ -535,42 +535,42 @@ msgstr "_Počakaj"
|
||||
|
||||
#: src/core/display.c:608
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "Ni mogoče odpreti zaslona '%s' okenskega sistema X\n"
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "Odpiranje zaslona »%s« okenskega sistema X je spodletelo\n"
|
||||
|
||||
#: src/core/main.c:187
|
||||
#: src/core/main.c:189
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "Onemogoči povezavo z upravljalnikom sej"
|
||||
|
||||
#: src/core/main.c:193
|
||||
#: src/core/main.c:195
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "Zamenjaj trenutni upravljalnik oken"
|
||||
|
||||
#: src/core/main.c:199
|
||||
#: src/core/main.c:201
|
||||
msgid "Specify session management ID"
|
||||
msgstr "Navedite ID upravljanja seje"
|
||||
|
||||
#: src/core/main.c:204
|
||||
#: src/core/main.c:206
|
||||
msgid "X Display to use"
|
||||
msgstr "Zaslon X za uporabo"
|
||||
|
||||
#: src/core/main.c:210
|
||||
#: src/core/main.c:212
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "Začni sejo iz shranjene datoteke"
|
||||
|
||||
#: src/core/main.c:216
|
||||
#: src/core/main.c:218
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "Uskladi klice X"
|
||||
|
||||
#: src/core/main.c:223
|
||||
#: src/core/main.c:225
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "Zaženi izbirnik wayland"
|
||||
|
||||
#: src/core/main.c:229
|
||||
#: src/core/main.c:231
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "Zaženi kot gnezden vpisovalnik"
|
||||
|
||||
#: src/core/main.c:237
|
||||
#: src/core/main.c:239
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "Zaženi kot polni strežnik zaslona in ne vstavljeno"
|
||||
|
||||
@ -578,15 +578,14 @@ msgstr "Zaženi kot polni strežnik zaslona in ne vstavljeno"
|
||||
#, c-format
|
||||
msgid ""
|
||||
"mutter %s\n"
|
||||
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"This is free software; see the source for copying conditions.\n"
|
||||
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
|
||||
"PARTICULAR PURPOSE.\n"
|
||||
msgstr ""
|
||||
"mutter %s\n"
|
||||
"Avtorske pravice pridržane (C) 2001-%d Havoc Pennington, Red Hat in drugi\n"
|
||||
"To je prosta programska oprema; za pogoje kopiranja si poglejte izvorno "
|
||||
"kodo.\n"
|
||||
"To je prosta programska oprema; za pogoje kopiranja si oglejte dovoljenje.\n"
|
||||
"Program je na voljo BREZ KAKRŠNIHKOLI ZAGOTOVIL.\n"
|
||||
|
||||
#: src/core/mutter.c:53
|
||||
@ -606,16 +605,16 @@ msgstr "Delovna površina %d"
|
||||
#: src/core/screen.c:580
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display \"%s\" already has a window manager; try using the --replace option "
|
||||
"to replace the current window manager."
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
"replace the current window manager."
|
||||
msgstr ""
|
||||
"Zaslon \"%s\" že ima določen upravljalnik oken; poskušajte uporabiti možnost "
|
||||
"--replace za zamenjavo trenutnega upravljalnika zaslona."
|
||||
"Zaslon »%s« že ima določen upravljalnik oken; poskušajte uporabiti možnost --"
|
||||
"replace za zamenjavo trenutnega upravljalnika zaslona."
|
||||
|
||||
#: src/core/screen.c:665
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgstr "Zaslon %d na prikazu '%s' ni veljaven\n"
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "Zaslon %d na prikazu »%s« ni veljaven\n"
|
||||
|
||||
#: src/core/util.c:120
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
@ -630,17 +629,56 @@ msgstr "Način preklopa: način %d"
|
||||
# G:2 K:6 O:0
|
||||
#: src/x11/session.c:1815
|
||||
msgid ""
|
||||
"These windows do not support "save current setup" and will have to "
|
||||
"be restarted manually next time you log in."
|
||||
"These windows do not support “save current setup” and will have to be "
|
||||
"restarted manually next time you log in."
|
||||
msgstr ""
|
||||
"Ta okna ne podpirajo možnosti "shranjevanja trenutnih nastavitev", "
|
||||
"zato jih bo treba ob naslednji prijavi zagnati ročno."
|
||||
"Ta okna ne podpirajo možnosti »shranjevanja trenutnih nastavitev«, zato jih "
|
||||
"bo treba ob naslednji prijavi zagnati ročno."
|
||||
|
||||
#: src/x11/window-props.c:559
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (na %s)"
|
||||
|
||||
#~ msgid "Enable experimental features"
|
||||
#~ msgstr "Omogoči preizkusne možnosti"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "To enable experimental features, add the feature keyword to the list. "
|
||||
#~ "Whether the feature requires restarting the compositor depends on the "
|
||||
#~ "given feature. Any experimental feature is not required to still be "
|
||||
#~ "available, or configurable. Don’t expect adding anything in this setting "
|
||||
#~ "to be future proof. Currently possible keywords: • “monitor-config-"
|
||||
#~ "manager” — use the new monitor configuration system, aimed to replace the "
|
||||
#~ "old one. This enables a higher level configuration API to be used by "
|
||||
#~ "configuration applications, as well as the ability to configure per "
|
||||
#~ "logical monitor scale. • “scale-monitor-framebuffer” — makes mutter "
|
||||
#~ "default to layout logical monitors in a logical pixel coordinate space, "
|
||||
#~ "while scaling monitor framebuffers instead of window content, to manage "
|
||||
#~ "HiDPI monitors. Does not require a restart. Also enabling “monitor-config-"
|
||||
#~ "manager” is required for this feature to be enabled."
|
||||
#~ msgstr ""
|
||||
#~ "Za omogočanje preizkusnih možnosti, dodajte ključno besedo možnosti na "
|
||||
#~ "seznam. Ali zahteva možnost ponovni zagon sestavljalnika, je odvisno od "
|
||||
#~ "posamezne možnosti. Te možnosti niso zahtevane niti nastavljive. Trenutno "
|
||||
#~ "so na voljo ključne besede: • »monitor-config-manager« – uporablja nov "
|
||||
#~ "sistem nastavitev, ki naj bi zamenjal obstoječega. Omogoča večjo "
|
||||
#~ "nastavljivost API, za uporabo pri prigramih za nastavitve lastnosti "
|
||||
#~ "zaslona. • »scale-monitor-framebuffer« – določi privzeto rabo sistema "
|
||||
#~ "mutter za logične zaslone v logičnem točkovnem koordinatnem prostoru, pri "
|
||||
#~ "čemer prilagaja predpomnilnik in ne vsebine za upravljanje z zasloni "
|
||||
#~ "HiDPI. Možnost ne zahteva ponovnega zagona. Za omogočanje te možnosti, "
|
||||
#~ "mora biti omogočena tudi možnost »monitor-config-manager«."
|
||||
|
||||
#~ msgid "Switch monitor configurations"
|
||||
#~ msgstr "Nastavitve nadzornika preklopa"
|
||||
|
||||
#~ msgid "Rotates the built-in monitor configuration"
|
||||
#~ msgstr "Zavrti vgrajene nastavitve zaslona"
|
||||
|
||||
#~ msgid "Re-enable shortcuts"
|
||||
#~ msgstr "Ponovno omogoči tipkovne bližnjice"
|
||||
|
||||
#~ msgid "Failed to scan themes directory: %s\n"
|
||||
#~ msgstr "Ni mogoče preiskati mape tem: %s\n"
|
||||
|
||||
|
225
po/zh_CN.po
225
po/zh_CN.po
@ -1,6 +1,6 @@
|
||||
# translation of mutter.po to zh_CN
|
||||
# Simplified Chinese translation of mutter.
|
||||
# Copyright (C) 2002, 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
|
||||
# This file is distributed under the same license as the mutter package.
|
||||
# Sun G11n <gnome_int_l10n@ireland.sun.com>, 2002.
|
||||
# He Qiangqiang <carton@linux.net.cn>, 2002
|
||||
# Xiong Jiang <jxiong@offtopic.org>, 2003
|
||||
@ -11,22 +11,25 @@
|
||||
# Lele Long <schemacs@gmail.com>, 2011.
|
||||
# YunQiang Su <wzssyqa@gmail.com>, 2011, 2012.
|
||||
# Tong Hui <tonghuix@gmail.com>, 2014.
|
||||
# Mandy Wang <wangmychn@gmail.com>, 2017.
|
||||
# Dingzhong Chen <wsxy162@gmail.com>, 2017.
|
||||
# Mingcong Bai <jeffbai@aosc.xyz>, 2017.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2017-02-03 10:06+0000\n"
|
||||
"PO-Revision-Date: 2017-01-04 21:52+0800\n"
|
||||
"Last-Translator: Mandy Wang <wangmychn@gmail.com>\n"
|
||||
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
|
||||
"POT-Creation-Date: 2017-07-03 12:32+0000\n"
|
||||
"PO-Revision-Date: 2017-06-10 14:49+0800\n"
|
||||
"Last-Translator: Mingcong Bai <jeffbai@aosc.xyz>\n"
|
||||
"Language-Team: Chinese (China) <i18n-zh@googlegroups.com>\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
"X-Generator: Poedit 2.0.2\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@ -278,10 +281,10 @@ msgstr "用于修改窗口点击动作的修饰键 met"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:8
|
||||
msgid ""
|
||||
"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."
|
||||
"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."
|
||||
msgstr ""
|
||||
"这个键指出的“覆盖”是一种混合窗口概述和应用程序运行的系统。默认要求使用 "
|
||||
"“Super 键”。可能使用默认或者空白。"
|
||||
@ -318,12 +321,12 @@ msgstr "动态管理工作区"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:41
|
||||
msgid ""
|
||||
"Determines whether workspaces are managed dynamically or whether there's a "
|
||||
"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)."
|
||||
msgstr ""
|
||||
"决定工作区动态管理还是静态数量的工作区(由 org.gnome.desktop.wm.preferences 中"
|
||||
"的 num-workspaces 键确定)。"
|
||||
"决定工作区动态管理还是静态数量的工作区(由 org.gnome.desktop.wm.preferences "
|
||||
"中的 num-workspaces 键确定)。"
|
||||
|
||||
# 或者 只在主显示器上显示工作区
|
||||
#: data/org.gnome.mutter.gschema.xml.in:50
|
||||
@ -353,9 +356,9 @@ msgstr "将焦点改变推迟到光标停止移动之后"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:69
|
||||
msgid ""
|
||||
"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."
|
||||
"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."
|
||||
msgstr ""
|
||||
"如果为 true,而聚焦模式为“sloppy”或“mouse”,那么进入某个窗口时焦点将不会立即"
|
||||
"改变,而是等到光标停止移动之后。"
|
||||
@ -366,7 +369,7 @@ msgstr "可拖拽的边界宽度"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:80
|
||||
msgid ""
|
||||
"The amount of total draggable borders. If the theme's visible borders are "
|
||||
"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 ""
|
||||
"可拖拽的边界总数。如果主题的可见边界不足,将添加不可见的边界来满足此值。"
|
||||
@ -391,11 +394,39 @@ msgid ""
|
||||
"screen of the monitor."
|
||||
msgstr "为 true 时,新窗口将总是置于此显示器已激活屏幕的中央。"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:120
|
||||
#: data/org.gnome.mutter.gschema.xml.in:107
|
||||
msgid "Enable experimental features"
|
||||
msgstr "开启实验性特性"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:108
|
||||
msgid ""
|
||||
"To enable experimental features, add the feature keyword to the list. "
|
||||
"Whether the feature requires restarting the compositor depends on the given "
|
||||
"feature. Any experimental feature is not required to still be available, or "
|
||||
"configurable. Don’t expect adding anything in this setting to be future "
|
||||
"proof. Currently possible keywords: • “monitor-config-manager” — use the new "
|
||||
"monitor configuration system, aimed to replace the old one. This enables a "
|
||||
"higher level configuration API to be used by configuration applications, as "
|
||||
"well as the ability to configure per logical monitor scale. • “scale-monitor-"
|
||||
"framebuffer” — makes mutter default to layout logical monitors in a logical "
|
||||
"pixel coordinate space, while scaling monitor framebuffers instead of window "
|
||||
"content, to manage HiDPI monitors. Does not require a restart. Also enabling "
|
||||
"“monitor-config-manager” is required for this feature to be enabled."
|
||||
msgstr ""
|
||||
"要启用实验性特性,请将如下特性关键字添加到列表中。特性是否要求重启合成器取决"
|
||||
"于特性本身。实验性特性不需启用即可配置和使用。请不要将实验性特性作为未来保障"
|
||||
"的基础。当前可用的关键字:• “monitor-config-manager” — 使用新的监视器配置系"
|
||||
"统,用于替代老的系统。启用此特性将打开一个上级配置 API 以用于配置应用程序,并"
|
||||
"可提供基于每屏幕的逻辑缩放功能。• “scale-monitor-framebuffer” — 让 Mutter 默"
|
||||
"认基于像素座标排布多屏幕,并同时缩放监视器帧缓冲器而不是窗口内容,以便管理 "
|
||||
"HiDPI 监视器。该特性不需要重启来生效。该特性需要打开“monitor-config-"
|
||||
"manager”特性才能使用。"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "从 Tab 轮换弹出界面选择窗口"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:125
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "取消 Tab 轮换弹出"
|
||||
|
||||
@ -447,127 +478,135 @@ msgstr "切换到 VT 11"
|
||||
msgid "Switch to VT 12"
|
||||
msgstr "切换到 VT 12"
|
||||
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:1871
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "模式切换(组别 %d)"
|
||||
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:1861
|
||||
#: src/backends/meta-input-settings.c:1893
|
||||
msgid "Switch monitor"
|
||||
msgstr "切换显示器"
|
||||
|
||||
#: src/backends/meta-input-settings.c:1863
|
||||
#: src/backends/meta-input-settings.c:1895
|
||||
msgid "Show on-screen help"
|
||||
msgstr "显示在屏帮助"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:515
|
||||
#: src/backends/meta-monitor-manager.c:879
|
||||
msgid "Built-in display"
|
||||
msgstr "内置显示器"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:538
|
||||
#: src/backends/meta-monitor-manager.c:902
|
||||
msgid "Unknown"
|
||||
msgstr "未知"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:540
|
||||
#: src/backends/meta-monitor-manager.c:904
|
||||
msgid "Unknown Display"
|
||||
msgstr "未知的 Display"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: src/backends/meta-monitor-manager.c:548
|
||||
#: src/backends/meta-monitor-manager.c:912
|
||||
#, 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:471
|
||||
#: src/compositor/compositor.c:476
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display \"%s"
|
||||
"\"."
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
msgstr "显示器 %2$s 的屏幕 %1$i 上已有另外一个混成窗口管理器正在运行。"
|
||||
|
||||
#: src/core/bell.c:194
|
||||
msgid "Bell event"
|
||||
msgstr "响铃事件"
|
||||
|
||||
#: src/core/delete.c:127
|
||||
#: src/core/display.c:608
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "无法打开 X Window System 显示器“%s”\n"
|
||||
|
||||
#: src/core/main.c:189
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "禁止连接到会话管理器"
|
||||
|
||||
#: src/core/main.c:195
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "替换正在运行的窗口管理器"
|
||||
|
||||
#: src/core/main.c:201
|
||||
msgid "Specify session management ID"
|
||||
msgstr "指定会话管理 ID"
|
||||
|
||||
#: src/core/main.c:206
|
||||
msgid "X Display to use"
|
||||
msgstr "要使用的 X Display"
|
||||
|
||||
#: src/core/main.c:212
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "从保存文件中初始化会话"
|
||||
|
||||
#: src/core/main.c:218
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "使 X 调用同步"
|
||||
|
||||
#: src/core/main.c:225
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "作为 wayland 混成管理器运行"
|
||||
|
||||
#: src/core/main.c:231
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "作为嵌套混成器运行"
|
||||
|
||||
#: src/core/main.c:239
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "以完整显示服务器方式运行,而不是以嵌套方式"
|
||||
|
||||
#. Translators: %s is a window title
|
||||
#: src/core/meta-close-dialog-default.c:147
|
||||
#, c-format
|
||||
msgid "“%s” is not responding."
|
||||
msgstr "“%s” 未响应。"
|
||||
|
||||
#: src/core/delete.c:129
|
||||
#: src/core/meta-close-dialog-default.c:149
|
||||
msgid "Application is not responding."
|
||||
msgstr "应用程序未响应。"
|
||||
|
||||
#: src/core/delete.c:134
|
||||
#: src/core/meta-close-dialog-default.c:154
|
||||
msgid ""
|
||||
"You may choose to wait a short while for it to continue or force the "
|
||||
"application to quit entirely."
|
||||
msgstr "您可以选择稍等一会儿,或者强制退出该应用程序。"
|
||||
|
||||
#: src/core/delete.c:141
|
||||
msgid "_Wait"
|
||||
msgstr "等待(_W)"
|
||||
|
||||
#: src/core/delete.c:141
|
||||
#: src/core/meta-close-dialog-default.c:161
|
||||
msgid "_Force Quit"
|
||||
msgstr "强制退出(_F)"
|
||||
|
||||
#: src/core/display.c:590
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "无法打开 X Window System 显示器“%s”\n"
|
||||
|
||||
#: src/core/main.c:182
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "禁止连接到会话管理器"
|
||||
|
||||
#: src/core/main.c:188
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "替换正在运行的窗口管理器"
|
||||
|
||||
#: src/core/main.c:194
|
||||
msgid "Specify session management ID"
|
||||
msgstr "指定会话管理 ID"
|
||||
|
||||
#: src/core/main.c:199
|
||||
msgid "X Display to use"
|
||||
msgstr "要使用的 X Display"
|
||||
|
||||
#: src/core/main.c:205
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "从保存文件中初始化会话"
|
||||
|
||||
#: src/core/main.c:211
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "使 X 调用同步"
|
||||
|
||||
#: src/core/main.c:218
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "作为 wayland 混成管理器运行"
|
||||
|
||||
#: src/core/main.c:224
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "作为嵌套混成器运行"
|
||||
|
||||
#: src/core/main.c:232
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "以完整显示服务器方式运行,而不是以嵌套方式"
|
||||
#: src/core/meta-close-dialog-default.c:161
|
||||
msgid "_Wait"
|
||||
msgstr "等待(_W)"
|
||||
|
||||
#: src/core/mutter.c:39
|
||||
#, c-format
|
||||
msgid ""
|
||||
"mutter %s\n"
|
||||
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"This is free software; see the source for copying conditions.\n"
|
||||
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
|
||||
"PARTICULAR PURPOSE.\n"
|
||||
msgstr ""
|
||||
"mutter %s\n"
|
||||
"版权所有 (C) 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
|
||||
"本软件为自由软件:版权条款请参见源码\n"
|
||||
"不存在任何保证:即便是对商业性或者特定目的的适应性也不作保证。\n"
|
||||
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
|
||||
"本软件为自由软件;版权条款请参见源码\n"
|
||||
"不存在任何保证;即便是对商业性或者特定目的的适应性也不作保证。\n"
|
||||
|
||||
#: src/core/mutter.c:53
|
||||
msgid "Print version"
|
||||
@ -582,41 +621,39 @@ msgstr "要使用的 Mutter 插件"
|
||||
msgid "Workspace %d"
|
||||
msgstr "工作区 %d"
|
||||
|
||||
#: src/core/screen.c:521
|
||||
#: src/core/screen.c:580
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display \"%s\" already has a window manager; try using the --replace option "
|
||||
"to replace the current window manager."
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
"replace the current window manager."
|
||||
msgstr ""
|
||||
"Display“%s”已经有一个窗口管理器;请尝试使用 --replace 选项替换当前的窗口管理"
|
||||
"器。"
|
||||
|
||||
#: src/core/screen.c:606
|
||||
#: src/core/screen.c:665
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "显示“%2$s”上的屏幕 %1$d 无效\n"
|
||||
|
||||
#: 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
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:563
|
||||
#, c-format
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "模式切换:%d 模式"
|
||||
|
||||
#: src/x11/session.c:1815
|
||||
msgid ""
|
||||
"These windows do not support "save current setup" and will have to "
|
||||
"be restarted manually next time you log in."
|
||||
msgstr ""
|
||||
"这些窗口不支持 "保存当前设置 " 您在下次登录时,必须手动重启动它"
|
||||
"们。"
|
||||
"These windows do not support “save current setup” and will have to be "
|
||||
"restarted manually next time you log in."
|
||||
msgstr "这些窗口不支持“保存当前设置”,并且在您下次登录时,必须手动重启它们。"
|
||||
|
||||
#: src/x11/window-props.c:548
|
||||
#: src/x11/window-props.c:559
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (于 %s)"
|
||||
msgstr "%s(于 %s)"
|
||||
|
||||
#~ msgid "Failed to scan themes directory: %s\n"
|
||||
#~ msgstr "扫描主题目录失败:%s\n"
|
||||
|
@ -29,6 +29,7 @@ gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
void meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor);
|
||||
void meta_dnd_wayland_handle_end_modal (MetaCompositor *compositor);
|
||||
#endif
|
||||
|
||||
#endif /* META_DND_PRIVATE_H */
|
||||
|
@ -65,6 +65,9 @@ struct _MetaInputSettingsClass
|
||||
void (* set_tap_enabled) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean enabled);
|
||||
void (* set_disable_while_typing) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean enabled);
|
||||
void (* set_invert_scroll) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean inverted);
|
||||
@ -117,7 +120,6 @@ struct _MetaInputSettingsClass
|
||||
ClutterInputDeviceTool *tool,
|
||||
GDesktopStylusButtonAction primary,
|
||||
GDesktopStylusButtonAction secondary);
|
||||
|
||||
gboolean (* has_two_finger_scroll) (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device);
|
||||
};
|
||||
@ -138,11 +140,12 @@ gboolean meta_input_settings_is_pad_button_grabbed (MetaIn
|
||||
ClutterInputDevice *pad,
|
||||
guint button);
|
||||
|
||||
gboolean meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
||||
const ClutterPadButtonEvent *event);
|
||||
gchar * meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
guint button);
|
||||
gboolean meta_input_settings_handle_pad_event (MetaInputSettings *input_settings,
|
||||
const ClutterEvent *event);
|
||||
gchar * meta_input_settings_get_pad_action_label (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
MetaPadActionType action,
|
||||
guint number);
|
||||
|
||||
#ifdef HAVE_LIBWACOM
|
||||
WacomDevice * meta_input_settings_get_tablet_wacom_device (MetaInputSettings *settings,
|
||||
|
@ -53,9 +53,11 @@ struct _DeviceMappingInfo
|
||||
MetaInputSettings *input_settings;
|
||||
ClutterInputDevice *device;
|
||||
GSettings *settings;
|
||||
guint changed_id;
|
||||
#ifdef HAVE_LIBWACOM
|
||||
WacomDevice *wacom_device;
|
||||
#endif
|
||||
guint *group_modes;
|
||||
};
|
||||
|
||||
struct _MetaInputSettingsPrivate
|
||||
@ -79,6 +81,14 @@ struct _MetaInputSettingsPrivate
|
||||
#endif
|
||||
|
||||
GHashTable *two_finger_devices;
|
||||
|
||||
/* Pad ring/strip emission */
|
||||
struct {
|
||||
ClutterInputDevice *pad;
|
||||
MetaPadActionType action;
|
||||
guint number;
|
||||
gdouble value;
|
||||
} last_pad_action_info;
|
||||
};
|
||||
|
||||
typedef void (*ConfigBoolFunc) (MetaInputSettings *input_settings,
|
||||
@ -91,6 +101,14 @@ typedef void (*ConfigUintFunc) (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device,
|
||||
guint value);
|
||||
|
||||
typedef enum {
|
||||
META_PAD_DIRECTION_NONE = -1,
|
||||
META_PAD_DIRECTION_UP = 0,
|
||||
META_PAD_DIRECTION_DOWN,
|
||||
META_PAD_DIRECTION_CW,
|
||||
META_PAD_DIRECTION_CCW,
|
||||
} MetaPadDirection;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaInputSettings, meta_input_settings, G_TYPE_OBJECT)
|
||||
|
||||
static GSList *
|
||||
@ -448,6 +466,44 @@ update_device_natural_scroll (MetaInputSettings *input_settings,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_touchpad_disable_while_typing (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
GSettings *settings;
|
||||
MetaInputSettingsClass *input_settings_class;
|
||||
MetaInputSettingsPrivate *priv;
|
||||
gboolean enabled;
|
||||
const gchar *key = "disable-while-typing";
|
||||
|
||||
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);
|
||||
enabled = g_settings_get_boolean (priv->touchpad_settings, key);
|
||||
|
||||
if (device)
|
||||
{
|
||||
settings = get_settings_for_device_type (input_settings,
|
||||
clutter_input_device_get_device_type (device));
|
||||
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
settings_device_set_bool_setting (input_settings, device,
|
||||
input_settings_class->set_disable_while_typing,
|
||||
enabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
|
||||
input_settings_class->set_disable_while_typing,
|
||||
enabled);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_touchpad_tap_enabled (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device)
|
||||
@ -700,7 +756,7 @@ logical_monitor_has_monitor (MetaMonitorManager *monitor_manager,
|
||||
GList *monitors;
|
||||
GList *l;
|
||||
|
||||
monitors = meta_monitor_manager_get_monitors (monitor_manager);
|
||||
monitors = meta_logical_monitor_get_monitors (logical_monitor);
|
||||
for (l = monitors; l; l = l->next)
|
||||
{
|
||||
MetaMonitor *monitor = l->data;
|
||||
@ -825,7 +881,7 @@ update_device_display (MetaInputSettings *input_settings,
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
|
||||
/* If mapping is relative, the device can move on all displays */
|
||||
if (clutter_input_device_get_device_type (device) != CLUTTER_TABLET_DEVICE ||
|
||||
if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
|
||||
clutter_input_device_get_mapping_mode (device) ==
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
|
||||
logical_monitor = meta_input_settings_find_logical_monitor (input_settings,
|
||||
@ -989,6 +1045,8 @@ meta_input_settings_changed_cb (GSettings *settings,
|
||||
update_device_natural_scroll (input_settings, NULL);
|
||||
else if (strcmp (key, "tap-to-click") == 0)
|
||||
update_touchpad_tap_enabled (input_settings, NULL);
|
||||
else if (strcmp(key, "disable-while-typing") == 0)
|
||||
update_touchpad_disable_while_typing (input_settings, NULL);
|
||||
else if (strcmp (key, "send-events") == 0)
|
||||
update_touchpad_send_events (input_settings, NULL);
|
||||
else if (strcmp (key, "edge-scrolling-enabled") == 0)
|
||||
@ -1035,10 +1093,15 @@ static void
|
||||
apply_mappable_device_settings (MetaInputSettings *input_settings,
|
||||
DeviceMappingInfo *info)
|
||||
{
|
||||
update_device_display (input_settings, info->settings, info->device);
|
||||
ClutterInputDeviceType device_type;
|
||||
|
||||
if (clutter_input_device_get_device_type (info->device) == CLUTTER_TABLET_DEVICE ||
|
||||
clutter_input_device_get_device_type (info->device) == CLUTTER_PAD_DEVICE)
|
||||
update_device_display (input_settings, info->settings, info->device);
|
||||
device_type = clutter_input_device_get_device_type (info->device);
|
||||
|
||||
if (device_type == CLUTTER_TABLET_DEVICE ||
|
||||
device_type == CLUTTER_PEN_DEVICE ||
|
||||
device_type == CLUTTER_ERASER_DEVICE ||
|
||||
device_type == CLUTTER_PAD_DEVICE)
|
||||
{
|
||||
update_tablet_mapping (input_settings, info->settings, info->device);
|
||||
update_tablet_area (input_settings, info->settings, info->device);
|
||||
@ -1121,20 +1184,58 @@ lookup_tool_settings (ClutterInputDeviceTool *tool,
|
||||
}
|
||||
|
||||
static GSettings *
|
||||
lookup_pad_button_settings (ClutterInputDevice *device,
|
||||
guint button)
|
||||
lookup_pad_action_settings (ClutterInputDevice *device,
|
||||
MetaPadActionType action,
|
||||
guint number,
|
||||
MetaPadDirection direction,
|
||||
gint mode)
|
||||
{
|
||||
const gchar *vendor, *product;
|
||||
const gchar *vendor, *product, *action_type, *detail_type = NULL;
|
||||
GSettings *settings;
|
||||
gchar *path;
|
||||
GString *path;
|
||||
gchar action_label;
|
||||
|
||||
vendor = clutter_input_device_get_vendor_id (device);
|
||||
product = clutter_input_device_get_product_id (device);
|
||||
path = g_strdup_printf ("/org/gnome/desktop/peripherals/tablets/%s:%s/button%c/",
|
||||
vendor, product, 'A' + button);
|
||||
|
||||
action_label = 'A' + number;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case META_PAD_ACTION_BUTTON:
|
||||
action_type = "button";
|
||||
break;
|
||||
case META_PAD_ACTION_RING:
|
||||
g_assert (direction == META_PAD_DIRECTION_CW ||
|
||||
direction == META_PAD_DIRECTION_CCW);
|
||||
action_type = "ring";
|
||||
detail_type = (direction == META_PAD_DIRECTION_CW) ? "cw" : "ccw";
|
||||
break;
|
||||
case META_PAD_ACTION_STRIP:
|
||||
g_assert (direction == META_PAD_DIRECTION_UP ||
|
||||
direction == META_PAD_DIRECTION_DOWN);
|
||||
action_type = "strip";
|
||||
detail_type = (direction == META_PAD_DIRECTION_UP) ? "up" : "down";
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
path = g_string_new (NULL);
|
||||
g_string_append_printf (path, "/org/gnome/desktop/peripherals/tablets/%s:%s/%s%c",
|
||||
vendor, product, action_type, action_label);
|
||||
|
||||
if (detail_type)
|
||||
g_string_append_printf (path, "-%s", detail_type);
|
||||
|
||||
if (mode >= 0)
|
||||
g_string_append_printf (path, "-mode-%d", mode);
|
||||
|
||||
g_string_append_c (path, '/');
|
||||
|
||||
settings = g_settings_new_with_path ("org.gnome.desktop.peripherals.tablet.pad-button",
|
||||
path);
|
||||
g_free (path);
|
||||
path->str);
|
||||
g_string_free (path, TRUE);
|
||||
|
||||
return settings;
|
||||
}
|
||||
@ -1163,7 +1264,9 @@ device_mapping_info_free (DeviceMappingInfo *info)
|
||||
if (info->wacom_device)
|
||||
libwacom_destroy (info->wacom_device);
|
||||
#endif
|
||||
g_signal_handler_disconnect (info->settings, info->changed_id);
|
||||
g_object_unref (info->settings);
|
||||
g_free (info->group_modes);
|
||||
g_slice_free (DeviceMappingInfo, info);
|
||||
}
|
||||
|
||||
@ -1207,8 +1310,15 @@ check_add_mappable_device (MetaInputSettings *input_settings,
|
||||
}
|
||||
#endif
|
||||
|
||||
g_signal_connect (settings, "changed",
|
||||
G_CALLBACK (mapped_device_changed_cb), info);
|
||||
if (clutter_input_device_get_device_type (device) == CLUTTER_PAD_DEVICE)
|
||||
{
|
||||
info->group_modes =
|
||||
g_new0 (guint, clutter_input_device_get_n_mode_groups (device));
|
||||
}
|
||||
|
||||
info->changed_id = g_signal_connect (settings, "changed",
|
||||
G_CALLBACK (mapped_device_changed_cb),
|
||||
info);
|
||||
|
||||
g_hash_table_insert (priv->mappable_devices, device, info);
|
||||
|
||||
@ -1234,6 +1344,7 @@ apply_device_settings (MetaInputSettings *input_settings,
|
||||
|
||||
update_touchpad_left_handed (input_settings, device);
|
||||
update_touchpad_tap_enabled (input_settings, device);
|
||||
update_touchpad_disable_while_typing (input_settings, device);
|
||||
update_touchpad_send_events (input_settings, device);
|
||||
update_touchpad_two_finger_scroll (input_settings, device);
|
||||
update_touchpad_edge_scroll (input_settings, device);
|
||||
@ -1563,7 +1674,8 @@ meta_input_settings_get_pad_button_action (MetaInputSettings *input_settings,
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (pad),
|
||||
G_DESKTOP_PAD_BUTTON_ACTION_NONE);
|
||||
|
||||
settings = lookup_pad_button_settings (pad, button);
|
||||
settings = lookup_pad_action_settings (pad, META_PAD_ACTION_BUTTON,
|
||||
button, META_PAD_DIRECTION_NONE, -1);
|
||||
action = g_settings_get_enum (settings, "action");
|
||||
g_object_unref (settings);
|
||||
|
||||
@ -1619,7 +1731,7 @@ cycle_logical_monitors (MetaInputSettings *settings,
|
||||
if (l->next)
|
||||
*next_logical_monitor = l->next->data;
|
||||
else
|
||||
*next_logical_monitor = logical_monitors->data;
|
||||
*next_logical_monitor = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1712,24 +1824,20 @@ emulate_modifiers (ClutterVirtualInputDevice *device,
|
||||
|
||||
static void
|
||||
meta_input_settings_emulate_keybinding (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
guint button,
|
||||
const gchar *accel,
|
||||
gboolean is_press)
|
||||
{
|
||||
MetaInputSettingsPrivate *priv;
|
||||
ClutterKeyState state;
|
||||
GSettings *settings;
|
||||
guint key, mods;
|
||||
gchar *accel;
|
||||
|
||||
if (!accel || !*accel)
|
||||
return;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
settings = lookup_pad_button_settings (pad, button);
|
||||
accel = g_settings_get_string (settings, "keybinding");
|
||||
g_object_unref (settings);
|
||||
|
||||
/* FIXME: This is appalling */
|
||||
gtk_accelerator_parse (accel, &key, &mods);
|
||||
g_free (accel);
|
||||
|
||||
if (!priv->virtual_pad_keyboard)
|
||||
{
|
||||
@ -1766,20 +1874,21 @@ meta_input_settings_is_pad_button_grabbed (MetaInputSettings *input_settings,
|
||||
G_DESKTOP_PAD_BUTTON_ACTION_NONE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
static gboolean
|
||||
meta_input_settings_handle_pad_button (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
const ClutterPadButtonEvent *event)
|
||||
{
|
||||
GDesktopPadButtonAction action;
|
||||
ClutterInputDevice *pad;
|
||||
gint button, group, mode;
|
||||
gboolean is_press;
|
||||
GSettings *settings;
|
||||
gchar *accel;
|
||||
|
||||
g_return_val_if_fail (META_IS_INPUT_SETTINGS (input_settings), FALSE);
|
||||
g_return_val_if_fail (event->type == CLUTTER_PAD_BUTTON_PRESS ||
|
||||
event->type == CLUTTER_PAD_BUTTON_RELEASE, FALSE);
|
||||
|
||||
pad = clutter_event_get_source_device ((ClutterEvent *) event);
|
||||
button = event->button;
|
||||
mode = event->mode;
|
||||
group = clutter_input_device_get_mode_switch_button_group (pad, button);
|
||||
@ -1789,18 +1898,19 @@ meta_input_settings_handle_pad_button (MetaInputSettings *input_settin
|
||||
{
|
||||
guint n_modes = clutter_input_device_get_group_n_modes (pad, group);
|
||||
const gchar *pretty_name = NULL;
|
||||
#ifdef HAVE_LIBWACOM
|
||||
MetaInputSettingsPrivate *priv;
|
||||
DeviceMappingInfo *info;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
info = g_hash_table_lookup (priv->mappable_devices, pad);
|
||||
|
||||
#ifdef HAVE_LIBWACOM
|
||||
if (info && info->wacom_device)
|
||||
pretty_name = libwacom_get_name (info->wacom_device);
|
||||
#endif
|
||||
meta_display_notify_pad_group_switch (meta_get_display (), pad,
|
||||
pretty_name, group, mode, n_modes);
|
||||
info->group_modes[group] = mode;
|
||||
}
|
||||
|
||||
action = meta_input_settings_get_pad_button_action (input_settings, pad, button);
|
||||
@ -1816,8 +1926,12 @@ meta_input_settings_handle_pad_button (MetaInputSettings *input_settin
|
||||
meta_display_request_pad_osd (meta_get_display (), pad, FALSE);
|
||||
return TRUE;
|
||||
case G_DESKTOP_PAD_BUTTON_ACTION_KEYBINDING:
|
||||
meta_input_settings_emulate_keybinding (input_settings, pad,
|
||||
button, is_press);
|
||||
settings = lookup_pad_action_settings (pad, META_PAD_ACTION_BUTTON,
|
||||
button, META_PAD_DIRECTION_NONE, -1);
|
||||
accel = g_settings_get_string (settings, "keybinding");
|
||||
meta_input_settings_emulate_keybinding (input_settings, accel, is_press);
|
||||
g_object_unref (settings);
|
||||
g_free (accel);
|
||||
return TRUE;
|
||||
case G_DESKTOP_PAD_BUTTON_ACTION_NONE:
|
||||
default:
|
||||
@ -1825,10 +1939,189 @@ meta_input_settings_handle_pad_button (MetaInputSettings *input_settin
|
||||
}
|
||||
}
|
||||
|
||||
gchar *
|
||||
meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
guint button)
|
||||
static gboolean
|
||||
meta_input_settings_handle_pad_action (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
MetaPadActionType action,
|
||||
guint number,
|
||||
MetaPadDirection direction,
|
||||
guint mode)
|
||||
{
|
||||
GSettings *settings;
|
||||
gboolean handled = FALSE;
|
||||
gchar *accel;
|
||||
|
||||
settings = lookup_pad_action_settings (pad, action, number, direction, mode);
|
||||
accel = g_settings_get_string (settings, "keybinding");
|
||||
|
||||
if (accel && *accel)
|
||||
{
|
||||
meta_input_settings_emulate_keybinding (input_settings, accel, TRUE);
|
||||
meta_input_settings_emulate_keybinding (input_settings, accel, FALSE);
|
||||
handled = TRUE;
|
||||
}
|
||||
|
||||
g_object_unref (settings);
|
||||
g_free (accel);
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_input_settings_get_pad_action_direction (MetaInputSettings *input_settings,
|
||||
const ClutterEvent *event,
|
||||
MetaPadDirection *direction)
|
||||
{
|
||||
MetaInputSettingsPrivate *priv;
|
||||
ClutterInputDevice *pad = clutter_event_get_device (event);
|
||||
MetaPadActionType pad_action;
|
||||
gboolean has_direction = FALSE;
|
||||
MetaPadDirection inc_dir, dec_dir;
|
||||
guint number;
|
||||
gdouble value;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
*direction = META_PAD_DIRECTION_NONE;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PAD_RING:
|
||||
pad_action = META_PAD_ACTION_RING;
|
||||
number = event->pad_ring.ring_number;
|
||||
value = event->pad_ring.angle;
|
||||
inc_dir = META_PAD_DIRECTION_CW;
|
||||
dec_dir = META_PAD_DIRECTION_CCW;
|
||||
break;
|
||||
case CLUTTER_PAD_STRIP:
|
||||
pad_action = META_PAD_ACTION_STRIP;
|
||||
number = event->pad_strip.strip_number;
|
||||
value = event->pad_strip.value;
|
||||
inc_dir = META_PAD_DIRECTION_DOWN;
|
||||
dec_dir = META_PAD_DIRECTION_UP;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->last_pad_action_info.pad == pad &&
|
||||
priv->last_pad_action_info.action == pad_action &&
|
||||
priv->last_pad_action_info.number == number &&
|
||||
value >= 0 && priv->last_pad_action_info.value >= 0)
|
||||
{
|
||||
*direction = (value - priv->last_pad_action_info.value) > 0 ?
|
||||
inc_dir : dec_dir;
|
||||
has_direction = TRUE;
|
||||
}
|
||||
|
||||
priv->last_pad_action_info.pad = pad;
|
||||
priv->last_pad_action_info.action = pad_action;
|
||||
priv->last_pad_action_info.number = number;
|
||||
priv->last_pad_action_info.value = value;
|
||||
return has_direction;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_input_settings_handle_pad_event (MetaInputSettings *input_settings,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDevice *pad;
|
||||
MetaPadDirection direction = META_PAD_DIRECTION_NONE;
|
||||
|
||||
pad = clutter_event_get_source_device ((ClutterEvent *) event);
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PAD_BUTTON_PRESS:
|
||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||
return meta_input_settings_handle_pad_button (input_settings, pad,
|
||||
&event->pad_button);
|
||||
case CLUTTER_PAD_RING:
|
||||
if (!meta_input_settings_get_pad_action_direction (input_settings,
|
||||
event, &direction))
|
||||
return FALSE;
|
||||
return meta_input_settings_handle_pad_action (input_settings, pad,
|
||||
META_PAD_ACTION_RING,
|
||||
event->pad_ring.ring_number,
|
||||
direction,
|
||||
event->pad_ring.mode);
|
||||
case CLUTTER_PAD_STRIP:
|
||||
if (!meta_input_settings_get_pad_action_direction (input_settings,
|
||||
event, &direction))
|
||||
return FALSE;
|
||||
return meta_input_settings_handle_pad_action (input_settings, pad,
|
||||
META_PAD_ACTION_STRIP,
|
||||
event->pad_strip.strip_number,
|
||||
direction,
|
||||
event->pad_strip.mode);
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gchar *
|
||||
compose_directional_action_label (GSettings *direction1,
|
||||
GSettings *direction2)
|
||||
{
|
||||
gchar *accel1, *accel2, *str = NULL;
|
||||
|
||||
accel1 = g_settings_get_string (direction1, "keybinding");
|
||||
accel2 = g_settings_get_string (direction2, "keybinding");
|
||||
|
||||
if (accel1 && *accel1 && accel2 && *accel2)
|
||||
str = g_strdup_printf ("%s / %s", accel1, accel2);
|
||||
|
||||
g_free (accel1);
|
||||
g_free (accel2);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
meta_input_settings_get_ring_label (MetaInputSettings *settings,
|
||||
ClutterInputDevice *pad,
|
||||
guint number,
|
||||
guint mode)
|
||||
{
|
||||
GSettings *settings1, *settings2;
|
||||
gchar *label;
|
||||
|
||||
/* We only allow keybinding actions with those */
|
||||
settings1 = lookup_pad_action_settings (pad, META_PAD_ACTION_RING, number,
|
||||
META_PAD_DIRECTION_CW, mode);
|
||||
settings2 = lookup_pad_action_settings (pad, META_PAD_ACTION_RING, number,
|
||||
META_PAD_DIRECTION_CCW, mode);
|
||||
label = compose_directional_action_label (settings1, settings2);
|
||||
g_object_unref (settings1);
|
||||
g_object_unref (settings2);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
meta_input_settings_get_strip_label (MetaInputSettings *settings,
|
||||
ClutterInputDevice *pad,
|
||||
guint number,
|
||||
guint mode)
|
||||
{
|
||||
GSettings *settings1, *settings2;
|
||||
gchar *label;
|
||||
|
||||
/* We only allow keybinding actions with those */
|
||||
settings1 = lookup_pad_action_settings (pad, META_PAD_ACTION_STRIP, number,
|
||||
META_PAD_DIRECTION_UP, mode);
|
||||
settings2 = lookup_pad_action_settings (pad, META_PAD_ACTION_STRIP, number,
|
||||
META_PAD_DIRECTION_DOWN, mode);
|
||||
label = compose_directional_action_label (settings1, settings2);
|
||||
g_object_unref (settings1);
|
||||
g_object_unref (settings2);
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
meta_input_settings_get_button_label (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
guint button)
|
||||
{
|
||||
GDesktopPadButtonAction action;
|
||||
gint group;
|
||||
@ -1857,7 +2150,8 @@ meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_setti
|
||||
GSettings *settings;
|
||||
gchar *accel;
|
||||
|
||||
settings = lookup_pad_button_settings (pad, button);
|
||||
settings = lookup_pad_action_settings (pad, META_PAD_ACTION_BUTTON,
|
||||
button, META_PAD_DIRECTION_NONE, -1);
|
||||
accel = g_settings_get_string (settings, "keybinding");
|
||||
g_object_unref (settings);
|
||||
|
||||
@ -1875,3 +2169,55 @@ meta_input_settings_get_pad_button_action_label (MetaInputSettings *input_setti
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static guint
|
||||
get_current_pad_mode (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
MetaPadActionType action_type,
|
||||
guint number)
|
||||
{
|
||||
MetaInputSettingsPrivate *priv;
|
||||
DeviceMappingInfo *info;
|
||||
guint group = 0, n_groups;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
info = g_hash_table_lookup (priv->mappable_devices, pad);
|
||||
n_groups = clutter_input_device_get_n_mode_groups (pad);
|
||||
|
||||
if (!info->group_modes || n_groups == 0)
|
||||
return 0;
|
||||
|
||||
if (action_type == META_PAD_ACTION_RING ||
|
||||
action_type == META_PAD_ACTION_STRIP)
|
||||
{
|
||||
/* Assume features are evenly distributed in groups */
|
||||
group = number % n_groups;
|
||||
}
|
||||
|
||||
return info->group_modes[group];
|
||||
}
|
||||
|
||||
gchar *
|
||||
meta_input_settings_get_pad_action_label (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *pad,
|
||||
MetaPadActionType action_type,
|
||||
guint number)
|
||||
{
|
||||
guint mode;
|
||||
|
||||
switch (action_type)
|
||||
{
|
||||
case META_PAD_ACTION_BUTTON:
|
||||
return meta_input_settings_get_button_label (input_settings, pad, number);
|
||||
case META_PAD_ACTION_RING:
|
||||
mode = get_current_pad_mode (input_settings, pad, action_type, number);
|
||||
return meta_input_settings_get_ring_label (input_settings, pad,
|
||||
number, mode);
|
||||
case META_PAD_ACTION_STRIP:
|
||||
mode = get_current_pad_mode (input_settings, pad, action_type, number);
|
||||
return meta_input_settings_get_strip_label (input_settings, pad,
|
||||
number, mode);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -147,19 +147,6 @@ meta_monitor_manager_rebuild_logical_monitors (MetaMonitorManager *manager,
|
||||
primary_logical_monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
derive_monitor_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout)
|
||||
{
|
||||
MetaOutput *main_output;
|
||||
|
||||
main_output = meta_monitor_get_main_output (monitor);
|
||||
layout->x = main_output->crtc->rect.x;
|
||||
layout->y = main_output->crtc->rect.y;
|
||||
|
||||
meta_monitor_derive_dimensions (monitor, &layout->width, &layout->height);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_manager_rebuild_logical_monitors_derived (MetaMonitorManager *manager)
|
||||
{
|
||||
@ -179,7 +166,7 @@ meta_monitor_manager_rebuild_logical_monitors_derived (MetaMonitorManager *manag
|
||||
if (!meta_monitor_is_active (monitor))
|
||||
continue;
|
||||
|
||||
derive_monitor_layout (monitor, &layout);
|
||||
meta_monitor_derive_layout (monitor, &layout);
|
||||
logical_monitor = logical_monitor_from_layout (manager, logical_monitors,
|
||||
&layout);
|
||||
if (logical_monitor)
|
||||
@ -260,6 +247,9 @@ lid_is_closed_changed (UpClient *client,
|
||||
static gboolean
|
||||
meta_monitor_manager_real_is_lid_closed (MetaMonitorManager *manager)
|
||||
{
|
||||
if (!manager->up_client)
|
||||
return FALSE;
|
||||
|
||||
return up_client_get_lid_is_closed (manager->up_client);
|
||||
}
|
||||
|
||||
@ -1667,7 +1657,7 @@ rebuild_monitors (MetaMonitorManager *manager)
|
||||
{
|
||||
MetaMonitorNormal *monitor_normal;
|
||||
|
||||
monitor_normal = meta_monitor_normal_new (output);
|
||||
monitor_normal = meta_monitor_normal_new (manager, output);
|
||||
manager->monitors = g_list_append (manager->monitors,
|
||||
monitor_normal);
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ typedef struct _MetaMonitorMode
|
||||
|
||||
typedef struct _MetaMonitorPrivate
|
||||
{
|
||||
MetaMonitorManager *monitor_manager;
|
||||
|
||||
GList *outputs;
|
||||
GList *modes;
|
||||
|
||||
@ -69,6 +71,10 @@ struct _MetaMonitorTiled
|
||||
|
||||
uint32_t tile_group_id;
|
||||
|
||||
/* The tile (0, 0) output. */
|
||||
MetaOutput *origin_output;
|
||||
|
||||
/* The output enabled even when a non-tiled mode is used. */
|
||||
MetaOutput *main_output;
|
||||
};
|
||||
|
||||
@ -135,7 +141,7 @@ meta_monitor_spec_free (MetaMonitorSpec *monitor_spec)
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_generate_id (MetaMonitor *monitor)
|
||||
meta_monitor_generate_spec (MetaMonitor *monitor)
|
||||
{
|
||||
MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
|
||||
MetaOutput *output = meta_monitor_get_main_output (monitor);
|
||||
@ -226,11 +232,10 @@ meta_monitor_get_current_resolution (MetaMonitor *monitor,
|
||||
}
|
||||
|
||||
void
|
||||
meta_monitor_derive_dimensions (MetaMonitor *monitor,
|
||||
int *width,
|
||||
int *height)
|
||||
meta_monitor_derive_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout)
|
||||
{
|
||||
META_MONITOR_GET_CLASS (monitor)->derive_dimensions (monitor, width, height);
|
||||
META_MONITOR_GET_CLASS (monitor)->derive_layout (monitor, layout);
|
||||
}
|
||||
|
||||
void
|
||||
@ -344,7 +349,8 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
|
||||
}
|
||||
|
||||
MetaMonitorNormal *
|
||||
meta_monitor_normal_new (MetaOutput *output)
|
||||
meta_monitor_normal_new (MetaMonitorManager *monitor_manager,
|
||||
MetaOutput *output)
|
||||
{
|
||||
MetaMonitorNormal *monitor_normal;
|
||||
MetaMonitor *monitor;
|
||||
@ -354,11 +360,13 @@ meta_monitor_normal_new (MetaOutput *output)
|
||||
monitor = META_MONITOR (monitor_normal);
|
||||
monitor_priv = meta_monitor_get_instance_private (monitor);
|
||||
|
||||
monitor_priv->monitor_manager = monitor_manager;
|
||||
|
||||
monitor_priv->outputs = g_list_append (NULL, output);
|
||||
monitor_priv->winsys_id = output->winsys_id;
|
||||
meta_monitor_generate_spec (monitor);
|
||||
|
||||
meta_monitor_normal_generate_modes (monitor_normal);
|
||||
meta_monitor_generate_id (monitor);
|
||||
|
||||
return monitor_normal;
|
||||
}
|
||||
@ -373,15 +381,35 @@ meta_monitor_normal_get_main_output (MetaMonitor *monitor)
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_normal_derive_dimensions (MetaMonitor *monitor,
|
||||
int *width,
|
||||
int *height)
|
||||
meta_monitor_normal_derive_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout)
|
||||
{
|
||||
MetaOutput *output;
|
||||
|
||||
output = meta_monitor_get_main_output (monitor);
|
||||
*width = output->crtc->rect.width;
|
||||
*height = output->crtc->rect.height;
|
||||
*layout = (MetaRectangle) {
|
||||
.x = output->crtc->rect.x,
|
||||
.y = output->crtc->rect.y,
|
||||
.width = output->crtc->rect.width,
|
||||
.height = output->crtc->rect.height
|
||||
};
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_monitor_normal_get_suggested_position (MetaMonitor *monitor,
|
||||
int *x,
|
||||
int *y)
|
||||
{
|
||||
MetaOutput *output;
|
||||
|
||||
output = meta_monitor_get_main_output (monitor);
|
||||
if (output->suggested_x < 0 && output->suggested_y < 0)
|
||||
return FALSE;
|
||||
|
||||
*x = output->suggested_x;
|
||||
*y = output->suggested_y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -395,7 +423,8 @@ meta_monitor_normal_class_init (MetaMonitorNormalClass *klass)
|
||||
MetaMonitorClass *monitor_class = META_MONITOR_CLASS (klass);
|
||||
|
||||
monitor_class->get_main_output = meta_monitor_normal_get_main_output;
|
||||
monitor_class->derive_dimensions = meta_monitor_normal_derive_dimensions;
|
||||
monitor_class->derive_layout = meta_monitor_normal_derive_layout;
|
||||
monitor_class->get_suggested_position = meta_monitor_normal_get_suggested_position;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@ -409,16 +438,8 @@ meta_monitor_get_suggested_position (MetaMonitor *monitor,
|
||||
int *x,
|
||||
int *y)
|
||||
{
|
||||
MetaOutput *main_output;
|
||||
|
||||
main_output = meta_monitor_get_main_output (monitor);
|
||||
if (main_output->suggested_x < 0 && main_output->suggested_y < 0)
|
||||
return FALSE;
|
||||
|
||||
*x = main_output->suggested_x;
|
||||
*y = main_output->suggested_y;
|
||||
|
||||
return TRUE;
|
||||
return META_MONITOR_GET_CLASS (monitor)->get_suggested_position (monitor,
|
||||
x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -437,7 +458,7 @@ add_tiled_monitor_outputs (MetaMonitorManager *monitor_manager,
|
||||
continue;
|
||||
|
||||
g_warn_if_fail (output->subpixel_order ==
|
||||
monitor_tiled->main_output->subpixel_order);
|
||||
monitor_tiled->origin_output->subpixel_order);
|
||||
|
||||
monitor_priv->outputs = g_list_append (monitor_priv->outputs, output);
|
||||
}
|
||||
@ -523,15 +544,53 @@ is_monitor_mode_assigned (MetaMonitor *monitor,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_crtc_mode_tiled (MetaOutput *output,
|
||||
MetaCrtcMode *crtc_mode)
|
||||
{
|
||||
return (crtc_mode->width == (int) output->tile_info.tile_w &&
|
||||
crtc_mode->height == (int) output->tile_info.tile_h);
|
||||
}
|
||||
|
||||
static MetaCrtcMode *
|
||||
find_tiled_crtc_mode (MetaOutput *output,
|
||||
float refresh_rate)
|
||||
{
|
||||
MetaCrtcMode *crtc_mode;
|
||||
unsigned int i;
|
||||
|
||||
crtc_mode = output->preferred_mode;
|
||||
if (is_crtc_mode_tiled (output, crtc_mode))
|
||||
return crtc_mode;
|
||||
|
||||
for (i = 0; i < output->n_modes; i++)
|
||||
{
|
||||
crtc_mode = output->modes[i];
|
||||
|
||||
if (!is_crtc_mode_tiled (output, crtc_mode))
|
||||
continue;
|
||||
|
||||
if (crtc_mode->refresh_rate != refresh_rate)
|
||||
continue;
|
||||
|
||||
return crtc_mode;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static MetaMonitorMode *
|
||||
create_tiled_monitor_mode (MetaMonitorTiled *monitor_tiled)
|
||||
create_tiled_monitor_mode (MetaMonitorTiled *monitor_tiled,
|
||||
float refresh_rate,
|
||||
gboolean *out_is_preferred)
|
||||
{
|
||||
MetaMonitor *monitor = META_MONITOR (monitor_tiled);
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
MetaMonitorMode *mode;
|
||||
GList *l;
|
||||
int i;
|
||||
unsigned int i;
|
||||
gboolean is_preferred = TRUE;
|
||||
|
||||
mode = g_new0 (MetaMonitorMode, 1);
|
||||
meta_monitor_tiled_calculate_tiled_size (monitor,
|
||||
@ -542,29 +601,93 @@ create_tiled_monitor_mode (MetaMonitorTiled *monitor_tiled)
|
||||
for (l = monitor_priv->outputs, i = 0; l; l = l->next, i++)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
MetaCrtcMode *preferred_crtc_mode = output->preferred_mode;
|
||||
MetaCrtcMode *tiled_crtc_mode;
|
||||
int x;
|
||||
int y;
|
||||
|
||||
tiled_crtc_mode = find_tiled_crtc_mode (output, refresh_rate);
|
||||
if (!tiled_crtc_mode)
|
||||
{
|
||||
g_warning ("No tiled mode with refresh rate %f on %s",
|
||||
refresh_rate, output->name);
|
||||
meta_monitor_mode_free (mode);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
calculate_tile_coordinate (monitor, output, &x, &y);
|
||||
|
||||
mode->crtc_modes[i] = (MetaMonitorCrtcMode) {
|
||||
.x = x,
|
||||
.y = y,
|
||||
.output = output,
|
||||
.crtc_mode = preferred_crtc_mode
|
||||
.crtc_mode = tiled_crtc_mode
|
||||
};
|
||||
|
||||
g_warn_if_fail (mode->spec.refresh_rate == 0.0f ||
|
||||
(mode->spec.refresh_rate ==
|
||||
preferred_crtc_mode->refresh_rate));
|
||||
mode->spec.refresh_rate = refresh_rate;
|
||||
|
||||
mode->spec.refresh_rate = preferred_crtc_mode->refresh_rate;
|
||||
is_preferred = is_preferred && tiled_crtc_mode == output->preferred_mode;
|
||||
}
|
||||
|
||||
*out_is_preferred = is_preferred;
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
static void
|
||||
generate_tiled_monitor_modes (MetaMonitorTiled *monitor_tiled)
|
||||
{
|
||||
MetaMonitor *monitor = META_MONITOR (monitor_tiled);
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
MetaOutput *main_output;
|
||||
GList *tiled_modes = NULL;
|
||||
unsigned int i;
|
||||
|
||||
main_output = meta_monitor_get_main_output (META_MONITOR (monitor_tiled));
|
||||
|
||||
for (i = 0; i < main_output->n_modes; i++)
|
||||
{
|
||||
MetaCrtcMode *crtc_mode = main_output->modes[i];
|
||||
MetaMonitorMode *mode;
|
||||
gboolean is_preferred;
|
||||
|
||||
if (!is_crtc_mode_tiled (main_output, crtc_mode))
|
||||
continue;
|
||||
|
||||
mode = create_tiled_monitor_mode (monitor_tiled, crtc_mode->refresh_rate,
|
||||
&is_preferred);
|
||||
if (!mode)
|
||||
continue;
|
||||
|
||||
tiled_modes = g_list_append (tiled_modes, mode);
|
||||
|
||||
if (is_monitor_mode_assigned (monitor, mode))
|
||||
monitor_priv->current_mode = mode;
|
||||
|
||||
if (is_preferred)
|
||||
monitor_priv->preferred_mode = mode;
|
||||
}
|
||||
|
||||
if (!monitor_priv->preferred_mode)
|
||||
{
|
||||
MetaMonitorMode *best_mode = NULL;
|
||||
GList *l;
|
||||
|
||||
for (l = tiled_modes; l; l = l->next)
|
||||
{
|
||||
MetaMonitorMode *mode = l->data;
|
||||
|
||||
if (!best_mode ||
|
||||
mode->spec.refresh_rate > best_mode->spec.refresh_rate)
|
||||
best_mode = mode;
|
||||
}
|
||||
|
||||
monitor_priv->preferred_mode = best_mode;
|
||||
}
|
||||
|
||||
monitor_priv->modes = g_list_concat (monitor_priv->modes, tiled_modes);
|
||||
}
|
||||
|
||||
static MetaMonitorMode *
|
||||
create_untiled_monitor_mode (MetaMonitorTiled *monitor_tiled,
|
||||
MetaOutput *main_output,
|
||||
@ -577,12 +700,7 @@ create_untiled_monitor_mode (MetaMonitorTiled *monitor_tiled,
|
||||
GList *l;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Assume modes with a resolution identical to the tile sizes are tiled
|
||||
* modes.
|
||||
*/
|
||||
if (crtc_mode->width == (int) main_output->tile_info.tile_w &&
|
||||
crtc_mode->height == (int) main_output->tile_info.tile_h)
|
||||
if (is_crtc_mode_tiled (main_output, crtc_mode))
|
||||
return NULL;
|
||||
|
||||
mode = g_new0 (MetaMonitorMode, 1);
|
||||
@ -620,42 +738,184 @@ create_untiled_monitor_mode (MetaMonitorTiled *monitor_tiled,
|
||||
return mode;
|
||||
}
|
||||
|
||||
static int
|
||||
count_untiled_crtc_modes (MetaOutput *output)
|
||||
{
|
||||
int count;
|
||||
unsigned int i;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; i < output->n_modes; i++)
|
||||
{
|
||||
MetaCrtcMode *crtc_mode = output->modes[i];
|
||||
|
||||
if (!is_crtc_mode_tiled (output, crtc_mode))
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static MetaOutput *
|
||||
find_untiled_output (MetaMonitorTiled *monitor_tiled)
|
||||
{
|
||||
MetaMonitor *monitor = META_MONITOR (monitor_tiled);
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
MetaOutput *best_output;
|
||||
int best_untiled_crtc_mode_count;
|
||||
GList *l;
|
||||
|
||||
best_output = monitor_tiled->origin_output;
|
||||
best_untiled_crtc_mode_count =
|
||||
count_untiled_crtc_modes (monitor_tiled->origin_output);
|
||||
|
||||
for (l = monitor_priv->outputs; l; l = l->next)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
int untiled_crtc_mode_count;
|
||||
|
||||
if (output == monitor_tiled->origin_output)
|
||||
continue;
|
||||
|
||||
untiled_crtc_mode_count = count_untiled_crtc_modes (output);
|
||||
if (untiled_crtc_mode_count > best_untiled_crtc_mode_count)
|
||||
{
|
||||
best_untiled_crtc_mode_count = untiled_crtc_mode_count;
|
||||
best_output = output;
|
||||
}
|
||||
}
|
||||
|
||||
return best_output;
|
||||
}
|
||||
|
||||
static void
|
||||
generate_untiled_monitor_modes (MetaMonitorTiled *monitor_tiled)
|
||||
{
|
||||
MetaMonitor *monitor = META_MONITOR (monitor_tiled);
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
MetaOutput *main_output;
|
||||
unsigned int i;
|
||||
|
||||
main_output = meta_monitor_get_main_output (monitor);
|
||||
|
||||
for (i = 0; i < main_output->n_modes; i++)
|
||||
{
|
||||
MetaCrtcMode *crtc_mode = main_output->modes[i];
|
||||
MetaMonitorMode *mode;
|
||||
|
||||
mode = create_untiled_monitor_mode (monitor_tiled,
|
||||
main_output,
|
||||
crtc_mode);
|
||||
if (!mode)
|
||||
continue;
|
||||
|
||||
monitor_priv->modes = g_list_append (monitor_priv->modes, mode);
|
||||
|
||||
if (is_monitor_mode_assigned (monitor, mode))
|
||||
{
|
||||
g_assert (!monitor_priv->current_mode);
|
||||
monitor_priv->current_mode = mode;
|
||||
}
|
||||
|
||||
if (!monitor_priv->preferred_mode &&
|
||||
crtc_mode == main_output->preferred_mode)
|
||||
monitor_priv->preferred_mode = mode;
|
||||
}
|
||||
}
|
||||
|
||||
static MetaMonitorMode *
|
||||
find_best_mode (MetaMonitor *monitor)
|
||||
{
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
MetaMonitorMode *best_mode = NULL;
|
||||
GList *l;
|
||||
|
||||
for (l = monitor_priv->modes; l; l = l->next)
|
||||
{
|
||||
MetaMonitorMode *mode = l->data;
|
||||
int area, best_area;
|
||||
|
||||
if (!best_mode)
|
||||
{
|
||||
best_mode = mode;
|
||||
continue;
|
||||
}
|
||||
|
||||
area = mode->spec.width * mode->spec.height;
|
||||
best_area = best_mode->spec.width * best_mode->spec.height;
|
||||
if (area > best_area)
|
||||
{
|
||||
best_mode = mode;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mode->spec.refresh_rate > best_mode->spec.refresh_rate)
|
||||
{
|
||||
best_mode = mode;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return best_mode;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_tiled_generate_modes (MetaMonitorTiled *monitor_tiled)
|
||||
{
|
||||
MetaMonitor *monitor = META_MONITOR (monitor_tiled);
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
MetaMonitorMode *mode;
|
||||
MetaOutput *main_output;
|
||||
unsigned int i;
|
||||
|
||||
mode = create_tiled_monitor_mode (monitor_tiled);
|
||||
monitor_priv->modes = g_list_append (monitor_priv->modes, mode);
|
||||
/*
|
||||
* Tiled monitors may look a bit different from each other, depending on the
|
||||
* monitor itself, the driver, etc.
|
||||
*
|
||||
* On some, the tiled modes will be the preferred CRTC modes, and running
|
||||
* untiled is done by only enabling (0, 0) tile. In this case, things are
|
||||
* pretty straight forward.
|
||||
*
|
||||
* Other times a monitor may have some bogus mode preferred on the main tile,
|
||||
* and an untiled mode preferred on the non-main tile, and there seems to be
|
||||
* no guarantee that the (0, 0) tile is the one that should drive the
|
||||
* non-tiled mode.
|
||||
*
|
||||
* To handle both these cases, the following hueristics are implemented:
|
||||
*
|
||||
* 1) Find all the tiled CRTC modes of the (0, 0) tile, and create tiled
|
||||
* monitor modes for all tiles based on these.
|
||||
* 2) If there is any tiled monitor mode combination where all CRTC modes
|
||||
* are the preferred ones, that one is marked as preferred.
|
||||
* 3) If there is no preferred mode determined so far, assume the tiled
|
||||
* monitor mode with the highest refresh rate is preferred.
|
||||
* 4) Find the tile with highest number of untiled CRTC modes available,
|
||||
* assume this is the one driving the monitor in untiled mode, and
|
||||
* create monitor modes for all untiled CRTC modes of that tile. If
|
||||
* there is still no preferred mode, set any untiled mode as preferred
|
||||
* if the CRTC mode is marked as such.
|
||||
* 5) If at this point there is still no preferred mode, just pick the one
|
||||
* with the highest number of pixels and highest refresh rate.
|
||||
*
|
||||
* Note that this ignores the preference if the preference is a non-tiled
|
||||
* mode. This seems to be the case on some systems, where the user tends to
|
||||
* manually set up the tiled mode anyway.
|
||||
*/
|
||||
|
||||
monitor_priv->preferred_mode = mode;
|
||||
generate_tiled_monitor_modes (monitor_tiled);
|
||||
|
||||
if (is_monitor_mode_assigned (monitor, mode))
|
||||
monitor_priv->current_mode = mode;
|
||||
if (!monitor_priv->preferred_mode)
|
||||
g_warning ("Tiled monitor on %s didn't have any tiled modes",
|
||||
monitor_priv->spec->connector);
|
||||
|
||||
main_output = meta_monitor_get_main_output (monitor);
|
||||
for (i = 0; i < main_output->n_modes; i++)
|
||||
generate_untiled_monitor_modes (monitor_tiled);
|
||||
|
||||
if (!monitor_priv->preferred_mode)
|
||||
{
|
||||
MetaCrtcMode *crtc_mode = main_output->modes[i];
|
||||
|
||||
mode = create_untiled_monitor_mode (monitor_tiled,
|
||||
main_output,
|
||||
crtc_mode);
|
||||
if (mode)
|
||||
{
|
||||
monitor_priv->modes = g_list_append (monitor_priv->modes, mode);
|
||||
|
||||
if (is_monitor_mode_assigned (monitor, mode))
|
||||
{
|
||||
g_assert (!monitor_priv->current_mode);
|
||||
monitor_priv->current_mode = mode;
|
||||
}
|
||||
}
|
||||
g_warning ("Tiled monitor on %s didn't have a valid preferred mode",
|
||||
monitor_priv->spec->connector);
|
||||
monitor_priv->preferred_mode = find_best_mode (monitor);
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,17 +931,22 @@ meta_monitor_tiled_new (MetaMonitorManager *monitor_manager,
|
||||
monitor = META_MONITOR (monitor_tiled);
|
||||
monitor_priv = meta_monitor_get_instance_private (monitor);
|
||||
|
||||
monitor_priv->monitor_manager = monitor_manager;
|
||||
|
||||
monitor_tiled->tile_group_id = output->tile_info.group_id;
|
||||
monitor_priv->winsys_id = output->winsys_id;
|
||||
|
||||
monitor_tiled->main_output = output;
|
||||
monitor_tiled->origin_output = output;
|
||||
add_tiled_monitor_outputs (monitor_manager, monitor_tiled);
|
||||
|
||||
monitor_tiled->main_output = find_untiled_output (monitor_tiled);
|
||||
|
||||
meta_monitor_generate_spec (monitor);
|
||||
|
||||
meta_monitor_manager_tiled_monitor_added (monitor_manager,
|
||||
META_MONITOR (monitor_tiled));
|
||||
|
||||
meta_monitor_tiled_generate_modes (monitor_tiled);
|
||||
meta_monitor_generate_id (monitor);
|
||||
|
||||
return monitor_tiled;
|
||||
}
|
||||
@ -695,9 +960,8 @@ meta_monitor_tiled_get_main_output (MetaMonitor *monitor)
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_tiled_derive_dimensions (MetaMonitor *monitor,
|
||||
int *out_width,
|
||||
int *out_height)
|
||||
meta_monitor_derived_derive_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout)
|
||||
{
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
@ -721,20 +985,31 @@ meta_monitor_tiled_derive_dimensions (MetaMonitor *monitor,
|
||||
max_y = MAX (output->crtc->rect.y + output->crtc->rect.height, max_y);
|
||||
}
|
||||
|
||||
*out_width = max_x - min_x;
|
||||
*out_height = max_y - min_y;
|
||||
*layout = (MetaRectangle) {
|
||||
.x = min_x,
|
||||
.y = min_y,
|
||||
.width = max_x - min_x,
|
||||
.height = max_y - min_y
|
||||
};
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_monitor_tiled_get_suggested_position (MetaMonitor *monitor,
|
||||
int *x,
|
||||
int *y)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_tiled_finalize (GObject *object)
|
||||
{
|
||||
MetaMonitorTiled *monitor_tiled = META_MONITOR_TILED (object);
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaMonitorManager *monitor_manager =
|
||||
meta_backend_get_monitor_manager (backend);
|
||||
MetaMonitor *monitor = META_MONITOR (object);
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
|
||||
meta_monitor_manager_tiled_monitor_removed (monitor_manager,
|
||||
META_MONITOR (monitor_tiled));
|
||||
meta_monitor_manager_tiled_monitor_removed (monitor_priv->monitor_manager,
|
||||
monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -751,7 +1026,8 @@ meta_monitor_tiled_class_init (MetaMonitorTiledClass *klass)
|
||||
object_class->finalize = meta_monitor_tiled_finalize;
|
||||
|
||||
monitor_class->get_main_output = meta_monitor_tiled_get_main_output;
|
||||
monitor_class->derive_dimensions = meta_monitor_tiled_derive_dimensions;
|
||||
monitor_class->derive_layout = meta_monitor_derived_derive_layout;
|
||||
monitor_class->get_suggested_position = meta_monitor_tiled_get_suggested_position;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -65,9 +65,11 @@ struct _MetaMonitorClass
|
||||
GObjectClass parent_class;
|
||||
|
||||
MetaOutput * (* get_main_output) (MetaMonitor *monitor);
|
||||
void (* derive_dimensions) (MetaMonitor *monitor,
|
||||
int *width,
|
||||
int *height);
|
||||
void (* derive_layout) (MetaMonitor *monitor,
|
||||
MetaRectangle *layout);
|
||||
gboolean (* get_suggested_position) (MetaMonitor *monitor,
|
||||
int *width,
|
||||
int *height);
|
||||
};
|
||||
|
||||
#define META_TYPE_MONITOR_NORMAL (meta_monitor_normal_get_type ())
|
||||
@ -83,7 +85,8 @@ G_DECLARE_FINAL_TYPE (MetaMonitorTiled, meta_monitor_tiled,
|
||||
MetaMonitorTiled * meta_monitor_tiled_new (MetaMonitorManager *monitor_manager,
|
||||
MetaOutput *main_output);
|
||||
|
||||
MetaMonitorNormal * meta_monitor_normal_new (MetaOutput *output);
|
||||
MetaMonitorNormal * meta_monitor_normal_new (MetaMonitorManager *monitor_manager,
|
||||
MetaOutput *output);
|
||||
|
||||
MetaMonitorSpec * meta_monitor_get_spec (MetaMonitor *monitor);
|
||||
|
||||
@ -103,9 +106,8 @@ void meta_monitor_get_current_resolution (MetaMonitor *monitor,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
void meta_monitor_derive_dimensions (MetaMonitor *monitor,
|
||||
int *width,
|
||||
int *height);
|
||||
void meta_monitor_derive_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout);
|
||||
|
||||
void meta_monitor_get_physical_dimensions (MetaMonitor *monitor,
|
||||
int *width_mm,
|
||||
|
@ -121,6 +121,25 @@ meta_input_settings_native_set_tap_enabled (MetaInputSettings *settings,
|
||||
LIBINPUT_CONFIG_TAP_DISABLED);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_native_set_disable_while_typing (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean enabled)
|
||||
{
|
||||
struct libinput_device *libinput_device;
|
||||
|
||||
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
|
||||
|
||||
if (!libinput_device)
|
||||
return;
|
||||
|
||||
if (libinput_device_config_dwt_is_available (libinput_device))
|
||||
libinput_device_config_dwt_set_enabled (libinput_device,
|
||||
enabled ?
|
||||
LIBINPUT_CONFIG_DWT_ENABLED :
|
||||
LIBINPUT_CONFIG_DWT_DISABLED);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_native_set_invert_scroll (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
@ -432,8 +451,18 @@ meta_input_settings_native_set_tablet_area (MetaInputSettings *settings,
|
||||
gdouble padding_bottom)
|
||||
{
|
||||
struct libinput_device *libinput_device;
|
||||
gfloat matrix[6] = { 1. - (padding_left + padding_right), 0., padding_left,
|
||||
0., 1. - (padding_top + padding_bottom), padding_top };
|
||||
gfloat scale_x;
|
||||
gfloat scale_y;
|
||||
gfloat offset_x;
|
||||
gfloat offset_y;
|
||||
|
||||
scale_x = 1. / (1. - (padding_left + padding_right));
|
||||
scale_y = 1. / (1. - (padding_top + padding_bottom));
|
||||
offset_x = -padding_left * scale_x;
|
||||
offset_y = -padding_top * scale_y;
|
||||
|
||||
gfloat matrix[6] = { scale_x, 0., offset_x,
|
||||
0., scale_y, offset_y };
|
||||
|
||||
libinput_device = clutter_evdev_input_device_get_libinput_device (device);
|
||||
if (!libinput_device ||
|
||||
@ -507,6 +536,7 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
|
||||
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;
|
||||
input_settings_class->set_disable_while_typing = meta_input_settings_native_set_disable_while_typing;
|
||||
|
||||
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;
|
||||
|
@ -188,9 +188,22 @@ on_evdev_device_open (const char *path,
|
||||
/* Allow readonly access to sysfs */
|
||||
if (g_str_has_prefix (path, "/sys/"))
|
||||
{
|
||||
fd = open (path, flags);
|
||||
if (fd >= 0)
|
||||
g_hash_table_add (self->sysfs_fds, GINT_TO_POINTER (fd));
|
||||
do
|
||||
{
|
||||
fd = open (path, flags);
|
||||
}
|
||||
while (fd < 0 && errno == EINTR);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_FILE_ERROR,
|
||||
g_file_error_from_errno (errno),
|
||||
"Could not open /sys file: %s: %m", path);
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_hash_table_add (self->sysfs_fds, GINT_TO_POINTER (fd));
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
@ -189,9 +189,14 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean enabled)
|
||||
{
|
||||
ClutterInputDeviceType device_type;
|
||||
guchar value;
|
||||
|
||||
if (clutter_input_device_get_device_type (device) == CLUTTER_TABLET_DEVICE)
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
|
||||
if (device_type == CLUTTER_TABLET_DEVICE ||
|
||||
device_type == CLUTTER_PEN_DEVICE ||
|
||||
device_type == CLUTTER_ERASER_DEVICE)
|
||||
{
|
||||
value = enabled ? 3 : 0;
|
||||
change_property (device, "Wacom Rotation",
|
||||
@ -205,6 +210,17 @@ meta_input_settings_x11_set_left_handed (MetaInputSettings *settings,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_x11_set_disable_while_typing (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
gboolean enabled)
|
||||
{
|
||||
guchar value = (enabled) ? 1 : 0;
|
||||
|
||||
change_property (device, "libinput Disable While Typing Enabled",
|
||||
XA_INTEGER, 8, &value, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_x11_set_tap_enabled (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
@ -535,10 +551,21 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
|
||||
g_warning ("Could not set tablet mapping for %s",
|
||||
clutter_input_device_get_device_name (device));
|
||||
}
|
||||
else
|
||||
{
|
||||
ClutterInputDeviceMapping dev_mapping;
|
||||
|
||||
dev_mapping = (mapping == G_DESKTOP_TABLET_MAPPING_ABSOLUTE) ?
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE :
|
||||
CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE;
|
||||
clutter_input_device_set_mapping_mode (device, dev_mapping);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
device_query_area (ClutterInputDevice *device,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
@ -564,9 +591,15 @@ device_query_area (ClutterInputDevice *device,
|
||||
if (valuator->type != XIValuatorClass)
|
||||
continue;
|
||||
if (valuator->label == abs_x)
|
||||
*width = valuator->max - valuator->min;
|
||||
{
|
||||
*x = valuator->min;
|
||||
*width = valuator->max - valuator->min;
|
||||
}
|
||||
else if (valuator->label == abs_y)
|
||||
*height = valuator->max - valuator->min;
|
||||
{
|
||||
*y = valuator->min;
|
||||
*height = valuator->max - valuator->min;
|
||||
}
|
||||
}
|
||||
|
||||
XIFreeDeviceInfo (info);
|
||||
@ -590,15 +623,15 @@ meta_input_settings_x11_set_tablet_area (MetaInputSettings *settings,
|
||||
gdouble padding_top,
|
||||
gdouble padding_bottom)
|
||||
{
|
||||
gint32 width, height, area[4] = { 0 };
|
||||
gint32 x, y, width, height, area[4] = { 0 };
|
||||
|
||||
if (!device_query_area (device, &width, &height))
|
||||
if (!device_query_area (device, &x, &y, &width, &height))
|
||||
return;
|
||||
|
||||
area[0] = width * padding_left;
|
||||
area[1] = height * padding_top;
|
||||
area[2] = width - (width * padding_right);
|
||||
area[2] = height - (height * padding_bottom);
|
||||
area[0] = (width * padding_left) + x;
|
||||
area[1] = (height * padding_top) + y;
|
||||
area[2] = width - (width * padding_right) + x;
|
||||
area[3] = height - (height * padding_bottom) + y;
|
||||
update_tablet_area (settings, device, area);
|
||||
}
|
||||
|
||||
@ -608,9 +641,9 @@ meta_input_settings_x11_set_tablet_keep_aspect (MetaInputSettings *settings,
|
||||
MetaLogicalMonitor *logical_monitor,
|
||||
gboolean keep_aspect)
|
||||
{
|
||||
gint32 width, height, dev_width, dev_height, area[4] = { 0 };
|
||||
gint32 width, height, dev_x, dev_y, dev_width, dev_height, area[4] = { 0 };
|
||||
|
||||
if (!device_query_area (device, &dev_width, &dev_height))
|
||||
if (!device_query_area (device, &dev_x, &dev_y, &dev_width, &dev_height))
|
||||
return;
|
||||
|
||||
if (keep_aspect)
|
||||
@ -642,8 +675,10 @@ meta_input_settings_x11_set_tablet_keep_aspect (MetaInputSettings *settings,
|
||||
dev_height = dev_width / aspect_ratio;
|
||||
}
|
||||
|
||||
area[2] = dev_width;
|
||||
area[3] = dev_height;
|
||||
area[0] = dev_x;
|
||||
area[1] = dev_y;
|
||||
area[2] = dev_width + dev_x;
|
||||
area[3] = dev_height + dev_y;
|
||||
update_tablet_area (settings, device, area);
|
||||
}
|
||||
|
||||
@ -744,6 +779,7 @@ meta_input_settings_x11_class_init (MetaInputSettingsX11Class *klass)
|
||||
input_settings_class->set_speed = meta_input_settings_x11_set_speed;
|
||||
input_settings_class->set_left_handed = meta_input_settings_x11_set_left_handed;
|
||||
input_settings_class->set_tap_enabled = meta_input_settings_x11_set_tap_enabled;
|
||||
input_settings_class->set_disable_while_typing = meta_input_settings_x11_set_disable_while_typing;
|
||||
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;
|
||||
|
@ -348,7 +348,7 @@ output_get_backlight_limits_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
|
||||
{
|
||||
Atom atom;
|
||||
xcb_connection_t *xcb_conn;
|
||||
g_autofree xcb_randr_query_output_property_reply_t *reply;
|
||||
g_autofree xcb_randr_query_output_property_reply_t *reply = NULL;
|
||||
|
||||
atom = XInternAtom (manager_xrandr->xdisplay, "Backlight", False);
|
||||
|
||||
|
@ -388,7 +388,9 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
|
||||
meta_display_sync_wayland_input_focus (display);
|
||||
meta_display_cancel_touch (display);
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
meta_dnd_wayland_handle_begin_modal (compositor);
|
||||
#endif
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -418,7 +420,10 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
|
||||
meta_backend_ungrab_device (backend, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp);
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_display_sync_wayland_input_focus (display);
|
||||
{
|
||||
meta_dnd_wayland_handle_end_modal (compositor);
|
||||
meta_display_sync_wayland_input_focus (display);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -155,7 +155,7 @@ file_loaded (GObject *source_object,
|
||||
CoglError *catch_error = NULL;
|
||||
GTask *task;
|
||||
CoglTexture *texture;
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkPixbuf *pixbuf, *rotated;
|
||||
int width, height, row_stride;
|
||||
guchar *pixels;
|
||||
gboolean has_alpha;
|
||||
@ -173,6 +173,13 @@ file_loaded (GObject *source_object,
|
||||
goto out;
|
||||
}
|
||||
|
||||
rotated = gdk_pixbuf_apply_embedded_orientation (pixbuf);
|
||||
if (rotated != NULL)
|
||||
{
|
||||
g_object_unref (pixbuf);
|
||||
pixbuf = rotated;
|
||||
}
|
||||
|
||||
width = gdk_pixbuf_get_width (pixbuf);
|
||||
height = gdk_pixbuf_get_height (pixbuf);
|
||||
row_stride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
|
@ -218,20 +218,9 @@ meta_dnd_wayland_end_notify (ClutterActor *actor,
|
||||
MetaDnd *dnd)
|
||||
{
|
||||
MetaDndPrivate *priv = meta_dnd_get_instance_private (dnd);
|
||||
unsigned int i;
|
||||
|
||||
meta_wayland_data_device_end_drag (&priv->wl_compositor->seat->data_device);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (priv->handler_id); i++)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->compositor->stage, priv->handler_id[i]);
|
||||
priv->handler_id[i] = 0;
|
||||
}
|
||||
|
||||
priv->compositor = NULL;
|
||||
priv->wl_compositor = NULL;
|
||||
|
||||
meta_dnd_notify_dnd_leave (dnd);
|
||||
meta_dnd_wayland_handle_end_modal (priv->compositor);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -286,4 +275,26 @@ meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor)
|
||||
meta_dnd_notify_dnd_enter (dnd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_dnd_wayland_handle_end_modal (MetaCompositor *compositor)
|
||||
{
|
||||
MetaDnd *dnd = meta_backend_get_dnd (meta_get_backend ());
|
||||
MetaDndPrivate *priv = meta_dnd_get_instance_private (dnd);
|
||||
unsigned int i;
|
||||
|
||||
if (!priv->compositor)
|
||||
return;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (priv->handler_id); i++)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->compositor->stage, priv->handler_id[i]);
|
||||
priv->handler_id[i] = 0;
|
||||
}
|
||||
|
||||
priv->compositor = NULL;
|
||||
priv->wl_compositor = NULL;
|
||||
|
||||
meta_dnd_notify_dnd_leave (dnd);
|
||||
}
|
||||
#endif
|
||||
|
@ -3160,18 +3160,14 @@ meta_display_get_pad_action_label (MetaDisplay *display,
|
||||
MetaPadActionType action_type,
|
||||
guint action_number)
|
||||
{
|
||||
MetaInputSettings *settings;
|
||||
gchar *label;
|
||||
|
||||
/* First, lookup the action, as imposed by settings */
|
||||
if (action_type == META_PAD_ACTION_BUTTON)
|
||||
{
|
||||
MetaInputSettings *settings;
|
||||
|
||||
settings = meta_backend_get_input_settings (meta_get_backend ());
|
||||
label = meta_input_settings_get_pad_button_action_label (settings, pad, action_number);
|
||||
if (label)
|
||||
return label;
|
||||
}
|
||||
settings = meta_backend_get_input_settings (meta_get_backend ());
|
||||
label = meta_input_settings_get_pad_action_label (settings, pad, action_type, action_number);
|
||||
if (label)
|
||||
return label;
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
/* Second, if this wayland, lookup the actions set by the clients */
|
||||
|
@ -220,10 +220,12 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
|
||||
if (!display->current_pad_osd &&
|
||||
(event->type == CLUTTER_PAD_BUTTON_PRESS ||
|
||||
event->type == CLUTTER_PAD_BUTTON_RELEASE))
|
||||
event->type == CLUTTER_PAD_BUTTON_RELEASE ||
|
||||
event->type == CLUTTER_PAD_RING ||
|
||||
event->type == CLUTTER_PAD_STRIP))
|
||||
{
|
||||
if (meta_input_settings_handle_pad_button (meta_backend_get_input_settings (backend),
|
||||
&event->pad_button))
|
||||
if (meta_input_settings_handle_pad_event (meta_backend_get_input_settings (backend),
|
||||
event))
|
||||
{
|
||||
bypass_wayland = bypass_clutter = TRUE;
|
||||
goto out;
|
||||
|
@ -443,11 +443,13 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
|
||||
#endif /* HAVE_WAYLAND */
|
||||
*compositor_type = META_COMPOSITOR_TYPE_X11;
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (opt_nested)
|
||||
{
|
||||
*backend_gtype = META_TYPE_BACKEND_X11_NESTED;
|
||||
return;
|
||||
}
|
||||
#endif /* HAVE_WAYLAND */
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
if (opt_display_server)
|
||||
|
@ -1260,7 +1260,6 @@ update_num_workspaces (MetaScreen *screen,
|
||||
{
|
||||
MetaWorkspace *w = l->data;
|
||||
|
||||
g_assert (w->windows == NULL);
|
||||
meta_workspace_remove (w);
|
||||
}
|
||||
|
||||
|
@ -530,7 +530,8 @@ struct _MetaWindowClass
|
||||
cairo_surface_t **icon,
|
||||
cairo_surface_t **mini_icon);
|
||||
uint32_t (*get_client_pid) (MetaWindow *window);
|
||||
void (*update_main_monitor) (MetaWindow *window);
|
||||
void (*update_main_monitor) (MetaWindow *window,
|
||||
gboolean user_op);
|
||||
void (*main_monitor_changed) (MetaWindow *window,
|
||||
const MetaLogicalMonitor *old);
|
||||
};
|
||||
|
@ -2957,7 +2957,11 @@ unmaximize_window_before_freeing (MetaWindow *window)
|
||||
window->rect = window->saved_rect;
|
||||
set_net_wm_state (window);
|
||||
}
|
||||
else if (window->screen->closing) /* See bug #358042 */
|
||||
else if (window->screen->closing /* See bug #358042 */
|
||||
#ifdef HAVE_WAYLAND
|
||||
&& !meta_is_wayland_compositor ()
|
||||
#endif
|
||||
)
|
||||
{
|
||||
/* Do NOT update net_wm_state: this screen is closing,
|
||||
* it likely will be managed by another window manager
|
||||
@ -3588,7 +3592,7 @@ meta_window_update_monitor (MetaWindow *window,
|
||||
const MetaLogicalMonitor *old;
|
||||
|
||||
old = window->monitor;
|
||||
META_WINDOW_GET_CLASS (window)->update_main_monitor (window);
|
||||
META_WINDOW_GET_CLASS (window)->update_main_monitor (window, user_op);
|
||||
if (old != window->monitor)
|
||||
{
|
||||
meta_window_on_all_workspaces_changed (window);
|
||||
@ -5577,6 +5581,60 @@ update_move_timeout (gpointer data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
update_move_maybe_tile (MetaWindow *window,
|
||||
int shake_threshold,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaMonitorManager *monitor_manager =
|
||||
meta_backend_get_monitor_manager (backend);
|
||||
MetaLogicalMonitor *logical_monitor;
|
||||
MetaRectangle work_area;
|
||||
|
||||
/* For side-by-side tiling we are interested in the inside vertical
|
||||
* edges of the work area of the monitor where the pointer is located,
|
||||
* and in the outside top edge for maximized tiling.
|
||||
*
|
||||
* For maximized tiling we use the outside edge instead of the
|
||||
* inside edge, because we don't want to force users to maximize
|
||||
* windows they are placing near the top of their screens.
|
||||
*
|
||||
* The "current" idea of meta_window_get_work_area_current_monitor() and
|
||||
* meta_screen_get_current_monitor() is slightly different: the former
|
||||
* refers to the monitor which contains the largest part of the window,
|
||||
* the latter to the one where the pointer is located.
|
||||
*/
|
||||
logical_monitor =
|
||||
meta_monitor_manager_get_logical_monitor_at (monitor_manager, x, y);
|
||||
if (!logical_monitor)
|
||||
return;
|
||||
|
||||
meta_window_get_work_area_for_monitor (window,
|
||||
logical_monitor->number,
|
||||
&work_area);
|
||||
|
||||
/* Check if the cursor is in a position which triggers tiling
|
||||
* and set tile_mode accordingly.
|
||||
*/
|
||||
if (meta_window_can_tile_side_by_side (window) &&
|
||||
x >= logical_monitor->rect.x && x < (work_area.x + shake_threshold))
|
||||
window->tile_mode = META_TILE_LEFT;
|
||||
else if (meta_window_can_tile_side_by_side (window) &&
|
||||
x >= work_area.x + work_area.width - shake_threshold &&
|
||||
x < (logical_monitor->rect.x + logical_monitor->rect.width))
|
||||
window->tile_mode = META_TILE_RIGHT;
|
||||
else if (meta_window_can_tile_maximized (window) &&
|
||||
y >= logical_monitor->rect.y && y <= work_area.y)
|
||||
window->tile_mode = META_TILE_MAXIMIZED;
|
||||
else
|
||||
window->tile_mode = META_TILE_NONE;
|
||||
|
||||
if (window->tile_mode != META_TILE_NONE)
|
||||
window->tile_monitor_number = logical_monitor->number;
|
||||
}
|
||||
|
||||
static void
|
||||
update_move (MetaWindow *window,
|
||||
gboolean snap,
|
||||
@ -5632,49 +5690,7 @@ update_move (MetaWindow *window,
|
||||
!META_WINDOW_MAXIMIZED (window) &&
|
||||
!META_WINDOW_TILED_SIDE_BY_SIDE (window))
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaMonitorManager *monitor_manager =
|
||||
meta_backend_get_monitor_manager (backend);
|
||||
const MetaLogicalMonitor *monitor;
|
||||
MetaRectangle work_area;
|
||||
|
||||
/* For side-by-side tiling we are interested in the inside vertical
|
||||
* edges of the work area of the monitor where the pointer is located,
|
||||
* and in the outside top edge for maximized tiling.
|
||||
*
|
||||
* For maximized tiling we use the outside edge instead of the
|
||||
* inside edge, because we don't want to force users to maximize
|
||||
* windows they are placing near the top of their screens.
|
||||
*
|
||||
* The "current" idea of meta_window_get_work_area_current_monitor() and
|
||||
* meta_screen_get_current_monitor() is slightly different: the former
|
||||
* refers to the monitor which contains the largest part of the window,
|
||||
* the latter to the one where the pointer is located.
|
||||
*/
|
||||
monitor = meta_monitor_manager_get_logical_monitor_at (monitor_manager,
|
||||
x, y);
|
||||
meta_window_get_work_area_for_monitor (window,
|
||||
monitor->number,
|
||||
&work_area);
|
||||
|
||||
/* Check if the cursor is in a position which triggers tiling
|
||||
* and set tile_mode accordingly.
|
||||
*/
|
||||
if (meta_window_can_tile_side_by_side (window) &&
|
||||
x >= monitor->rect.x && x < (work_area.x + shake_threshold))
|
||||
window->tile_mode = META_TILE_LEFT;
|
||||
else if (meta_window_can_tile_side_by_side (window) &&
|
||||
x >= work_area.x + work_area.width - shake_threshold &&
|
||||
x < (monitor->rect.x + monitor->rect.width))
|
||||
window->tile_mode = META_TILE_RIGHT;
|
||||
else if (meta_window_can_tile_maximized (window) &&
|
||||
y >= monitor->rect.y && y <= work_area.y)
|
||||
window->tile_mode = META_TILE_MAXIMIZED;
|
||||
else
|
||||
window->tile_mode = META_TILE_NONE;
|
||||
|
||||
if (window->tile_mode != META_TILE_NONE)
|
||||
window->tile_monitor_number = monitor->number;
|
||||
update_move_maybe_tile (window, shake_threshold, x, y);
|
||||
}
|
||||
|
||||
/* shake loose (unmaximize) maximized or tiled window if dragged beyond
|
||||
|
22
src/tests/monitor-configs/tiled-custom-resolution.xml
Normal file
22
src/tests/monitor-configs/tiled-custom-resolution.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<monitors version="2">
|
||||
<configuration>
|
||||
<logicalmonitor>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<primary>yes</primary>
|
||||
<monitor>
|
||||
<monitorspec>
|
||||
<connector>DP-2</connector>
|
||||
<vendor>MetaProduct's Inc.</vendor>
|
||||
<product>MetaMonitor</product>
|
||||
<serial>0x123456</serial>
|
||||
</monitorspec>
|
||||
<mode>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
<rate>60</rate>
|
||||
</mode>
|
||||
</monitor>
|
||||
</logicalmonitor>
|
||||
</configuration>
|
||||
</monitors>
|
@ -337,17 +337,29 @@ check_monitor_mode (MetaMonitor *monitor,
|
||||
CheckMonitorModeData *data = user_data;
|
||||
MetaMonitorManager *monitor_manager = data->monitor_manager;
|
||||
MetaOutput *output;
|
||||
int crtc_mode_index;
|
||||
MetaCrtcMode *crtc_mode;
|
||||
|
||||
output = output_from_winsys_id (monitor_manager,
|
||||
data->expect_crtc_mode_iter->output);
|
||||
crtc_mode = &monitor_manager->modes[data->expect_crtc_mode_iter->crtc_mode];
|
||||
crtc_mode_index = data->expect_crtc_mode_iter->crtc_mode;
|
||||
if (crtc_mode_index == -1)
|
||||
crtc_mode = NULL;
|
||||
else
|
||||
crtc_mode = &monitor_manager->modes[crtc_mode_index];
|
||||
|
||||
g_assert (monitor_crtc_mode->output == output);
|
||||
g_assert (monitor_crtc_mode->crtc_mode == crtc_mode);
|
||||
|
||||
g_assert_cmpint (monitor_crtc_mode->x, ==, data->expect_crtc_mode_iter->x);
|
||||
g_assert_cmpint (monitor_crtc_mode->y, ==, data->expect_crtc_mode_iter->y);
|
||||
if (crtc_mode)
|
||||
{
|
||||
g_assert_cmpint (monitor_crtc_mode->x,
|
||||
==,
|
||||
data->expect_crtc_mode_iter->x);
|
||||
g_assert_cmpint (monitor_crtc_mode->y,
|
||||
==,
|
||||
data->expect_crtc_mode_iter->y);
|
||||
}
|
||||
|
||||
data->expect_crtc_mode_iter++;
|
||||
|
||||
@ -368,8 +380,11 @@ check_current_monitor_mode (MetaMonitor *monitor,
|
||||
output = output_from_winsys_id (monitor_manager,
|
||||
data->expect_crtc_mode_iter->output);
|
||||
|
||||
g_assert_nonnull (output->crtc);
|
||||
g_assert (monitor_crtc_mode->crtc_mode == output->crtc->current_mode);
|
||||
if (data->expect_crtc_mode_iter->crtc_mode != -1)
|
||||
{
|
||||
g_assert_nonnull (output->crtc);
|
||||
g_assert (monitor_crtc_mode->crtc_mode == output->crtc->current_mode);
|
||||
}
|
||||
|
||||
data->expect_crtc_mode_iter++;
|
||||
|
||||
@ -459,7 +474,8 @@ check_logical_monitor (MonitorTestCase *test_case,
|
||||
primary_output = output;
|
||||
}
|
||||
|
||||
g_assert (output->crtc->logical_monitor == logical_monitor);
|
||||
g_assert (!output->crtc ||
|
||||
output->crtc->logical_monitor == logical_monitor);
|
||||
g_assert_cmpint (logical_monitor->is_presentation,
|
||||
==,
|
||||
output->is_presentation);
|
||||
@ -583,6 +599,10 @@ check_monitor_configuration (MonitorTestCase *test_case)
|
||||
expected_current_mode_index)->data;
|
||||
|
||||
g_assert (current_mode == expected_current_mode);
|
||||
if (current_mode)
|
||||
g_assert (meta_monitor_is_active (monitor));
|
||||
else
|
||||
g_assert (!meta_monitor_is_active (monitor));
|
||||
|
||||
if (current_mode)
|
||||
{
|
||||
@ -1237,6 +1257,329 @@ meta_test_monitor_tiled_linear_config (void)
|
||||
check_monitor_configuration (&test_case);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_test_monitor_tiled_non_preferred_linear_config (void)
|
||||
{
|
||||
MonitorTestCase test_case = {
|
||||
.setup = {
|
||||
.modes = {
|
||||
{
|
||||
.width = 640,
|
||||
.height = 480,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
{
|
||||
.width = 512,
|
||||
.height = 768,
|
||||
.refresh_rate = 120.0
|
||||
},
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
},
|
||||
.n_modes = 4,
|
||||
.outputs = {
|
||||
{
|
||||
.crtc = -1,
|
||||
.modes = { 0, 2 },
|
||||
.n_modes = 2,
|
||||
.preferred_mode = 1,
|
||||
.possible_crtcs = { 0 },
|
||||
.n_possible_crtcs = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
.tile_info = {
|
||||
.group_id = 1,
|
||||
.max_h_tiles = 2,
|
||||
.max_v_tiles = 1,
|
||||
.loc_h_tile = 0,
|
||||
.loc_v_tile = 0,
|
||||
.tile_w = 512,
|
||||
.tile_h = 768
|
||||
}
|
||||
},
|
||||
{
|
||||
.crtc = -1,
|
||||
.modes = { 1, 2, 3 },
|
||||
.n_modes = 3,
|
||||
.preferred_mode = 0,
|
||||
.possible_crtcs = { 1 },
|
||||
.n_possible_crtcs = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
.tile_info = {
|
||||
.group_id = 1,
|
||||
.max_h_tiles = 2,
|
||||
.max_v_tiles = 1,
|
||||
.loc_h_tile = 1,
|
||||
.loc_v_tile = 0,
|
||||
.tile_w = 512,
|
||||
.tile_h = 768
|
||||
}
|
||||
}
|
||||
},
|
||||
.n_outputs = 2,
|
||||
.crtcs = {
|
||||
{
|
||||
.current_mode = -1
|
||||
},
|
||||
{
|
||||
.current_mode = -1
|
||||
}
|
||||
},
|
||||
.n_crtcs = 2
|
||||
},
|
||||
|
||||
.expect = {
|
||||
.monitors = {
|
||||
{
|
||||
.outputs = { 0, 1 },
|
||||
.n_outputs = 2,
|
||||
.modes = {
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = 2
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 2,
|
||||
.x = 512
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = -1
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 1,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = -1
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 3,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
.n_modes = 3,
|
||||
.current_mode = 0,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
}
|
||||
},
|
||||
.n_monitors = 1,
|
||||
.logical_monitors = {
|
||||
{
|
||||
.monitors = { 0 },
|
||||
.n_monitors = 1,
|
||||
.layout = { .x = 0, .y = 0, .width = 1024, .height = 768 },
|
||||
.scale = 1
|
||||
},
|
||||
},
|
||||
.n_logical_monitors = 1,
|
||||
.primary_logical_monitor = 0,
|
||||
.n_outputs = 2,
|
||||
.crtcs = {
|
||||
{
|
||||
.current_mode = 2,
|
||||
},
|
||||
{
|
||||
.current_mode = 2,
|
||||
}
|
||||
},
|
||||
.n_crtcs = 2,
|
||||
.n_tiled_monitors = 1,
|
||||
.screen_width = 1024,
|
||||
.screen_height = 768,
|
||||
}
|
||||
};
|
||||
MetaMonitorTestSetup *test_setup;
|
||||
|
||||
if (!is_using_monitor_config_manager ())
|
||||
{
|
||||
g_test_skip ("Only the new monitor config manager handles this case.");
|
||||
return;
|
||||
}
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NO_STORED);
|
||||
emulate_hotplug (test_setup);
|
||||
check_monitor_configuration (&test_case);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_test_monitor_tiled_non_main_origin_linear_config (void)
|
||||
{
|
||||
MonitorTestCase test_case = {
|
||||
.setup = {
|
||||
.modes = {
|
||||
{
|
||||
.width = 400,
|
||||
.height = 600,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.refresh_rate = 30.0
|
||||
},
|
||||
},
|
||||
.n_modes = 2,
|
||||
.outputs = {
|
||||
{
|
||||
.crtc = -1,
|
||||
.modes = { 0, 1 },
|
||||
.n_modes = 2,
|
||||
.preferred_mode = 0,
|
||||
.possible_crtcs = { 0 },
|
||||
.n_possible_crtcs = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
.tile_info = {
|
||||
.group_id = 1,
|
||||
.max_h_tiles = 2,
|
||||
.max_v_tiles = 1,
|
||||
.loc_h_tile = 1,
|
||||
.loc_v_tile = 0,
|
||||
.tile_w = 400,
|
||||
.tile_h = 600
|
||||
}
|
||||
},
|
||||
{
|
||||
.crtc = -1,
|
||||
.modes = { 0 },
|
||||
.n_modes = 1,
|
||||
.preferred_mode = 0,
|
||||
.possible_crtcs = { 1 },
|
||||
.n_possible_crtcs = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
.tile_info = {
|
||||
.group_id = 1,
|
||||
.max_h_tiles = 2,
|
||||
.max_v_tiles = 1,
|
||||
.loc_h_tile = 0,
|
||||
.loc_v_tile = 0,
|
||||
.tile_w = 400,
|
||||
.tile_h = 600
|
||||
}
|
||||
}
|
||||
},
|
||||
.n_outputs = 2,
|
||||
.crtcs = {
|
||||
{
|
||||
.current_mode = -1
|
||||
},
|
||||
{
|
||||
.current_mode = -1
|
||||
}
|
||||
},
|
||||
.n_crtcs = 2
|
||||
},
|
||||
|
||||
.expect = {
|
||||
.monitors = {
|
||||
{
|
||||
.outputs = { 0, 1 },
|
||||
.n_outputs = 2,
|
||||
.modes = {
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = 0,
|
||||
.x = 400,
|
||||
.y = 0
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = 1
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = -1,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
.n_modes = 2,
|
||||
.current_mode = 0,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
}
|
||||
},
|
||||
.n_monitors = 1,
|
||||
.logical_monitors = {
|
||||
{
|
||||
.monitors = { 0 },
|
||||
.n_monitors = 1,
|
||||
.layout = { .x = 0, .y = 0, .width = 800, .height = 600 },
|
||||
.scale = 1
|
||||
},
|
||||
},
|
||||
.n_logical_monitors = 1,
|
||||
.primary_logical_monitor = 0,
|
||||
.n_outputs = 2,
|
||||
.crtcs = {
|
||||
{
|
||||
.current_mode = 0,
|
||||
},
|
||||
{
|
||||
.current_mode = 0,
|
||||
}
|
||||
},
|
||||
.n_crtcs = 2,
|
||||
.n_tiled_monitors = 1,
|
||||
.screen_width = 800,
|
||||
.screen_height = 600,
|
||||
}
|
||||
};
|
||||
MetaMonitorTestSetup *test_setup;
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NO_STORED);
|
||||
emulate_hotplug (test_setup);
|
||||
check_monitor_configuration (&test_case);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_test_monitor_hidpi_linear_config (void)
|
||||
{
|
||||
@ -2612,6 +2955,184 @@ meta_test_monitor_custom_underscanning_config (void)
|
||||
check_monitor_configuration (&test_case);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_test_monitor_custom_tiled_non_preferred_config (void)
|
||||
{
|
||||
MonitorTestCase test_case = {
|
||||
.setup = {
|
||||
.modes = {
|
||||
{
|
||||
.width = 640,
|
||||
.height = 480,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
{
|
||||
.width = 512,
|
||||
.height = 768,
|
||||
.refresh_rate = 120.0
|
||||
},
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.refresh_rate = 60.0
|
||||
},
|
||||
},
|
||||
.n_modes = 4,
|
||||
.outputs = {
|
||||
{
|
||||
.crtc = -1,
|
||||
.modes = { 0, 2 },
|
||||
.n_modes = 2,
|
||||
.preferred_mode = 1,
|
||||
.possible_crtcs = { 0 },
|
||||
.n_possible_crtcs = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
.tile_info = {
|
||||
.group_id = 1,
|
||||
.max_h_tiles = 2,
|
||||
.max_v_tiles = 1,
|
||||
.loc_h_tile = 0,
|
||||
.loc_v_tile = 0,
|
||||
.tile_w = 512,
|
||||
.tile_h = 768
|
||||
}
|
||||
},
|
||||
{
|
||||
.crtc = -1,
|
||||
.modes = { 1, 2, 3 },
|
||||
.n_modes = 3,
|
||||
.preferred_mode = 0,
|
||||
.possible_crtcs = { 1 },
|
||||
.n_possible_crtcs = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
.tile_info = {
|
||||
.group_id = 1,
|
||||
.max_h_tiles = 2,
|
||||
.max_v_tiles = 1,
|
||||
.loc_h_tile = 1,
|
||||
.loc_v_tile = 0,
|
||||
.tile_w = 512,
|
||||
.tile_h = 768
|
||||
}
|
||||
}
|
||||
},
|
||||
.n_outputs = 2,
|
||||
.crtcs = {
|
||||
{
|
||||
.current_mode = -1
|
||||
},
|
||||
{
|
||||
.current_mode = -1
|
||||
}
|
||||
},
|
||||
.n_crtcs = 2
|
||||
},
|
||||
|
||||
.expect = {
|
||||
.monitors = {
|
||||
{
|
||||
.outputs = { 0, 1 },
|
||||
.n_outputs = 2,
|
||||
.modes = {
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = 2
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 2,
|
||||
.x = 512
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.width = 800,
|
||||
.height = 600,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = -1
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 1,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
.width = 1024,
|
||||
.height = 768,
|
||||
.crtc_modes = {
|
||||
{
|
||||
.output = 0,
|
||||
.crtc_mode = -1
|
||||
},
|
||||
{
|
||||
.output = 1,
|
||||
.crtc_mode = 3,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
.n_modes = 3,
|
||||
.current_mode = 1,
|
||||
.width_mm = 222,
|
||||
.height_mm = 125,
|
||||
}
|
||||
},
|
||||
.n_monitors = 1,
|
||||
.logical_monitors = {
|
||||
{
|
||||
.monitors = { 0 },
|
||||
.n_monitors = 1,
|
||||
.layout = { .x = 0, .y = 0, .width = 800, .height = 600 },
|
||||
.scale = 1
|
||||
},
|
||||
},
|
||||
.n_logical_monitors = 1,
|
||||
.primary_logical_monitor = 0,
|
||||
.n_outputs = 2,
|
||||
.crtcs = {
|
||||
{
|
||||
.current_mode = -1,
|
||||
},
|
||||
{
|
||||
.current_mode = 1,
|
||||
}
|
||||
},
|
||||
.n_crtcs = 2,
|
||||
.n_tiled_monitors = 1,
|
||||
.screen_width = 800,
|
||||
.screen_height = 600,
|
||||
}
|
||||
};
|
||||
MetaMonitorTestSetup *test_setup;
|
||||
|
||||
if (!is_using_monitor_config_manager ())
|
||||
{
|
||||
g_test_skip ("Only the new monitor config manager handles this case.");
|
||||
return;
|
||||
}
|
||||
|
||||
test_setup = create_monitor_test_setup (&test_case,
|
||||
MONITOR_TEST_FLAG_NONE);
|
||||
set_custom_monitor_config ("tiled-custom-resolution.xml");
|
||||
emulate_hotplug (test_setup);
|
||||
|
||||
check_monitor_configuration (&test_case);
|
||||
}
|
||||
|
||||
void
|
||||
init_monitor_tests (void)
|
||||
{
|
||||
@ -2631,6 +3152,10 @@ init_monitor_tests (void)
|
||||
meta_test_monitor_preferred_linear_config);
|
||||
g_test_add_func ("/backends/monitor/tiled-linear-config",
|
||||
meta_test_monitor_tiled_linear_config);
|
||||
g_test_add_func ("/backends/monitor/tiled-non-preferred-linear-config",
|
||||
meta_test_monitor_tiled_non_preferred_linear_config);
|
||||
g_test_add_func ("/backends/monitor/tiled-non-main-origin-linear-config",
|
||||
meta_test_monitor_tiled_non_main_origin_linear_config);
|
||||
g_test_add_func ("/backends/monitor/hidpi-linear-config",
|
||||
meta_test_monitor_hidpi_linear_config);
|
||||
g_test_add_func ("/backends/monitor/suggested-config",
|
||||
@ -2654,4 +3179,6 @@ init_monitor_tests (void)
|
||||
meta_test_monitor_custom_primary_config);
|
||||
g_test_add_func ("/backends/monitor/custom/underscanning-config",
|
||||
meta_test_monitor_custom_underscanning_config);
|
||||
g_test_add_func ("/backends/monitor/custom/tiled-non-preferred-config",
|
||||
meta_test_monitor_custom_tiled_non_preferred_config);
|
||||
}
|
||||
|
@ -221,7 +221,6 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
|
||||
CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
|
||||
EGLContext egl_context = cogl_egl_context_get_egl_context (cogl_context);
|
||||
int format, width, height, y_inverted;
|
||||
CoglPixelFormat cogl_format;
|
||||
EGLImageKHR egl_image;
|
||||
@ -265,7 +264,9 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
egl_image = meta_egl_create_image (egl, egl_display, egl_context,
|
||||
/* The WL_bind_wayland_display spec states that EGL_NO_CONTEXT is to be used
|
||||
* in conjunction with the EGL_WAYLAND_BUFFER_WL target. */
|
||||
egl_image = meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT,
|
||||
EGL_WAYLAND_BUFFER_WL, buffer->resource,
|
||||
NULL,
|
||||
error);
|
||||
|
@ -86,6 +86,10 @@ static guint signals[LAST_SIGNAL];
|
||||
G_DEFINE_TYPE (MetaWaylandPointer, meta_wayland_pointer,
|
||||
META_TYPE_WAYLAND_INPUT_DEVICE)
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_set_current (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface);
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_reset_grab (MetaWaylandPointer *pointer);
|
||||
|
||||
@ -246,14 +250,6 @@ sync_focus_surface (MetaWaylandPointer *pointer)
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
|
||||
{
|
||||
MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_surface_listener);
|
||||
|
||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_send_frame (MetaWaylandPointer *pointer,
|
||||
struct wl_resource *resource)
|
||||
@ -488,8 +484,6 @@ meta_wayland_pointer_enable (MetaWaylandPointer *pointer)
|
||||
g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) meta_wayland_pointer_client_free);
|
||||
|
||||
pointer->focus_surface_listener.notify = pointer_handle_focus_surface_destroy;
|
||||
|
||||
pointer->cursor_surface = NULL;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
@ -520,6 +514,7 @@ meta_wayland_pointer_disable (MetaWaylandPointer *pointer)
|
||||
meta_wayland_pointer_cancel_grab (pointer);
|
||||
meta_wayland_pointer_reset_grab (pointer);
|
||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||
meta_wayland_pointer_set_current (pointer, NULL);
|
||||
|
||||
g_clear_pointer (&pointer->pointer_clients, g_hash_table_unref);
|
||||
pointer->cursor_surface = NULL;
|
||||
@ -547,11 +542,40 @@ count_buttons (const ClutterEvent *event)
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
current_surface_destroyed (MetaWaylandSurface *surface,
|
||||
MetaWaylandPointer *pointer)
|
||||
{
|
||||
meta_wayland_pointer_set_current (pointer, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_set_current (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
if (pointer->current)
|
||||
{
|
||||
g_signal_handler_disconnect (pointer->current,
|
||||
pointer->current_surface_destroyed_handler_id);
|
||||
pointer->current = NULL;
|
||||
}
|
||||
|
||||
if (surface)
|
||||
{
|
||||
pointer->current = surface;
|
||||
pointer->current_surface_destroyed_handler_id =
|
||||
g_signal_connect (surface, "destroy",
|
||||
G_CALLBACK (current_surface_destroyed),
|
||||
pointer);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
repick_for_event (MetaWaylandPointer *pointer,
|
||||
const ClutterEvent *for_event)
|
||||
{
|
||||
ClutterActor *actor;
|
||||
MetaWaylandSurface *surface;
|
||||
|
||||
if (for_event)
|
||||
actor = clutter_event_get_source (for_event);
|
||||
@ -559,10 +583,18 @@ repick_for_event (MetaWaylandPointer *pointer,
|
||||
actor = clutter_input_device_get_pointer_actor (pointer->device);
|
||||
|
||||
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
|
||||
pointer->current =
|
||||
meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
|
||||
{
|
||||
MetaSurfaceActorWayland *actor_wayland =
|
||||
META_SURFACE_ACTOR_WAYLAND (actor);
|
||||
|
||||
surface = meta_surface_actor_wayland_get_surface (actor_wayland);
|
||||
}
|
||||
else
|
||||
pointer->current = NULL;
|
||||
{
|
||||
surface = NULL;
|
||||
}
|
||||
|
||||
meta_wayland_pointer_set_current (pointer, surface);
|
||||
|
||||
sync_focus_surface (pointer);
|
||||
meta_wayland_pointer_update_cursor_surface (pointer);
|
||||
@ -815,6 +847,13 @@ meta_wayland_pointer_broadcast_leave (MetaWaylandPointer *pointer,
|
||||
meta_wayland_pointer_broadcast_frame (pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
focus_surface_destroyed (MetaWaylandSurface *surface,
|
||||
MetaWaylandPointer *pointer)
|
||||
{
|
||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
@ -838,7 +877,9 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
pointer->focus_client = NULL;
|
||||
}
|
||||
|
||||
wl_list_remove (&pointer->focus_surface_listener.link);
|
||||
g_signal_handler_disconnect (pointer->focus_surface,
|
||||
pointer->focus_surface_destroyed_handler_id);
|
||||
pointer->focus_surface_destroyed_handler_id = 0;
|
||||
pointer->focus_surface = NULL;
|
||||
}
|
||||
|
||||
@ -848,8 +889,11 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
ClutterPoint pos;
|
||||
|
||||
pointer->focus_surface = surface;
|
||||
wl_resource_add_destroy_listener (pointer->focus_surface->resource,
|
||||
&pointer->focus_surface_listener);
|
||||
|
||||
pointer->focus_surface_destroyed_handler_id =
|
||||
g_signal_connect_after (pointer->focus_surface, "destroy",
|
||||
G_CALLBACK (focus_surface_destroyed),
|
||||
pointer);
|
||||
|
||||
clutter_input_device_get_coords (pointer->device, NULL, &pos);
|
||||
|
||||
@ -1118,13 +1162,33 @@ meta_wayland_pointer_create_new_resource (MetaWaylandPointer *pointer,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
if (pointer->focus_surface == surface)
|
||||
return TRUE;
|
||||
|
||||
for (l = surface->subsurfaces; l; l = l->next)
|
||||
{
|
||||
MetaWaylandSurface *subsurface = l->data;
|
||||
|
||||
if (pointer_can_grab_surface (pointer, subsurface))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial)
|
||||
{
|
||||
return (pointer->grab_serial == serial &&
|
||||
pointer->focus_surface == surface);
|
||||
pointer_can_grab_surface (pointer, surface));
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -71,7 +71,7 @@ struct _MetaWaylandPointer
|
||||
GHashTable *pointer_clients;
|
||||
|
||||
MetaWaylandSurface *focus_surface;
|
||||
struct wl_listener focus_surface_listener;
|
||||
gulong focus_surface_destroyed_handler_id;
|
||||
guint32 focus_serial;
|
||||
guint32 click_serial;
|
||||
|
||||
@ -87,6 +87,7 @@ struct _MetaWaylandPointer
|
||||
|
||||
ClutterInputDevice *device;
|
||||
MetaWaylandSurface *current;
|
||||
gulong current_surface_destroyed_handler_id;
|
||||
|
||||
guint32 button_count;
|
||||
};
|
||||
|
@ -411,36 +411,58 @@ meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
ClutterEventSequence *sequence = NULL;
|
||||
gboolean can_grab_surface = FALSE;
|
||||
MetaWaylandCompositor *compositor;
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
GList *tools, *l;
|
||||
|
||||
compositor = meta_wayland_compositor_get_default ();
|
||||
tablet_seat = meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager, seat);
|
||||
tools = g_hash_table_get_values (tablet_seat->tools);
|
||||
|
||||
if (meta_wayland_seat_has_touch (seat))
|
||||
sequence = meta_wayland_touch_find_grab_sequence (seat->touch,
|
||||
surface,
|
||||
serial);
|
||||
|
||||
if (sequence)
|
||||
{
|
||||
meta_wayland_touch_get_press_coords (seat->touch, sequence, x, y);
|
||||
ClutterEventSequence *sequence;
|
||||
sequence = meta_wayland_touch_find_grab_sequence (seat->touch,
|
||||
surface,
|
||||
serial);
|
||||
if (sequence)
|
||||
{
|
||||
meta_wayland_touch_get_press_coords (seat->touch, sequence, x, y);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (meta_wayland_seat_has_pointer (seat) &&
|
||||
(!require_pressed || seat->pointer->button_count > 0))
|
||||
can_grab_surface = meta_wayland_pointer_can_grab_surface (seat->pointer,
|
||||
surface,
|
||||
serial);
|
||||
|
||||
if (can_grab_surface)
|
||||
if (meta_wayland_seat_has_pointer (seat))
|
||||
{
|
||||
if ((!require_pressed || seat->pointer->button_count > 0) &&
|
||||
meta_wayland_pointer_can_grab_surface (seat->pointer, surface, serial))
|
||||
{
|
||||
if (x)
|
||||
*x = seat->pointer->grab_x;
|
||||
if (y)
|
||||
*y = seat->pointer->grab_y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return sequence || can_grab_surface;
|
||||
for (l = tools; l; l = l->next)
|
||||
{
|
||||
MetaWaylandTabletTool *tool = l->data;
|
||||
|
||||
if ((!require_pressed || tool->button_count > 0) &&
|
||||
meta_wayland_tablet_tool_can_grab_surface (tool, surface, serial))
|
||||
{
|
||||
if (x)
|
||||
*x = tool->grab_x;
|
||||
if (y)
|
||||
*y = tool->grab_y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "meta-wayland-keyboard.h"
|
||||
#include "meta-wayland-touch.h"
|
||||
#include "meta-wayland-data-device.h"
|
||||
#include "meta-wayland-tablet-tool.h"
|
||||
|
||||
struct _MetaWaylandSeat
|
||||
{
|
||||
|
@ -448,7 +448,7 @@ meta_wayland_surface_unref_buffer_use_count (MetaWaylandSurface *surface)
|
||||
g_return_if_fail (buffer);
|
||||
|
||||
if (surface->buffer_ref.use_count == 0 && buffer->resource)
|
||||
wl_resource_queue_event (buffer->resource, WL_BUFFER_RELEASE);
|
||||
wl_buffer_send_release (buffer->resource);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -615,7 +615,7 @@ subsurface_role_get_toplevel (MetaWaylandSurfaceRole *surface_role)
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandSurface *parent = surface->sub.parent;
|
||||
|
||||
if (parent->role)
|
||||
if (parent && parent->role)
|
||||
return meta_wayland_surface_role_get_toplevel (parent->role);
|
||||
else
|
||||
return NULL;
|
||||
|
@ -572,9 +572,15 @@ meta_wayland_tablet_tool_account_button (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (event->type == CLUTTER_BUTTON_PRESS)
|
||||
tool->pressed_buttons |= 1 << (event->button.button - 1);
|
||||
{
|
||||
tool->pressed_buttons |= 1 << (event->button.button - 1);
|
||||
tool->button_count++;
|
||||
}
|
||||
else if (event->type == CLUTTER_BUTTON_RELEASE)
|
||||
tool->pressed_buttons &= ~(1 << (event->button.button - 1));
|
||||
{
|
||||
tool->pressed_buttons &= ~(1 << (event->button.button - 1));
|
||||
tool->button_count--;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -621,17 +627,16 @@ repick_for_event (MetaWaylandTabletTool *tool,
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_get_relative_coordinates (MetaWaylandTabletTool *tool,
|
||||
ClutterInputDevice *device,
|
||||
const ClutterEvent *event,
|
||||
MetaWaylandSurface *surface,
|
||||
wl_fixed_t *sx,
|
||||
wl_fixed_t *sy)
|
||||
{
|
||||
float xf = 0.0f, yf = 0.0f;
|
||||
ClutterPoint pos;
|
||||
float xf, yf;
|
||||
|
||||
clutter_input_device_get_coords (device, NULL, &pos);
|
||||
clutter_event_get_coords (event, &xf, &yf);
|
||||
clutter_actor_transform_stage_point (CLUTTER_ACTOR (meta_surface_actor_get_texture (surface->surface_actor)),
|
||||
pos.x, pos.y, &xf, &yf);
|
||||
xf, yf, &xf, &yf);
|
||||
|
||||
*sx = wl_fixed_from_double (xf) / surface->scale;
|
||||
*sy = wl_fixed_from_double (yf) / surface->scale;
|
||||
@ -642,11 +647,9 @@ broadcast_motion (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
ClutterInputDevice *device;
|
||||
wl_fixed_t sx, sy;
|
||||
|
||||
device = clutter_event_get_source_device (event);
|
||||
meta_wayland_tablet_tool_get_relative_coordinates (tool, device,
|
||||
meta_wayland_tablet_tool_get_relative_coordinates (tool, event,
|
||||
tool->focus_surface,
|
||||
&sx, &sy);
|
||||
|
||||
@ -797,6 +800,38 @@ broadcast_rotation (MetaWaylandTabletTool *tool,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_wheel (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
ClutterInputDevice *source;
|
||||
gdouble angle;
|
||||
gint32 clicks = 0;
|
||||
|
||||
source = clutter_event_get_source_device (event);
|
||||
|
||||
if (!clutter_input_device_get_axis_value (source, event->motion.axes,
|
||||
CLUTTER_INPUT_AXIS_WHEEL,
|
||||
&angle))
|
||||
return;
|
||||
|
||||
/* FIXME: Perform proper angle-to-clicks accumulation elsewhere */
|
||||
if (angle > 0.01)
|
||||
clicks = 1;
|
||||
else if (angle < -0.01)
|
||||
clicks = -1;
|
||||
else
|
||||
return;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v2_send_wheel (resource,
|
||||
wl_fixed_from_double (angle),
|
||||
clicks);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_axes (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
@ -820,8 +855,8 @@ broadcast_axes (MetaWaylandTabletTool *tool,
|
||||
broadcast_rotation (tool, event);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V2_CAPABILITY_SLIDER))
|
||||
broadcast_axis (tool, event, CLUTTER_INPUT_AXIS_SLIDER);
|
||||
|
||||
/* FIXME: Missing wp_tablet_tool.wheel */
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V2_CAPABILITY_WHEEL))
|
||||
broadcast_wheel (tool, event);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -843,6 +878,9 @@ handle_button_event (MetaWaylandTabletTool *tool,
|
||||
if (!tool->focus_surface)
|
||||
return;
|
||||
|
||||
if (event->type == CLUTTER_BUTTON_PRESS && tool->button_count == 1)
|
||||
clutter_event_get_coords (event, &tool->grab_x, &tool->grab_y);
|
||||
|
||||
if (event->type == CLUTTER_BUTTON_PRESS && event->button.button == 1)
|
||||
broadcast_down (tool, event);
|
||||
else if (event->type == CLUTTER_BUTTON_RELEASE && event->button.button == 1)
|
||||
@ -876,6 +914,7 @@ meta_wayland_tablet_tool_update (MetaWaylandTabletTool *tool,
|
||||
break;
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
tool->current_tablet = NULL;
|
||||
meta_wayland_tablet_tool_set_cursor_surface (tool, NULL);
|
||||
meta_wayland_tablet_tool_update_cursor_surface (tool);
|
||||
g_clear_object (&tool->cursor_renderer);
|
||||
break;
|
||||
@ -921,3 +960,32 @@ meta_wayland_tablet_tool_set_cursor_position (MetaWaylandTabletTool *tool,
|
||||
if (tool->cursor_renderer)
|
||||
meta_cursor_renderer_set_position (tool->cursor_renderer, new_x, new_y);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
if (tool->focus_surface == surface)
|
||||
return TRUE;
|
||||
|
||||
for (l = surface->subsurfaces; l; l = l->next)
|
||||
{
|
||||
MetaWaylandSurface *subsurface = l->data;
|
||||
|
||||
if (tablet_tool_can_grab_surface (tool, subsurface))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial)
|
||||
{
|
||||
return ((tool->down_serial == serial || tool->button_serial == serial) &&
|
||||
tablet_tool_can_grab_surface (tool, surface));
|
||||
}
|
||||
|
@ -48,11 +48,14 @@ struct _MetaWaylandTabletTool
|
||||
|
||||
MetaWaylandSurface *current;
|
||||
guint32 pressed_buttons;
|
||||
guint32 button_count;
|
||||
|
||||
guint32 proximity_serial;
|
||||
guint32 down_serial;
|
||||
guint32 button_serial;
|
||||
|
||||
float grab_x, grab_y;
|
||||
|
||||
MetaWaylandTablet *current_tablet;
|
||||
};
|
||||
|
||||
@ -79,5 +82,8 @@ void meta_wayland_tablet_tool_set_cursor_position (MetaWaylandTabletTool *t
|
||||
int new_x,
|
||||
int new_y);
|
||||
|
||||
gboolean meta_wayland_tablet_tool_can_grab_surface (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial);
|
||||
|
||||
#endif /* META_WAYLAND_TABLET_TOOL_H */
|
||||
|
@ -348,6 +348,7 @@ xdg_toplevel_set_maximized (struct wl_client *client,
|
||||
{
|
||||
MetaWaylandSurface *surface = surface_from_xdg_toplevel_resource (resource);
|
||||
|
||||
meta_window_force_placement (surface->window);
|
||||
meta_window_maximize (surface->window, META_MAXIMIZE_BOTH);
|
||||
}
|
||||
|
||||
@ -624,20 +625,18 @@ xdg_toplevel_role_commit (MetaWaylandSurfaceRole *surface_role,
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
if (!pending->has_new_geometry)
|
||||
if (pending->has_new_geometry)
|
||||
{
|
||||
if (pending->dx != 0 || pending->dx != 0)
|
||||
{
|
||||
g_warning ("XXX: Attach-initiated move without a new geometry. This is unimplemented right now.");
|
||||
}
|
||||
return;
|
||||
window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
|
||||
meta_window_wayland_move_resize (window,
|
||||
&xdg_surface_priv->acked_configure_serial,
|
||||
window_geometry,
|
||||
pending->dx, pending->dy);
|
||||
}
|
||||
else if (pending->dx != 0 || pending->dx != 0)
|
||||
{
|
||||
g_warning ("XXX: Attach-initiated move without a new geometry. This is unimplemented right now.");
|
||||
}
|
||||
|
||||
window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
|
||||
meta_window_wayland_move_resize (window,
|
||||
&xdg_surface_priv->acked_configure_serial,
|
||||
window_geometry,
|
||||
pending->dx, pending->dy);
|
||||
|
||||
/* When we get to this point, we ought to have valid size hints */
|
||||
if (pending->has_new_min_size || pending->has_new_max_size)
|
||||
@ -1272,11 +1271,19 @@ xdg_surface_role_commit (MetaWaylandSurfaceRole *surface_role,
|
||||
}
|
||||
else if (!priv->has_set_geometry)
|
||||
{
|
||||
MetaRectangle new_geometry = { 0 };
|
||||
|
||||
/* If the surface has never set any geometry, calculate
|
||||
* a default one unioning the surface and all subsurfaces together. */
|
||||
|
||||
meta_wayland_surface_calculate_window_geometry (surface,
|
||||
&priv->geometry,
|
||||
&new_geometry,
|
||||
0, 0);
|
||||
if (!meta_rectangle_equal (&new_geometry, &priv->geometry))
|
||||
{
|
||||
pending->has_new_geometry = TRUE;
|
||||
priv->geometry = new_geometry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,7 +334,8 @@ scale_rect_size (MetaRectangle *rect,
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_wayland_update_main_monitor (MetaWindow *window)
|
||||
meta_window_wayland_update_main_monitor (MetaWindow *window,
|
||||
gboolean user_op)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaMonitorManager *monitor_manager =
|
||||
@ -353,6 +354,7 @@ meta_window_wayland_update_main_monitor (MetaWindow *window)
|
||||
toplevel_window = meta_wayland_surface_get_toplevel_window (window->surface);
|
||||
if (toplevel_window != window)
|
||||
{
|
||||
meta_window_update_monitor (toplevel_window, user_op);
|
||||
window->monitor = toplevel_window->monitor;
|
||||
return;
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ meta_x11_source_send (MetaWaylandDataSource *source,
|
||||
/* Takes ownership of fd */
|
||||
selection->x11_selection =
|
||||
x11_selection_data_new (compositor->xwayland_manager.selection_data,
|
||||
fd, mime_type);
|
||||
fd, gdk_x11_get_xatom_name (type_atom));
|
||||
|
||||
XConvertSelection (xdisplay,
|
||||
selection->selection_atom, type_atom,
|
||||
|
@ -1721,6 +1721,7 @@ reload_gtk_hide_titlebar_when_maximized (MetaWindow *window,
|
||||
if (META_WINDOW_MAXIMIZED (window))
|
||||
{
|
||||
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
|
||||
meta_window_frame_size_changed (window);
|
||||
|
||||
if (window->frame)
|
||||
meta_frame_update_style (window->frame);
|
||||
|
@ -1456,7 +1456,8 @@ meta_window_x11_update_icon (MetaWindow *window,
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_x11_update_main_monitor (MetaWindow *window)
|
||||
meta_window_x11_update_main_monitor (MetaWindow *window,
|
||||
gboolean user_op)
|
||||
{
|
||||
window->monitor = meta_window_calculate_main_logical_monitor (window);
|
||||
}
|
||||
|
Reference in New Issue
Block a user