public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Pacho Ramos (pacho)" <pacho@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in gnome-base/gnome-session/files: gnome-session-2.32.1-idle-transition.patch gnome-session-2.32.1-gsettings-conditions.patch gnome-session-2.32.1-dialog-size2.patch gnome-session-2.32.1-dialog-size.patch
Date: Mon, 12 Sep 2011 10:01:54 +0000 (UTC)	[thread overview]
Message-ID: <20110912100154.C3C9C2004C@flycatcher.gentoo.org> (raw)

pacho       11/09/12 10:01:54

  Added:                gnome-session-2.32.1-idle-transition.patch
                        gnome-session-2.32.1-gsettings-conditions.patch
                        gnome-session-2.32.1-dialog-size2.patch
                        gnome-session-2.32.1-dialog-size.patch
  Log:
  Also support Gsettings conditions to work with latest libcanberra, fix race condition in idle monitor, fix dialog size, pull in x11-misc/xdg-user-dirs stuff as done in gnome-session-3. Remove old.
  
  (Portage version: 2.1.10.14/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  gnome-base/gnome-session/files/gnome-session-2.32.1-idle-transition.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-idle-transition.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-idle-transition.patch?rev=1.1&content-type=text/plain

Index: gnome-session-2.32.1-idle-transition.patch
===================================================================
From 861313503a741f0129611ca005cf6d7c27124b54 Mon Sep 17 00:00:00 2001
From: Christopher Halse Rogers <chalserogers@gmail.com>
Date: Thu, 26 May 2011 09:09:14 +0000
Subject: gsm: Fix race condition in idle monitor

In _xsync_alarm_set(), the positive and negative transition intervals
are set to the same value. However, the SYNC extension defines the
positive transition as set when the counter goes from strictly below the
threshold to greater than or equal to the threshold and similarly a
negative transition is triggered when the counter goes form strictly
greater than the threshold to less than or equal to the threshold.

Thus in the current set up there's a chance that the positive transition
can trigger, marking the session as idle, and some user input occur on
the same click so the IDLETIME count will hit the threshold but not go
above so the negative transition will not trigger. Thus the session will
not be marked as active.

The negative transition threshold should be set to 1ms less than the
positive transition to ensure that it always fires.

https://bugzilla.gnome.org/show_bug.cgi?id=627903
---
diff --git a/gnome-session/gs-idle-monitor.c b/gnome-session/gs-idle-monitor.c
index cd38dcb..d25144f 100644
--- a/gnome-session/gs-idle-monitor.c
+++ b/gnome-session/gs-idle-monitor.c
@@ -463,6 +463,7 @@ _xsync_alarm_set (GSIdleMonitor      *monitor,
                 watch->xalarm_positive = XSyncCreateAlarm (monitor->priv->display, flags, &attr);
         }
 
+        attr.trigger.wait_value = _int64_to_xsyncvalue (_xsyncvalue_to_int64 (watch->interval) - 1);
         attr.trigger.test_type = XSyncNegativeTransition;
         if (watch->xalarm_negative != None) {
                 g_debug ("GSIdleMonitor: updating alarm for negative transition wait=%lld",
--
cgit v0.9.0.2



1.1                  gnome-base/gnome-session/files/gnome-session-2.32.1-gsettings-conditions.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-gsettings-conditions.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-gsettings-conditions.patch?rev=1.1&content-type=text/plain

Index: gnome-session-2.32.1-gsettings-conditions.patch
===================================================================
--- gnome-session/gsm-autostart-app.c.old	2011-09-12 11:06:20.552420744 +0200
+++ gnome-session/gsm-autostart-app.c	2011-09-12 11:18:39.934966203 +0200
@@ -66,6 +66,7 @@
 
         GFileMonitor         *condition_monitor;
         guint                 condition_notify_id;
+        GSettings            *condition_settings;
 
         int                   launch_type;
         GPid                  pid;
@@ -164,6 +165,8 @@
                 kind = GSM_CONDITION_UNLESS_EXISTS;
         } else if (!g_ascii_strncasecmp (condition_string, "GNOME", len)) {
                 kind = GSM_CONDITION_GNOME;
+        } else if (!g_ascii_strncasecmp (condition_string, "GSettings", len)) {
+                kind = GSM_CONDITION_GSETTINGS;
         } else if (!g_ascii_strncasecmp (condition_string, "GNOME3", len)) {
                 condition_string = key;
                 space = condition_string + strcspn (condition_string, " ");
@@ -289,6 +292,81 @@
 }
 
 static void
+gsettings_condition_cb (GSettings  *settings,
+                        const char *key,
+                        gpointer    user_data)
+{
+        GsmApp                 *app;
+        GsmAutostartAppPrivate *priv;
+        gboolean                condition;
+        
+        g_return_if_fail (GSM_IS_APP (user_data));
+        
+        app = GSM_APP (user_data);
+        
+        priv = GSM_AUTOSTART_APP (app)->priv;
+        
+        condition = g_settings_get_boolean (settings, key);
+        
+        g_debug ("GsmAutostartApp: app:%s condition changed condition:%d",
+                gsm_app_peek_id (app),
+                condition);
+                
+        /* Emit only if the condition actually changed */
+        if (condition != priv->condition) {
+                priv->condition = condition;
+                g_signal_emit (app, signals[CONDITION_CHANGED], 0, condition);
+        }
+}
+
+static gboolean
+setup_gsettings_condition_monitor (GsmAutostartApp *app,
+                                  const char      *key)
+{
+        GSettings *settings;
+        const char * const *schemas;
+        char **elems;
+        gboolean schema_exists;
+        guint i;
+        gboolean retval;
+        char *signal;
+        
+        elems = g_strsplit (key, " ", 2);
+        if (elems == NULL)
+                return FALSE;
+        if (elems[0] == NULL || elems[1] == NULL) {
+                g_strfreev (elems);
+                return FALSE;
+        }
+        
+        schemas = g_settings_list_schemas ();
+        schema_exists = FALSE;
+        for (i = 0; schemas[i] != NULL; i++) {
+                if (g_str_equal (schemas[i], elems[0])) {
+                        schema_exists = TRUE;
+                        break;
+                }
+        }
+        
+        if (schema_exists == FALSE)
+                return FALSE;
+                
+        settings = g_settings_new (elems[0]);
+        retval = g_settings_get_boolean (settings, elems[1]);
+        
+        signal = g_strdup_printf ("changed::%s", elems[1]);
+        g_signal_connect (G_OBJECT (settings), signal,
+                          G_CALLBACK (gsettings_condition_cb), app);
+        g_free (signal);
+        
+        app->priv->condition_settings = settings;
+        
+        g_strfreev (elems);
+        
+        return retval;
+}
+
+static void
 setup_condition_monitor (GsmAutostartApp *app)
 {
         guint    kind;
@@ -383,6 +461,8 @@
                                                                           gconf_condition_cb,
                                                                           app, NULL, NULL);
                 g_object_unref (client);
+        } else if (kind == GSM_CONDITION_GSETTINGS) {
+                disabled = !setup_gsettings_condition_monitor (app, key);
         } else if (kind == GSM_CONDITION_IF_SESSION) {
                 /* We treat GNOME 2.32 as the same as gnome-fallback */
                 disabled = strcmp ("gnome-fallback", key) != 0;
@@ -578,6 +658,11 @@
                 priv->condition_string = NULL;
         }
 
+        if (priv->condition_settings) {
+                g_object_unref (priv->condition_settings);
+                priv->condition_settings = NULL;
+        }
+        
         if (priv->desktop_file) {
                 egg_desktop_file_free (priv->desktop_file);
                 priv->desktop_file = NULL;
@@ -672,6 +757,12 @@
                 g_assert (GCONF_IS_CLIENT (client));
                 disabled = !gconf_client_get_bool (client, key, NULL);
                 g_object_unref (client);
+        } else if (kind == GSM_CONDITION_GSETTINGS &&
+                   priv->condition_settings != NULL) {
+                char **elems;
+                elems = g_strsplit (key, " ", 2);
+                disabled = !g_settings_get_boolean (priv->condition_settings, elems[1]);
+                g_strfreev (elems);
         } else if (kind == GSM_CONDITION_IF_SESSION) {
                 /* We treat GNOME 2.32 as the same as gnome-fallback */
                 disabled = strcmp ("gnome-fallback", key) != 0;



1.1                  gnome-base/gnome-session/files/gnome-session-2.32.1-dialog-size2.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-dialog-size2.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-dialog-size2.patch?rev=1.1&content-type=text/plain

Index: gnome-session-2.32.1-dialog-size2.patch
===================================================================
From 6fd301895a39fc32f302ea3fced74fc03e5c75c9 Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@gnome.org>
Date: Mon, 29 Nov 2010 21:47:00 +0000
Subject: capplet: Also give the dialog a reasonable width

We don't want to depend on the natural size, which depends on the length
of strings for this.

https://bugzilla.gnome.org/show_bug.cgi?id=635891
---
diff --git a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
index 8b51169..487250e 100644
--- a/capplet/gsm-properties-dialog.c
+++ b/capplet/gsm-properties-dialog.c
@@ -784,7 +784,7 @@ gsm_properties_dialog_init (GsmPropertiesDialog *dialog)
                                                      "main-notebook"));
         gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
 
