Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
33eb82a5f5 | |||
68d1832075 | |||
83bc703744 | |||
5b6380d394 | |||
7f0ed14f02 | |||
7bdd69892b | |||
c99da71e96 | |||
f7e243108d | |||
0d6420df51 | |||
f424056fea | |||
cfb7297cf1 | |||
8769b3d554 | |||
f8b82c376c | |||
868e1427a8 | |||
4aa74af694 | |||
f3fecd478d | |||
a5d1f67c34 | |||
102fa0e373 | |||
dbca3337b2 | |||
939f7ce781 | |||
c6e6ed87c5 | |||
8188cddcf7 | |||
9f17c05a15 | |||
c3455b01af | |||
d4e8d97e58 | |||
a86368dcb1 | |||
a13f906ed1 | |||
f9e91bf007 | |||
7c5fe42835 | |||
e76decbcf2 | |||
aac5a5dcaf | |||
9b3186f8a5 |
35
NEWS
35
NEWS
@ -1,3 +1,38 @@
|
||||
3.16.2
|
||||
======
|
||||
* Fix scroll button setting [Ondrej; #747967]
|
||||
* Don't reset idle time for non-hardware events [Rui; #748541]
|
||||
* Honor default value for click method setting [Rui; #746290]
|
||||
* Misc. bug fixes [Rui; #748478]
|
||||
|
||||
Contributors:
|
||||
Carlos Garnacho, Ondrej Holy, Rui Matos
|
||||
|
||||
3.16.1.1
|
||||
========
|
||||
* Prevent a crash when switching VTs or adding input devices [Carlos; #747886]
|
||||
|
||||
Contributors:
|
||||
Carlos Garnacho
|
||||
|
||||
3.16.1
|
||||
======
|
||||
* Add function to refresh all background instances [Rui; #739178]
|
||||
* Fix swapped scroll methods on wayland [Ondrej; #746870]
|
||||
* Manually activate stage to fix accessibility on wayland [Ray, Rui; #746670]
|
||||
* Center pointer on primary monitor on startup [Carlos; #746896]
|
||||
* wayland: Reword synchronized state application semantics [Jonas; #743617]
|
||||
* Ensure input settings are applied on startup [Rui; #747434]
|
||||
* Misc. bug fixes [Jonas, Giovanni, Calvin, Ray, Rui; #744932, #746509, #746692,
|
||||
#746510, #746545, #747263]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Giovanni Campagna, Carlos Garnacho, Ondrej Holy, Rui Matos,
|
||||
Jasper St. Pierre, Ray Strode, Calvin Walton
|
||||
|
||||
Translations:
|
||||
Khaled Hosny [ar], Marek Černocký [cs]
|
||||
|
||||
3.16.0
|
||||
======
|
||||
* wayland: Don't skip notifying about initial maximized state [Jonas; #745303]
|
||||
|
@ -2,7 +2,7 @@ AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [16])
|
||||
m4_define([mutter_micro_version], [0])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
@ -90,6 +90,7 @@ MUTTER_PC_MODULES="
|
||||
xkeyboard-config
|
||||
xkbcommon >= 0.4.3
|
||||
xkbcommon-x11
|
||||
xrender
|
||||
x11-xcb
|
||||
xcb-randr
|
||||
"
|
||||
|
36
po/cs.po
36
po/cs.po
@ -12,7 +12,7 @@ msgstr ""
|
||||
"Project-Id-Version: mutter\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2015-01-06 22:57+0000\n"
|
||||
"POT-Creation-Date: 2015-03-24 23:25+0000\n"
|
||||
"PO-Revision-Date: 2014-09-22 15:01+0200\n"
|
||||
"Last-Translator: Petr Kovar <pknbe@volny.cz>\n"
|
||||
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
|
||||
@ -437,22 +437,42 @@ msgstr "Přepnout na VT 6"
|
||||
msgid "Switch to VT 7"
|
||||
msgstr "Přepnout na VT 7"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:351
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
|
||||
msgid "Switch to VT 8"
|
||||
msgstr "Přepnout na VT 8"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
|
||||
msgid "Switch to VT 9"
|
||||
msgstr "Přepnout na VT 9"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
|
||||
msgid "Switch to VT 10"
|
||||
msgstr "Přepnout na VT 10"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
|
||||
msgid "Switch to VT 11"
|
||||
msgstr "Přepnout na VT 11"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
|
||||
msgid "Switch to VT 12"
|
||||
msgstr "Přepnout na VT 12"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:364
|
||||
msgid "Built-in display"
|
||||
msgstr "Vestavěný displej"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:378
|
||||
#: ../src/backends/meta-monitor-manager.c:391
|
||||
msgid "Unknown"
|
||||
msgstr "Neznámý"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:380
|
||||
#: ../src/backends/meta-monitor-manager.c:393
|
||||
msgid "Unknown Display"
|
||||
msgstr "Neznámý displej"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: ../src/backends/meta-monitor-manager.c:388
|
||||
#: ../src/backends/meta-monitor-manager.c:401
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
@ -495,7 +515,7 @@ msgstr "_Počkat"
|
||||
msgid "_Force Quit"
|
||||
msgstr "_Vynutit ukončení"
|
||||
|
||||
#: ../src/core/display.c:561
|
||||
#: ../src/core/display.c:562
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "Nelze otevřít displej X Window System „%s“\n"
|
||||
@ -556,7 +576,7 @@ msgstr "Vypíše verzi"
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Zásuvný modul Mutter, který se má použít"
|
||||
|
||||
#: ../src/core/prefs.c:2015
|
||||
#: ../src/core/prefs.c:2004
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Plocha %d"
|
||||
@ -587,7 +607,7 @@ msgstr ""
|
||||
"Tato okna nepodporují "ukládání aktuálního nastavení" a po vašem "
|
||||
"příštím přihlášení je budete muset spustit ručně."
|
||||
|
||||
#: ../src/x11/window-props.c:558
|
||||
#: ../src/x11/window-props.c:549
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (na %s)"
|
||||
|
@ -92,12 +92,37 @@ meta_backend_sync_screen_size (MetaBackend *backend)
|
||||
META_BACKEND_GET_CLASS (backend)->update_screen_size (backend, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
center_pointer (MetaBackend *backend)
|
||||
{
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
MetaMonitorInfo *monitors, *primary;
|
||||
guint n_monitors;
|
||||
|
||||
monitors = meta_monitor_manager_get_monitor_infos (priv->monitor_manager, &n_monitors);
|
||||
primary = &monitors[meta_monitor_manager_get_primary_index (priv->monitor_manager)];
|
||||
meta_backend_warp_pointer (backend,
|
||||
primary->rect.x + primary->rect.width / 2,
|
||||
primary->rect.y + primary->rect.height / 2);
|
||||
}
|
||||
|
||||
static void
|
||||
on_monitors_changed (MetaMonitorManager *monitors,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackend *backend = META_BACKEND (user_data);
|
||||
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
|
||||
ClutterInputDevice *device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
|
||||
ClutterPoint point;
|
||||
|
||||
meta_backend_sync_screen_size (backend);
|
||||
|
||||
if (clutter_input_device_get_coords (device, NULL, &point))
|
||||
{
|
||||
/* If we're outside all monitors, warp the pointer back inside */
|
||||
if (meta_monitor_manager_get_monitor_at_point (monitors, point.x, point.y) < 0)
|
||||
center_pointer (backend);
|
||||
}
|
||||
}
|
||||
|
||||
static MetaIdleMonitor *
|
||||
@ -283,6 +308,8 @@ meta_backend_real_post_init (MetaBackend *backend)
|
||||
}
|
||||
|
||||
priv->input_settings = meta_input_settings_create ();
|
||||
|
||||
center_pointer (backend);
|
||||
}
|
||||
|
||||
static MetaCursorRenderer *
|
||||
|
@ -185,6 +185,7 @@ meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
||||
return FALSE;
|
||||
|
||||
g_clear_pointer (&tracker->xfixes_cursor, meta_cursor_reference_unref);
|
||||
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -209,6 +209,10 @@ update_touchpad_left_handed (MetaInputSettings *input_settings,
|
||||
MetaInputSettingsPrivate *priv;
|
||||
gboolean enabled = FALSE;
|
||||
|
||||
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);
|
||||
handedness = g_settings_get_enum (priv->touchpad_settings, "left-handed");
|
||||
@ -230,7 +234,6 @@ update_touchpad_left_handed (MetaInputSettings *input_settings,
|
||||
|
||||
if (device)
|
||||
{
|
||||
g_assert (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHPAD_DEVICE);
|
||||
settings_device_set_bool_setting (input_settings, device,
|
||||
input_settings_class->set_left_handed,
|
||||
enabled);
|
||||
@ -251,13 +254,16 @@ update_mouse_left_handed (MetaInputSettings *input_settings,
|
||||
MetaInputSettingsPrivate *priv;
|
||||
gboolean enabled;
|
||||
|
||||
if (device &&
|
||||
clutter_input_device_get_device_type (device) != CLUTTER_POINTER_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->mouse_settings, "left-handed");
|
||||
|
||||
if (device)
|
||||
{
|
||||
g_assert (clutter_input_device_get_device_type (device) == CLUTTER_POINTER_DEVICE);
|
||||
settings_device_set_bool_setting (input_settings, device,
|
||||
input_settings_class->set_left_handed,
|
||||
enabled);
|
||||
@ -279,51 +285,82 @@ update_mouse_left_handed (MetaInputSettings *input_settings,
|
||||
}
|
||||
}
|
||||
|
||||
static GSettings *
|
||||
get_settings_for_device_type (MetaInputSettings *input_settings,
|
||||
ClutterInputDeviceType type)
|
||||
{
|
||||
MetaInputSettingsPrivate *priv;
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
switch (type)
|
||||
{
|
||||
case CLUTTER_POINTER_DEVICE:
|
||||
return priv->mouse_settings;
|
||||
case CLUTTER_TOUCHPAD_DEVICE:
|
||||
return priv->touchpad_settings;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_device_speed (MetaInputSettings *input_settings,
|
||||
GSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
ClutterInputDeviceType type)
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
MetaInputSettingsClass *input_settings_class;
|
||||
gdouble speed;
|
||||
GSettings *settings;
|
||||
ConfigDoubleFunc func;
|
||||
const gchar *key = "speed";
|
||||
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
speed = g_settings_get_double (settings, "speed");
|
||||
func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_speed;
|
||||
|
||||
if (device)
|
||||
settings_device_set_double_setting (input_settings, device,
|
||||
input_settings_class->set_speed,
|
||||
speed);
|
||||
{
|
||||
settings = get_settings_for_device_type (input_settings,
|
||||
clutter_input_device_get_device_type (device));
|
||||
if (!settings)
|
||||
return;
|
||||
|
||||
settings_device_set_double_setting (input_settings, device, func,
|
||||
g_settings_get_double (settings, key));
|
||||
}
|
||||
else
|
||||
settings_set_double_setting (input_settings, type,
|
||||
input_settings_class->set_speed,
|
||||
speed);
|
||||
{
|
||||
settings = get_settings_for_device_type (input_settings, CLUTTER_POINTER_DEVICE);
|
||||
settings_set_double_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
|
||||
g_settings_get_double (settings, key));
|
||||
settings = get_settings_for_device_type (input_settings, CLUTTER_TOUCHPAD_DEVICE);
|
||||
settings_set_double_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, func,
|
||||
g_settings_get_double (settings, key));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_device_natural_scroll (MetaInputSettings *input_settings,
|
||||
GSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
ClutterInputDeviceType type)
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
MetaInputSettingsClass *input_settings_class;
|
||||
gboolean enabled;
|
||||
GSettings *settings;
|
||||
ConfigBoolFunc func;
|
||||
const gchar *key = "natural-scroll";
|
||||
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
enabled = g_settings_get_boolean (settings, "natural-scroll");
|
||||
func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_invert_scroll;
|
||||
|
||||
if (device)
|
||||
{
|
||||
settings_device_set_bool_setting (input_settings, device,
|
||||
input_settings_class->set_invert_scroll,
|
||||
enabled);
|
||||
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, func,
|
||||
g_settings_get_boolean (settings, key));
|
||||
}
|
||||
else
|
||||
{
|
||||
settings_set_bool_setting (input_settings, type,
|
||||
input_settings_class->set_invert_scroll,
|
||||
enabled);
|
||||
settings = get_settings_for_device_type (input_settings, CLUTTER_POINTER_DEVICE);
|
||||
settings_set_bool_setting (input_settings, CLUTTER_POINTER_DEVICE, func,
|
||||
g_settings_get_boolean (settings, key));
|
||||
settings = get_settings_for_device_type (input_settings, CLUTTER_TOUCHPAD_DEVICE);
|
||||
settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, func,
|
||||
g_settings_get_boolean (settings, key));
|
||||
}
|
||||
}
|
||||
|
||||
@ -335,6 +372,10 @@ update_touchpad_tap_enabled (MetaInputSettings *input_settings,
|
||||
MetaInputSettingsPrivate *priv;
|
||||
gboolean enabled;
|
||||
|
||||
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, "tap-to-click");
|
||||
@ -361,6 +402,10 @@ update_touchpad_scroll_method (MetaInputSettings *input_settings,
|
||||
GDesktopTouchpadScrollMethod method;
|
||||
MetaInputSettingsPrivate *priv;
|
||||
|
||||
if (device &&
|
||||
clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
|
||||
return;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
method = g_settings_get_enum (priv->touchpad_settings, "scroll-method");
|
||||
@ -387,6 +432,10 @@ update_touchpad_click_method (MetaInputSettings *input_settings,
|
||||
GDesktopTouchpadScrollMethod method;
|
||||
MetaInputSettingsPrivate *priv;
|
||||
|
||||
if (device &&
|
||||
clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
|
||||
return;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
method = g_settings_get_enum (priv->touchpad_settings, "click-method");
|
||||
@ -413,6 +462,10 @@ update_touchpad_send_events (MetaInputSettings *input_settings,
|
||||
MetaInputSettingsPrivate *priv;
|
||||
GDesktopDeviceSendEvents mode;
|
||||
|
||||
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);
|
||||
mode = g_settings_get_enum (priv->touchpad_settings, "send-events");
|
||||
@ -455,11 +508,16 @@ update_trackball_scroll_button (MetaInputSettings *input_settings,
|
||||
MetaInputSettingsPrivate *priv;
|
||||
guint button;
|
||||
|
||||
if (device && !device_is_trackball (device))
|
||||
return;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
|
||||
button = g_settings_get_uint (priv->trackball_settings, "scroll-wheel-emulation-button");
|
||||
/* This key is 'i' in the schema but it also specifies a minimum
|
||||
* range of 0 so the cast here is safe. */
|
||||
button = (guint) g_settings_get_int (priv->trackball_settings, "scroll-wheel-emulation-button");
|
||||
|
||||
if (device && device_is_trackball (device))
|
||||
if (device)
|
||||
{
|
||||
input_settings_class->set_scroll_button (input_settings, device, button);
|
||||
}
|
||||
@ -573,22 +631,18 @@ meta_input_settings_changed_cb (GSettings *settings,
|
||||
if (strcmp (key, "left-handed") == 0)
|
||||
update_mouse_left_handed (input_settings, NULL);
|
||||
else if (strcmp (key, "speed") == 0)
|
||||
update_device_speed (input_settings, settings, NULL,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
update_device_speed (input_settings, NULL);
|
||||
else if (strcmp (key, "natural-scroll") == 0)
|
||||
update_device_natural_scroll (input_settings, settings,
|
||||
NULL, CLUTTER_POINTER_DEVICE);
|
||||
update_device_natural_scroll (input_settings, NULL);
|
||||
}
|
||||
else if (settings == priv->touchpad_settings)
|
||||
{
|
||||
if (strcmp (key, "left-handed") == 0)
|
||||
update_touchpad_left_handed (input_settings, NULL);
|
||||
else if (strcmp (key, "speed") == 0)
|
||||
update_device_speed (input_settings, settings, NULL,
|
||||
CLUTTER_TOUCHPAD_DEVICE);
|
||||
update_device_speed (input_settings, NULL);
|
||||
else if (strcmp (key, "natural-scroll") == 0)
|
||||
update_device_natural_scroll (input_settings, settings,
|
||||
NULL, CLUTTER_TOUCHPAD_DEVICE);
|
||||
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, "send-events") == 0)
|
||||
@ -706,45 +760,35 @@ check_add_mappable_device (MetaInputSettings *input_settings,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
apply_device_settings (MetaInputSettings *input_settings,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
update_mouse_left_handed (input_settings, device);
|
||||
update_device_speed (input_settings, device);
|
||||
update_device_natural_scroll (input_settings, device);
|
||||
|
||||
update_touchpad_left_handed (input_settings, device);
|
||||
update_device_speed (input_settings, device);
|
||||
update_device_natural_scroll (input_settings, device);
|
||||
update_touchpad_tap_enabled (input_settings, device);
|
||||
update_touchpad_send_events (input_settings, device);
|
||||
update_touchpad_scroll_method (input_settings, device);
|
||||
update_touchpad_click_method (input_settings, device);
|
||||
|
||||
update_trackball_scroll_button (input_settings, device);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_input_settings_device_added (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDevice *device,
|
||||
MetaInputSettings *input_settings)
|
||||
{
|
||||
ClutterInputDeviceType type;
|
||||
MetaInputSettingsPrivate *priv;
|
||||
|
||||
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
|
||||
return;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
type = clutter_input_device_get_device_type (device);
|
||||
|
||||
if (type == CLUTTER_POINTER_DEVICE)
|
||||
{
|
||||
update_mouse_left_handed (input_settings, device);
|
||||
update_device_speed (input_settings, priv->mouse_settings, device, type);
|
||||
|
||||
if (device_is_trackball (device))
|
||||
update_trackball_scroll_button (input_settings, device);
|
||||
}
|
||||
else if (type == CLUTTER_TOUCHPAD_DEVICE)
|
||||
{
|
||||
update_touchpad_left_handed (input_settings, device);
|
||||
update_touchpad_tap_enabled (input_settings, device);
|
||||
update_touchpad_scroll_method (input_settings, device);
|
||||
update_touchpad_click_method (input_settings, device);
|
||||
update_touchpad_send_events (input_settings, device);
|
||||
|
||||
update_device_speed (input_settings, priv->touchpad_settings,
|
||||
device, type);
|
||||
update_device_natural_scroll (input_settings, priv->touchpad_settings,
|
||||
device, type);
|
||||
}
|
||||
else
|
||||
{
|
||||
check_add_mappable_device (input_settings, device);
|
||||
}
|
||||
apply_device_settings (input_settings, device);
|
||||
check_add_mappable_device (input_settings, device);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -782,25 +826,9 @@ static void
|
||||
meta_input_settings_constructed (GObject *object)
|
||||
{
|
||||
MetaInputSettings *input_settings = META_INPUT_SETTINGS (object);
|
||||
MetaInputSettingsPrivate *priv;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
|
||||
update_mouse_left_handed (input_settings, NULL);
|
||||
|
||||
update_touchpad_left_handed (input_settings, NULL);
|
||||
update_touchpad_tap_enabled (input_settings, NULL);
|
||||
update_touchpad_send_events (input_settings, NULL);
|
||||
|
||||
update_device_natural_scroll (input_settings, priv->touchpad_settings,
|
||||
NULL, CLUTTER_TOUCHPAD_DEVICE);
|
||||
update_device_speed (input_settings, priv->touchpad_settings, NULL,
|
||||
CLUTTER_TOUCHPAD_DEVICE);
|
||||
update_device_speed (input_settings, priv->mouse_settings, NULL,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
apply_device_settings (input_settings, NULL);
|
||||
update_keyboard_repeat (input_settings);
|
||||
|
||||
check_mappable_devices (input_settings);
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ struct _MetaCRTCInfo {
|
||||
|
||||
/*
|
||||
* MetaOutputInfo:
|
||||
* this is the same as MetaOutputInfo, but for CRTCs
|
||||
* this is the same as MetaCRTCInfo, but for outputs
|
||||
*/
|
||||
struct _MetaOutputInfo {
|
||||
MetaOutput *output;
|
||||
@ -370,6 +370,10 @@ gboolean meta_monitor_manager_get_monitor_matrix (MetaMonitorManager *
|
||||
MetaOutput *output,
|
||||
gfloat matrix[6]);
|
||||
|
||||
gint meta_monitor_manager_get_monitor_at_point (MetaMonitorManager *manager,
|
||||
gfloat x,
|
||||
gfloat y);
|
||||
|
||||
/* Returns true if transform causes width and height to be inverted
|
||||
This is true for the odd transforms in the enum */
|
||||
static inline gboolean
|
||||
|
@ -1368,3 +1368,27 @@ meta_monitor_manager_get_monitor_for_output (MetaMonitorManager *manager,
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
gint
|
||||
meta_monitor_manager_get_monitor_at_point (MetaMonitorManager *manager,
|
||||
gfloat x,
|
||||
gfloat y)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < manager->n_monitor_infos; i++)
|
||||
{
|
||||
MetaMonitorInfo *monitor = &manager->monitor_infos[i];
|
||||
int left, right, top, bottom;
|
||||
|
||||
left = monitor->rect.x;
|
||||
right = left + monitor->rect.width;
|
||||
top = monitor->rect.y;
|
||||
bottom = top + monitor->rect.height;
|
||||
|
||||
if ((x >= left) && (x < right) && (y >= top) && (y < bottom))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ typedef struct {
|
||||
|
||||
struct _MetaStagePrivate {
|
||||
MetaOverlay cursor_overlay;
|
||||
gboolean is_active;
|
||||
};
|
||||
typedef struct _MetaStagePrivate MetaStagePrivate;
|
||||
|
||||
@ -126,15 +127,41 @@ meta_stage_paint (ClutterActor *actor)
|
||||
meta_overlay_paint (&priv->cursor_overlay);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_stage_activate (ClutterStage *actor)
|
||||
{
|
||||
MetaStage *stage = META_STAGE (actor);
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
|
||||
CLUTTER_STAGE_CLASS (meta_stage_parent_class)->activate (actor);
|
||||
|
||||
priv->is_active = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_stage_deactivate (ClutterStage *actor)
|
||||
{
|
||||
MetaStage *stage = META_STAGE (actor);
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
|
||||
CLUTTER_STAGE_CLASS (meta_stage_parent_class)->deactivate (actor);
|
||||
|
||||
priv->is_active = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_stage_class_init (MetaStageClass *klass)
|
||||
{
|
||||
ClutterStageClass *stage_class = (ClutterStageClass *) klass;
|
||||
ClutterActorClass *actor_class = (ClutterActorClass *) klass;
|
||||
GObjectClass *object_class = (GObjectClass *) klass;
|
||||
|
||||
object_class->finalize = meta_stage_finalize;
|
||||
|
||||
actor_class->paint = meta_stage_paint;
|
||||
|
||||
stage_class->activate = meta_stage_activate;
|
||||
stage_class->deactivate = meta_stage_deactivate;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -195,3 +222,43 @@ meta_stage_set_cursor (MetaStage *stage,
|
||||
meta_overlay_set (&priv->cursor_overlay, texture, rect);
|
||||
queue_redraw_for_overlay (stage, &priv->cursor_overlay);
|
||||
}
|
||||
|
||||
void
|
||||
meta_stage_set_active (MetaStage *stage,
|
||||
gboolean is_active)
|
||||
{
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
ClutterEvent event = { 0 };
|
||||
|
||||
/* Used by the native backend to inform accessibility technologies
|
||||
* about when the stage loses and gains input focus.
|
||||
*
|
||||
* For the X11 backend, clutter transparently takes care of this
|
||||
* for us.
|
||||
*/
|
||||
|
||||
if (priv->is_active == is_active)
|
||||
return;
|
||||
|
||||
event.type = CLUTTER_STAGE_STATE;
|
||||
clutter_event_set_stage (&event, CLUTTER_STAGE (stage));
|
||||
event.stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED;
|
||||
|
||||
if (is_active)
|
||||
event.stage_state.new_state = CLUTTER_STAGE_STATE_ACTIVATED;
|
||||
|
||||
/* Emitting this StageState event will result in the stage getting
|
||||
* activated or deactivated (with the activated or deactivated signal
|
||||
* getting emitted from the stage)
|
||||
*
|
||||
* FIXME: This won't update ClutterStage's own notion of its
|
||||
* activeness. For that we would need to somehow trigger a
|
||||
* _clutter_stage_update_state call, which will probably
|
||||
* require new API in clutter. In practice, nothing relies
|
||||
* on the ClutterStage's own notion of activeness when using
|
||||
* the EGL backend.
|
||||
*
|
||||
* See http://bugzilla.gnome.org/746670
|
||||
*/
|
||||
clutter_stage_event (CLUTTER_STAGE (stage), &event);
|
||||
}
|
||||
|
@ -54,6 +54,9 @@ ClutterActor *meta_stage_new (void);
|
||||
void meta_stage_set_cursor (MetaStage *stage,
|
||||
CoglTexture *texture,
|
||||
MetaRectangle *rect);
|
||||
|
||||
void meta_stage_set_active (MetaStage *stage,
|
||||
gboolean is_active);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* META_STAGE_H */
|
||||
|
@ -84,31 +84,6 @@ constrain_to_barriers (ClutterInputDevice *device,
|
||||
*
|
||||
*/
|
||||
|
||||
static gboolean
|
||||
check_all_screen_monitors(MetaMonitorInfo *monitors,
|
||||
unsigned n_monitors,
|
||||
float x,
|
||||
float y)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < n_monitors; i++)
|
||||
{
|
||||
MetaMonitorInfo *monitor = &monitors[i];
|
||||
int left, right, top, bottom;
|
||||
|
||||
left = monitor->rect.x;
|
||||
right = left + monitor->rect.width;
|
||||
top = monitor->rect.y;
|
||||
bottom = top + monitor->rect.height;
|
||||
|
||||
if ((x >= left) && (x < right) && (y >= top) && (y < bottom))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
constrain_all_screen_monitors (ClutterInputDevice *device,
|
||||
MetaMonitorInfo *monitors,
|
||||
@ -162,7 +137,6 @@ pointer_constrain_callback (ClutterInputDevice *device,
|
||||
MetaMonitorManager *monitor_manager;
|
||||
MetaMonitorInfo *monitors;
|
||||
unsigned int n_monitors;
|
||||
gboolean ret;
|
||||
|
||||
/* Constrain to barriers */
|
||||
constrain_to_barriers (device, time, new_x, new_y);
|
||||
@ -171,57 +145,22 @@ pointer_constrain_callback (ClutterInputDevice *device,
|
||||
monitors = meta_monitor_manager_get_monitor_infos (monitor_manager, &n_monitors);
|
||||
|
||||
/* if we're moving inside a monitor, we're fine */
|
||||
ret = check_all_screen_monitors(monitors, n_monitors, *new_x, *new_y);
|
||||
if (ret == TRUE)
|
||||
if (meta_monitor_manager_get_monitor_at_point (monitor_manager, *new_x, *new_y) >= 0)
|
||||
return;
|
||||
|
||||
/* if we're trying to escape, clamp to the CRTC we're coming from */
|
||||
constrain_all_screen_monitors(device, monitors, n_monitors, new_x, new_y);
|
||||
}
|
||||
|
||||
static void
|
||||
on_monitors_changed (MetaMonitorManager *monitor_manager,
|
||||
MetaBackend *backend)
|
||||
{
|
||||
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
|
||||
ClutterInputDevice *device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
|
||||
MetaMonitorInfo *monitors, *primary;
|
||||
unsigned int n_monitors;
|
||||
ClutterPoint point;
|
||||
|
||||
if (!clutter_input_device_get_coords (device, NULL, &point))
|
||||
return;
|
||||
|
||||
monitors = meta_monitor_manager_get_monitor_infos (monitor_manager, &n_monitors);
|
||||
|
||||
/* if we're inside a monitor, we're fine */
|
||||
if (check_all_screen_monitors (monitors, n_monitors, point.x, point.y))
|
||||
return;
|
||||
|
||||
/* warp the pointer to the primary monitor so it isn't lost */
|
||||
primary = &monitors[meta_monitor_manager_get_primary_index (monitor_manager)];
|
||||
meta_backend_warp_pointer (backend,
|
||||
primary->rect.x + primary->rect.width / 2,
|
||||
primary->rect.y + primary->rect.height / 2);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_backend_native_post_init (MetaBackend *backend)
|
||||
{
|
||||
MetaMonitorManager *monitor_manager;
|
||||
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
|
||||
|
||||
META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend);
|
||||
|
||||
clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
|
||||
NULL, NULL);
|
||||
|
||||
monitor_manager = meta_backend_get_monitor_manager (backend);
|
||||
g_signal_connect_object (monitor_manager, "monitors-changed",
|
||||
G_CALLBACK (on_monitors_changed), backend, G_CONNECT_AFTER);
|
||||
|
||||
/* make sure the pointer is in the visible area after init */
|
||||
on_monitors_changed (monitor_manager, backend);
|
||||
}
|
||||
|
||||
static MetaIdleMonitor *
|
||||
|
@ -169,10 +169,10 @@ meta_input_settings_native_set_scroll_method (MetaInputSettings *sett
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING:
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE;
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING:
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE;
|
||||
scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "meta-backend-x11.h"
|
||||
#include "meta-input-settings-x11.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/extensions/XInput2.h>
|
||||
@ -35,6 +36,38 @@
|
||||
|
||||
G_DEFINE_TYPE (MetaInputSettingsX11, meta_input_settings_x11, META_TYPE_INPUT_SETTINGS)
|
||||
|
||||
static void *
|
||||
get_property (ClutterInputDevice *device,
|
||||
const gchar *property,
|
||||
Atom type,
|
||||
int format,
|
||||
gulong nitems)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
|
||||
gulong nitems_ret, bytes_after_ret;
|
||||
int rc, device_id, format_ret;
|
||||
Atom property_atom, type_ret;
|
||||
guchar *data_ret = NULL;
|
||||
|
||||
property_atom = XInternAtom (xdisplay, property, False);
|
||||
device_id = clutter_input_device_get_device_id (device);
|
||||
|
||||
rc = XIGetProperty (xdisplay, device_id, property_atom,
|
||||
0, 10, False, type, &type_ret, &format_ret,
|
||||
&nitems_ret, &bytes_after_ret, &data_ret);
|
||||
if (rc == Success && type_ret == type && format_ret == format && nitems_ret >= nitems)
|
||||
{
|
||||
if (nitems_ret > nitems)
|
||||
g_warning ("Property '%s' for device '%s' returned %lu items, expected %lu",
|
||||
property, clutter_input_device_get_device_name (device), nitems_ret, nitems);
|
||||
return data_ret;
|
||||
}
|
||||
|
||||
meta_XFree (data_ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
change_property (ClutterInputDevice *device,
|
||||
const gchar *property,
|
||||
@ -45,23 +78,20 @@ change_property (ClutterInputDevice *device,
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
|
||||
gulong nitems_ret, bytes_after_ret;
|
||||
int rc, device_id, format_ret;
|
||||
Atom property_atom, type_ret;
|
||||
int device_id;
|
||||
Atom property_atom;
|
||||
guchar *data_ret;
|
||||
|
||||
property_atom = XInternAtom (xdisplay, property, False);
|
||||
device_id = clutter_input_device_get_device_id (device);
|
||||
|
||||
rc = XIGetProperty (xdisplay, device_id, property_atom,
|
||||
0, 0, False, type, &type_ret, &format_ret,
|
||||
&nitems_ret, &bytes_after_ret, &data_ret);
|
||||
data_ret = get_property (device, property, type, format, nitems);
|
||||
if (!data_ret)
|
||||
return;
|
||||
|
||||
XIChangeProperty (xdisplay, device_id, property_atom, type,
|
||||
format, XIPropModeReplace, data, nitems);
|
||||
meta_XFree (data_ret);
|
||||
|
||||
if (rc == Success && type_ret == type && format_ret == format)
|
||||
XIChangeProperty (xdisplay, device_id, property_atom, type,
|
||||
format, XIPropModeReplace, data, nitems);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -180,7 +210,7 @@ meta_input_settings_x11_set_scroll_button (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device,
|
||||
guint button)
|
||||
{
|
||||
change_property (device, "libinput Scroll Method Enabled",
|
||||
change_property (device, "libinput Button Scrolling Button",
|
||||
XA_INTEGER, 32, &button, 1);
|
||||
}
|
||||
|
||||
@ -190,16 +220,23 @@ meta_input_settings_x11_set_click_method (MetaInputSettings *settings,
|
||||
GDesktopTouchpadClickMethod mode)
|
||||
{
|
||||
guchar values[2] = { 0 }; /* buttonareas, clickfinger */
|
||||
guchar *defaults;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT:
|
||||
defaults = get_property (device, "libinput Click Method Enabled Default",
|
||||
XA_INTEGER, 8, 2);
|
||||
if (!defaults)
|
||||
break;
|
||||
memcpy (values, defaults, 2);
|
||||
meta_XFree (defaults);
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_CLICK_METHOD_NONE:
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_CLICK_METHOD_AREAS:
|
||||
values[0] = 1;
|
||||
break;
|
||||
case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT:
|
||||
/* XXX: We can't be much smarter yet, x11 doesn't expose default settings */
|
||||
case G_DESKTOP_TOUCHPAD_CLICK_METHOD_FINGERS:
|
||||
values[1] = 1;
|
||||
break;
|
||||
|
@ -71,6 +71,8 @@ enum
|
||||
|
||||
G_DEFINE_TYPE (MetaBackground, meta_background, G_TYPE_OBJECT)
|
||||
|
||||
static GSList *all_backgrounds = NULL;
|
||||
|
||||
static void
|
||||
free_fbos (MetaBackground *self)
|
||||
{
|
||||
@ -305,6 +307,8 @@ meta_background_dispose (GObject *object)
|
||||
static void
|
||||
meta_background_finalize (GObject *object)
|
||||
{
|
||||
all_backgrounds = g_slist_remove (all_backgrounds, object);
|
||||
|
||||
G_OBJECT_CLASS (meta_background_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@ -347,6 +351,7 @@ meta_background_init (MetaBackground *self)
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
META_TYPE_BACKGROUND,
|
||||
MetaBackgroundPrivate);
|
||||
all_backgrounds = g_slist_prepend (all_backgrounds, self);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -913,3 +918,12 @@ meta_background_set_blend (MetaBackground *self,
|
||||
free_wallpaper_texture (self);
|
||||
mark_changed (self);
|
||||
}
|
||||
|
||||
void
|
||||
meta_background_refresh_all (void)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = all_backgrounds; l; l = l->next)
|
||||
mark_changed (l->data);
|
||||
}
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include <meta/meta-backend.h>
|
||||
#include "backends/native/meta-backend-native.h"
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "backends/meta-stage.h"
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
|
||||
#ifdef HAVE_RANDR
|
||||
@ -1411,6 +1412,8 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
|
||||
#ifdef HAVE_WAYLAND
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
MetaWindow *focus_window = NULL;
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaStage *stage = META_STAGE (meta_backend_get_stage (backend));
|
||||
|
||||
if (!meta_display_windows_are_interactable (display))
|
||||
focus_window = NULL;
|
||||
@ -1421,6 +1424,7 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
|
||||
else
|
||||
meta_topic (META_DEBUG_FOCUS, "Focus change has no effect, because there is no matching wayland surface");
|
||||
|
||||
meta_stage_set_active (stage, focus_window == NULL);
|
||||
meta_wayland_compositor_set_input_focus (compositor, focus_window);
|
||||
|
||||
meta_wayland_seat_repick (compositor->seat);
|
||||
|
@ -93,6 +93,15 @@ handle_idletime_for_event (const ClutterEvent *event)
|
||||
if (device == NULL)
|
||||
return;
|
||||
|
||||
if (event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC ||
|
||||
event->type == CLUTTER_ENTER ||
|
||||
event->type == CLUTTER_LEAVE ||
|
||||
event->type == CLUTTER_STAGE_STATE ||
|
||||
event->type == CLUTTER_DESTROY_NOTIFY ||
|
||||
event->type == CLUTTER_CLIENT_MESSAGE ||
|
||||
event->type == CLUTTER_DELETE)
|
||||
return;
|
||||
|
||||
device_id = clutter_input_device_get_device_id (device);
|
||||
|
||||
core_monitor = meta_idle_monitor_get_core ();
|
||||
@ -192,6 +201,7 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
{
|
||||
MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL);
|
||||
meta_cursor_tracker_update_position (tracker, event->motion.x, event->motion.y);
|
||||
display->monitor_cache_invalidated = TRUE;
|
||||
}
|
||||
|
||||
handle_idletime_for_event (event);
|
||||
|
@ -37,7 +37,6 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
{
|
||||
MetaFrame *frame;
|
||||
XSetWindowAttributes attrs;
|
||||
Visual *visual;
|
||||
gulong create_serial;
|
||||
|
||||
if (window->frame)
|
||||
@ -58,37 +57,14 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
frame->is_flashing = FALSE;
|
||||
frame->borders_cached = FALSE;
|
||||
|
||||
meta_verbose ("Framing window %s: visual %s default, depth %d default depth %d\n",
|
||||
window->desc,
|
||||
XVisualIDFromVisual (window->xvisual) ==
|
||||
XVisualIDFromVisual (window->screen->default_xvisual) ?
|
||||
"is" : "is not",
|
||||
window->depth, window->screen->default_depth);
|
||||
meta_verbose ("Frame geometry %d,%d %dx%d\n",
|
||||
frame->rect.x, frame->rect.y,
|
||||
frame->rect.width, frame->rect.height);
|
||||
|
||||
/* Default depth/visual handles clients with weird visuals; they can
|
||||
* always be children of the root depth/visual obviously, but
|
||||
* e.g. DRI games can't be children of a parent that has the same
|
||||
* visual as the client. NULL means default visual.
|
||||
*
|
||||
* We look for an ARGB visual if we can find one, otherwise use
|
||||
* the default of NULL.
|
||||
*/
|
||||
|
||||
/* Special case for depth 32 windows (assumed to be ARGB),
|
||||
* we use the window's visual. Otherwise we just use the system visual.
|
||||
*/
|
||||
if (window->depth == 32)
|
||||
visual = window->xvisual;
|
||||
else
|
||||
visual = NULL;
|
||||
|
||||
frame->ui_frame = meta_ui_create_frame (window->screen->ui,
|
||||
window->display->xdisplay,
|
||||
frame->window,
|
||||
visual,
|
||||
window->xvisual,
|
||||
frame->rect.x,
|
||||
frame->rect.y,
|
||||
frame->rect.width,
|
||||
|
@ -2113,12 +2113,6 @@ meta_prefs_add_keybinding (const char *name,
|
||||
pref->combos = NULL;
|
||||
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
|
||||
|
||||
strokes = g_settings_get_strv (settings, name);
|
||||
update_binding (pref, strokes);
|
||||
g_strfreev (strokes);
|
||||
|
||||
g_hash_table_insert (key_bindings, g_strdup (name), pref);
|
||||
|
||||
if (pref->builtin)
|
||||
{
|
||||
if (g_object_get_data (G_OBJECT (settings), "changed-signal") == NULL)
|
||||
@ -2140,6 +2134,12 @@ meta_prefs_add_keybinding (const char *name,
|
||||
queue_changed (META_PREF_KEYBINDINGS);
|
||||
}
|
||||
|
||||
strokes = g_settings_get_strv (settings, name);
|
||||
update_binding (pref, strokes);
|
||||
g_strfreev (strokes);
|
||||
|
||||
g_hash_table_insert (key_bindings, g_strdup (name), pref);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,8 @@ struct _MetaBackground
|
||||
MetaBackgroundPrivate *priv;
|
||||
};
|
||||
|
||||
void meta_background_refresh_all (void);
|
||||
|
||||
GType meta_background_get_type (void);
|
||||
|
||||
MetaBackground *meta_background_new (MetaScreen *screen);
|
||||
|
@ -371,7 +371,7 @@ static void
|
||||
destroy_data_device_icon (struct wl_listener *listener, void *data)
|
||||
{
|
||||
MetaWaylandDragGrab *drag_grab =
|
||||
wl_container_of (listener, drag_grab, drag_data_source_listener);
|
||||
wl_container_of (listener, drag_grab, drag_icon_listener);
|
||||
|
||||
drag_grab->drag_surface = NULL;
|
||||
|
||||
|
@ -411,6 +411,11 @@ meta_wayland_xkb_info_destroy (MetaWaylandXkbInfo *xkb_info)
|
||||
void
|
||||
meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
|
||||
g_signal_handlers_disconnect_by_func (backend, on_keymap_changed, keyboard);
|
||||
g_signal_handlers_disconnect_by_func (backend, on_keymap_layout_group_changed, keyboard);
|
||||
|
||||
meta_wayland_keyboard_set_focus (keyboard, NULL);
|
||||
meta_wayland_xkb_info_destroy (&keyboard->xkb_info);
|
||||
|
||||
|
@ -121,24 +121,30 @@ static void
|
||||
surface_process_damage (MetaWaylandSurface *surface,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
unsigned int buffer_width;
|
||||
unsigned int buffer_height;
|
||||
cairo_rectangle_int_t surface_rect;
|
||||
cairo_region_t *scaled_region;
|
||||
cairo_rectangle_int_t buffer_rect;
|
||||
int i, n_rectangles;
|
||||
|
||||
if (!surface->buffer)
|
||||
return;
|
||||
|
||||
buffer_rect.x = 0;
|
||||
buffer_rect.y = 0;
|
||||
buffer_rect.width = cogl_texture_get_width (surface->buffer->texture);
|
||||
buffer_rect.height = cogl_texture_get_height (surface->buffer->texture);
|
||||
/* Intersect the damage region with the surface region before scaling in
|
||||
* order to avoid integer overflow when scaling a damage region is too large
|
||||
* (for example INT32_MAX which mesa passes). */
|
||||
buffer_width = cogl_texture_get_width (surface->buffer->texture);
|
||||
buffer_height = cogl_texture_get_height (surface->buffer->texture);
|
||||
surface_rect = (cairo_rectangle_int_t) {
|
||||
.width = buffer_width / surface->scale,
|
||||
.height = buffer_height / surface->scale,
|
||||
};
|
||||
cairo_region_intersect_rectangle (region, &surface_rect);
|
||||
|
||||
/* The damage region must be in the same coordinate space as the buffer,
|
||||
* i.e. scaled with surface->scale. */
|
||||
scaled_region = meta_region_scale (region, surface->scale);
|
||||
|
||||
cairo_region_intersect_rectangle (scaled_region, &buffer_rect);
|
||||
|
||||
/* First update the buffer. */
|
||||
meta_wayland_buffer_process_damage (surface->buffer, scaled_region);
|
||||
|
||||
@ -355,33 +361,95 @@ subsurface_surface_commit (MetaWaylandSurface *surface,
|
||||
clutter_actor_set_position (CLUTTER_ACTOR (surface_actor), x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
subsurface_parent_surface_committed (MetaWaylandSurface *surface);
|
||||
|
||||
static void
|
||||
parent_surface_committed (gpointer data, gpointer user_data)
|
||||
/* A non-subsurface is always desynchronized.
|
||||
*
|
||||
* A subsurface is effectively synchronized if either its parent is
|
||||
* synchronized or itself is in synchronized mode. */
|
||||
static gboolean
|
||||
is_surface_effectively_synchronized (MetaWaylandSurface *surface)
|
||||
{
|
||||
subsurface_parent_surface_committed (data);
|
||||
if (surface->wl_subsurface == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (surface->sub.synchronous)
|
||||
return TRUE;
|
||||
else
|
||||
return is_surface_effectively_synchronized (surface->sub.parent);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
commit_pending_state (MetaWaylandSurface *surface,
|
||||
MetaWaylandPendingState *pending)
|
||||
apply_pending_state (MetaWaylandSurface *surface,
|
||||
MetaWaylandPendingState *pending);
|
||||
|
||||
static void
|
||||
parent_surface_state_applied (gpointer data, gpointer user_data)
|
||||
{
|
||||
MetaWaylandSurface *surface = data;
|
||||
|
||||
if (surface->sub.pending_pos)
|
||||
{
|
||||
clutter_actor_set_position (CLUTTER_ACTOR (surface->surface_actor),
|
||||
surface->sub.pending_x,
|
||||
surface->sub.pending_y);
|
||||
surface->sub.pending_pos = FALSE;
|
||||
}
|
||||
|
||||
if (surface->sub.pending_placement_ops)
|
||||
{
|
||||
GSList *it;
|
||||
for (it = surface->sub.pending_placement_ops; it; it = it->next)
|
||||
{
|
||||
MetaWaylandSubsurfacePlacementOp *op = it->data;
|
||||
ClutterActor *surface_actor;
|
||||
ClutterActor *parent_actor;
|
||||
ClutterActor *sibling_actor;
|
||||
|
||||
if (!op->sibling)
|
||||
{
|
||||
g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
|
||||
continue;
|
||||
}
|
||||
|
||||
surface_actor = CLUTTER_ACTOR (surface->surface_actor);
|
||||
parent_actor = clutter_actor_get_parent (CLUTTER_ACTOR (surface->sub.parent));
|
||||
sibling_actor = CLUTTER_ACTOR (op->sibling->surface_actor);
|
||||
|
||||
switch (op->placement)
|
||||
{
|
||||
case META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE:
|
||||
clutter_actor_set_child_above_sibling (parent_actor,
|
||||
surface_actor,
|
||||
sibling_actor);
|
||||
break;
|
||||
case META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW:
|
||||
clutter_actor_set_child_below_sibling (parent_actor,
|
||||
surface_actor,
|
||||
sibling_actor);
|
||||
break;
|
||||
}
|
||||
|
||||
wl_list_remove (&op->sibling_destroy_listener.link);
|
||||
g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
|
||||
}
|
||||
|
||||
g_slist_free (surface->sub.pending_placement_ops);
|
||||
surface->sub.pending_placement_ops = NULL;
|
||||
}
|
||||
|
||||
if (is_surface_effectively_synchronized (surface))
|
||||
apply_pending_state (surface, &surface->sub.pending);
|
||||
}
|
||||
|
||||
static void
|
||||
apply_pending_state (MetaWaylandSurface *surface,
|
||||
MetaWaylandPendingState *pending)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = surface->compositor;
|
||||
|
||||
/* If this surface is a subsurface in in synchronous mode, commit
|
||||
* has a special-case and should not apply the pending state immediately.
|
||||
*
|
||||
* Instead, we move it to another pending state, which will be
|
||||
* actually committed when the parent commits.
|
||||
*/
|
||||
if (surface->sub.synchronous)
|
||||
{
|
||||
move_pending_state (pending, &surface->sub.pending);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pending->newly_attached)
|
||||
{
|
||||
surface_set_buffer (surface, pending->buffer);
|
||||
@ -432,15 +500,26 @@ commit_pending_state (MetaWaylandSurface *surface,
|
||||
else if (surface->wl_subsurface)
|
||||
subsurface_surface_commit (surface, pending);
|
||||
|
||||
g_list_foreach (surface->subsurfaces, parent_surface_committed, NULL);
|
||||
|
||||
pending_state_reset (pending);
|
||||
|
||||
g_list_foreach (surface->subsurfaces, parent_surface_state_applied, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
||||
{
|
||||
commit_pending_state (surface, &surface->pending);
|
||||
/*
|
||||
* If this is a sub-surface and it is in effective synchronous mode, only
|
||||
* cache the pending surface state until either one of the following two
|
||||
* scenarios happens:
|
||||
* 1) Its parent surface gets its state applied.
|
||||
* 2) Its mode changes from synchronized to desynchronized and its parent
|
||||
* surface is in effective desynchronized mode.
|
||||
*/
|
||||
if (is_surface_effectively_synchronized (surface))
|
||||
move_pending_state (&surface->pending, &surface->sub.pending);
|
||||
else
|
||||
apply_pending_state (surface, &surface->pending);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1548,59 +1627,6 @@ bind_gtk_shell (struct wl_client *client,
|
||||
gtk_shell_send_capabilities (resource, capabilities);
|
||||
}
|
||||
|
||||
static void
|
||||
subsurface_parent_surface_committed (MetaWaylandSurface *surface)
|
||||
{
|
||||
if (surface->sub.pending_pos)
|
||||
{
|
||||
clutter_actor_set_position (CLUTTER_ACTOR (surface->surface_actor),
|
||||
surface->sub.pending_x,
|
||||
surface->sub.pending_y);
|
||||
surface->sub.pending_pos = FALSE;
|
||||
}
|
||||
|
||||
if (surface->sub.pending_placement_ops)
|
||||
{
|
||||
GSList *it;
|
||||
for (it = surface->sub.pending_placement_ops; it; it = it->next)
|
||||
{
|
||||
MetaWaylandSubsurfacePlacementOp *op = it->data;
|
||||
ClutterActor *surface_actor;
|
||||
ClutterActor *parent_actor;
|
||||
ClutterActor *sibling_actor;
|
||||
|
||||
if (!op->sibling)
|
||||
{
|
||||
g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
|
||||
continue;
|
||||
}
|
||||
|
||||
surface_actor = CLUTTER_ACTOR (surface->surface_actor);
|
||||
parent_actor = clutter_actor_get_parent (CLUTTER_ACTOR (surface->sub.parent));
|
||||
sibling_actor = CLUTTER_ACTOR (op->sibling->surface_actor);
|
||||
|
||||
switch (op->placement)
|
||||
{
|
||||
case META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE:
|
||||
clutter_actor_set_child_above_sibling (parent_actor, surface_actor, sibling_actor);
|
||||
break;
|
||||
case META_WAYLAND_SUBSURFACE_PLACEMENT_BELOW:
|
||||
clutter_actor_set_child_below_sibling (parent_actor, surface_actor, sibling_actor);
|
||||
break;
|
||||
}
|
||||
|
||||
wl_list_remove (&op->sibling_destroy_listener.link);
|
||||
g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
|
||||
}
|
||||
|
||||
g_slist_free (surface->sub.pending_placement_ops);
|
||||
surface->sub.pending_placement_ops = NULL;
|
||||
}
|
||||
|
||||
if (surface->sub.synchronous)
|
||||
commit_pending_state (surface, &surface->sub.pending);
|
||||
}
|
||||
|
||||
static void
|
||||
unparent_actor (MetaWaylandSurface *surface)
|
||||
{
|
||||
@ -1745,11 +1771,13 @@ wl_subsurface_set_desync (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
gboolean was_effectively_synchronized;
|
||||
|
||||
if (surface->sub.synchronous)
|
||||
subsurface_parent_surface_committed (surface);
|
||||
|
||||
was_effectively_synchronized = is_surface_effectively_synchronized (surface);
|
||||
surface->sub.synchronous = FALSE;
|
||||
if (was_effectively_synchronized &&
|
||||
!is_surface_effectively_synchronized (surface))
|
||||
apply_pending_state (surface, &surface->sub.pending);
|
||||
}
|
||||
|
||||
static const struct wl_subsurface_interface meta_wayland_wl_subsurface_interface = {
|
||||
|
@ -228,14 +228,16 @@ create_lockfile (int display, int *display_out)
|
||||
|
||||
char pid[11];
|
||||
int size;
|
||||
int number_of_tries = 0;
|
||||
|
||||
while (!try_display (display, &filename, &fd))
|
||||
{
|
||||
display++;
|
||||
number_of_tries++;
|
||||
|
||||
/* If display is above 50, then something's wrong. Just
|
||||
/* If we can't get a display after 50 times, then something's wrong. Just
|
||||
* abort in this case. */
|
||||
if (display > 50)
|
||||
if (number_of_tries >= 50)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -322,11 +324,13 @@ bind_to_unix_socket (int display)
|
||||
}
|
||||
|
||||
static void
|
||||
xserver_died (GPid pid,
|
||||
gint status,
|
||||
gpointer user_data)
|
||||
xserver_died (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (!WIFEXITED (status))
|
||||
GSubprocess *proc = G_SUBPROCESS (source);
|
||||
|
||||
if (!g_subprocess_get_successful (proc))
|
||||
g_error ("X Wayland crashed; aborting");
|
||||
else
|
||||
{
|
||||
@ -434,7 +438,10 @@ meta_xwayland_start (MetaXWaylandManager *manager,
|
||||
{
|
||||
int xwayland_client_fd[2];
|
||||
int displayfd[2];
|
||||
int fd;
|
||||
g_autoptr(GSubprocessLauncher) launcher = NULL;
|
||||
GSubprocessFlags flags;
|
||||
GSubprocess *proc;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!choose_xdisplay (manager))
|
||||
return FALSE;
|
||||
@ -445,64 +452,47 @@ meta_xwayland_start (MetaXWaylandManager *manager,
|
||||
{
|
||||
g_warning ("xwayland_client_fd socketpair failed\n");
|
||||
unlink (manager->lockfile);
|
||||
return 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (socketpair (AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, displayfd) < 0)
|
||||
{
|
||||
g_warning ("displayfd socketpair failed\n");
|
||||
unlink (manager->lockfile);
|
||||
return 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
manager->pid = fork ();
|
||||
if (manager->pid == 0)
|
||||
/* xwayland, please. */
|
||||
flags = G_SUBPROCESS_FLAGS_NONE;
|
||||
|
||||
if (getenv ("XWAYLAND_STFU"))
|
||||
{
|
||||
char socket_fd[8], unix_fd[8], abstract_fd[8], displayfd_fd[8];
|
||||
|
||||
/* We passed SOCK_CLOEXEC, so dup the FD so it isn't
|
||||
* closed on exec.. */
|
||||
fd = dup (xwayland_client_fd[1]);
|
||||
snprintf (socket_fd, sizeof (socket_fd), "%d", fd);
|
||||
setenv ("WAYLAND_SOCKET", socket_fd, TRUE);
|
||||
|
||||
fd = dup (manager->abstract_fd);
|
||||
snprintf (abstract_fd, sizeof (abstract_fd), "%d", fd);
|
||||
|
||||
fd = dup (manager->unix_fd);
|
||||
snprintf (unix_fd, sizeof (unix_fd), "%d", fd);
|
||||
|
||||
fd = dup (displayfd[1]);
|
||||
snprintf (displayfd_fd, sizeof (displayfd_fd), "%d", fd);
|
||||
|
||||
/* xwayland, please. */
|
||||
if (getenv ("XWAYLAND_STFU"))
|
||||
{
|
||||
int dev_null;
|
||||
dev_null = open ("/dev/null", O_WRONLY);
|
||||
|
||||
dup2 (dev_null, STDOUT_FILENO);
|
||||
dup2 (dev_null, STDERR_FILENO);
|
||||
}
|
||||
|
||||
if (execl (XWAYLAND_PATH, XWAYLAND_PATH,
|
||||
manager->display_name,
|
||||
"-rootless",
|
||||
"-noreset",
|
||||
"-listen", abstract_fd,
|
||||
"-listen", unix_fd,
|
||||
"-displayfd", displayfd_fd,
|
||||
NULL) < 0)
|
||||
{
|
||||
g_error ("Failed to spawn XWayland: %m");
|
||||
}
|
||||
flags |= G_SUBPROCESS_FLAGS_STDOUT_SILENCE;
|
||||
flags |= G_SUBPROCESS_FLAGS_STDERR_SILENCE;
|
||||
}
|
||||
else if (manager->pid == -1)
|
||||
|
||||
launcher = g_subprocess_launcher_new (flags);
|
||||
|
||||
g_subprocess_launcher_take_fd (launcher, xwayland_client_fd[1], 3);
|
||||
g_subprocess_launcher_take_fd (launcher, manager->abstract_fd, 4);
|
||||
g_subprocess_launcher_take_fd (launcher, manager->unix_fd, 5);
|
||||
g_subprocess_launcher_take_fd (launcher, displayfd[1], 6);
|
||||
|
||||
g_subprocess_launcher_setenv (launcher, "WAYLAND_SOCKET", "3", TRUE);
|
||||
proc = g_subprocess_launcher_spawn (launcher, &error,
|
||||
XWAYLAND_PATH, manager->display_name,
|
||||
"-rootless", "-noreset",
|
||||
"-listen", "4",
|
||||
"-listen", "5",
|
||||
"-displayfd", "6",
|
||||
NULL);
|
||||
if (!proc)
|
||||
{
|
||||
g_error ("Failed to fork: %m");
|
||||
g_error ("Failed to spawn Xwayland: %s", error->message);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_child_watch_add (manager->pid, xserver_died, NULL);
|
||||
g_subprocess_wait_async (proc, NULL, xserver_died, NULL);
|
||||
g_unix_fd_add (displayfd[0], G_IO_IN, on_displayfd_ready, manager);
|
||||
manager->client = wl_client_create (wl_display, xwayland_client_fd[0]);
|
||||
|
||||
|
Reference in New Issue
Block a user