[arch-commits] Commit in mutter/trunk (PKGBUILD revert.patch)

Jan Steffens heftig at archlinux.org
Wed Apr 15 11:08:53 UTC 2015


    Date: Wednesday, April 15, 2015 @ 13:08:53
  Author: heftig
Revision: 236646

Revert a crasher

Added:
  mutter/trunk/revert.patch
Modified:
  mutter/trunk/PKGBUILD

--------------+
 PKGBUILD     |   16 +++
 revert.patch |  244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 257 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-04-15 10:20:29 UTC (rev 236645)
+++ PKGBUILD	2015-04-15 11:08:53 UTC (rev 236646)
@@ -5,7 +5,7 @@
 
 pkgname=mutter
 pkgver=3.16.1
-pkgrel=1
+pkgrel=2
 pkgdesc="A window manager for GNOME"
 arch=(i686 x86_64)
 license=('GPL')
@@ -17,9 +17,19 @@
 groups=('gnome')
 options=('!emptydirs')
 install=mutter.install
-source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz)
-sha256sums=('be487f92bfa60c88fe474bd99f9665d57506479a06a48e00a7dd3171029b701c')
+source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz
+        revert.patch)
+sha256sums=('be487f92bfa60c88fe474bd99f9665d57506479a06a48e00a7dd3171029b701c'
+            'ec06d41973e82a608d9de7e7369ad323a58f6f644016657ac54ce226321a6570')
 
+prepare() {
+  cd "$pkgname-$pkgver"
+  
+  # Revert input-settings: Ensure that we always apply the same set of settings
+  # because it asserts when VT switching
+  patch -Np1 -i ../revert.patch
+}
+
 build() {
   cd "$pkgname-$pkgver"
   ./configure --prefix=/usr --sysconfdir=/etc \

Added: revert.patch
===================================================================
--- revert.patch	                        (rev 0)
+++ revert.patch	2015-04-15 11:08:53 UTC (rev 236646)
@@ -0,0 +1,244 @@
+diff --git c/src/backends/meta-input-settings.c i/src/backends/meta-input-settings.c
+index 004044e..4860fa9 100644
+--- c/src/backends/meta-input-settings.c
++++ i/src/backends/meta-input-settings.c
+@@ -279,82 +279,51 @@ 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,
+-                     ClutterInputDevice     *device)
++                     GSettings              *settings,
++                     ClutterInputDevice     *device,
++                     ClutterInputDeviceType  type)
+ {
+-  GSettings *settings;
+-  ConfigDoubleFunc func;
+-  const gchar *key = "speed";
++  MetaInputSettingsClass *input_settings_class;
++  gdouble speed;
+ 
+-  func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_speed;
++  input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
++  speed = g_settings_get_double (settings, "speed");
+ 
+   if (device)
+-    {
+-      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));
+-    }
++    settings_device_set_double_setting (input_settings, device,
++                                        input_settings_class->set_speed,
++                                        speed);
+   else
+-    {
+-      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));
+-    }
++    settings_set_double_setting (input_settings, type,
++                                 input_settings_class->set_speed,
++                                 speed);
+ }
+ 
+ static void
+ update_device_natural_scroll (MetaInputSettings      *input_settings,
+-                              ClutterInputDevice     *device)
++                              GSettings              *settings,
++                              ClutterInputDevice     *device,
++                              ClutterInputDeviceType  type)
+ {
+-  GSettings *settings;
+-  ConfigBoolFunc func;
+-  const gchar *key = "natural-scroll";
++  MetaInputSettingsClass *input_settings_class;
++  gboolean enabled;
+ 
+-  func = META_INPUT_SETTINGS_GET_CLASS (input_settings)->set_invert_scroll;
++  input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
++  enabled = g_settings_get_boolean (settings, "natural-scroll");
+ 
+   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, func,
+-                                        g_settings_get_boolean (settings, key));
++      settings_device_set_bool_setting (input_settings, device,
++                                        input_settings_class->set_invert_scroll,
++                                        enabled);
+     }
+   else
+     {
+-      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));
++      settings_set_bool_setting (input_settings, type,
++                                 input_settings_class->set_invert_scroll,
++                                 enabled);
+     }
+ }
+ 
+@@ -488,9 +457,7 @@ update_trackball_scroll_button (MetaInputSettings  *input_settings,
+ 
+   priv = meta_input_settings_get_instance_private (input_settings);
+   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
+-  /* 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");
++  button = g_settings_get_uint (priv->trackball_settings, "scroll-wheel-emulation-button");
+ 
+   if (device && device_is_trackball (device))
+     {
+@@ -606,18 +573,22 @@ 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, NULL);
++        update_device_speed (input_settings, settings, NULL,
++                             CLUTTER_POINTER_DEVICE);
+       else if (strcmp (key, "natural-scroll") == 0)
+-        update_device_natural_scroll (input_settings, NULL);
++        update_device_natural_scroll (input_settings, settings,
++                                      NULL, CLUTTER_POINTER_DEVICE);
+     }
+   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, NULL);
++        update_device_speed (input_settings, settings, NULL,
++                             CLUTTER_TOUCHPAD_DEVICE);
+       else if (strcmp (key, "natural-scroll") == 0)
+-        update_device_natural_scroll (input_settings, NULL);
++        update_device_natural_scroll (input_settings, settings,
++                                      NULL, CLUTTER_TOUCHPAD_DEVICE);
+       else if (strcmp (key, "tap-to-click") == 0)
+         update_touchpad_tap_enabled (input_settings, NULL);
+       else if (strcmp (key, "send-events") == 0)
+@@ -736,34 +707,44 @@ check_add_mappable_device (MetaInputSettings  *input_settings,
+ }
+ 
+ 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;
+ 
+-  apply_device_settings (input_settings, device);
+-  check_add_mappable_device (input_settings, device);
++  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);
++    }
+ }
+ 
+ static void
+@@ -801,9 +782,25 @@ 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);
+ }
+ 



More information about the arch-commits mailing list