-        gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 450);
+        gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 450);
         gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
         gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
         gtk_box_set_spacing (GTK_BOX (content_area), 2);
--
cgit v0.9.0.2



1.1                  gnome-base/gnome-session/files/gnome-session-2.32.1-dialog-size.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-dialog-size.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.32.1-dialog-size.patch?rev=1.1&content-type=text/plain

Index: gnome-session-2.32.1-dialog-size.patch
===================================================================
From 8c4cdd5304929d19a27f876eb9cb5bbb67a4d59f Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@gnome.org>
Date: Mon, 29 Nov 2010 21:44:03 +0000
Subject: capplet: Give the dialog a reasonable default height

https://bugzilla.gnome.org/show_bug.cgi?id=635891
---
diff --git a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
index 4432b09..8b51169 100644
--- a/capplet/gsm-properties-dialog.c
+++ b/capplet/gsm-properties-dialog.c
@@ -784,6 +784,7 @@ gsm_properties_dialog_init (GsmPropertiesDialog *dialog)
                                                      "main-notebook"));
         gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
 
+        gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 450);
         gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
         gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
         gtk_box_set_spacing (GTK_BOX (content_area), 2);
--
cgit v0.9.0.2






                 reply	other threads:[~2011-09-12 10:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110912100154.C3C9C2004C@flycatcher.gentoo.org \
    --to=pacho@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox