[gnome-online-accounts] telepathy: add a hack to avoid the personal details dialog from moving



commit 28f38a78522d613e84c71be67d6a603a6a5d405b
Author: Marco Barisione <marco barisione collabora co uk>
Date:   Thu Aug 22 14:19:58 2013 +0100

    telepathy: add a hack to avoid the personal details dialog from moving
    
    The personal details dialog loads its content asynchronously and then
    adapts its size to the content. This means that sometimes you can see
    the dialog moving after the content is loaded.
    
    This hack just adds a small timeout (not noticeable by the user) to hide
    the problem. The is no guarantee that the timeout is long enough, but it
    should be enough for most users (and a longer timeout would be
    noticeable by the user).
    
    In a future version we should add a way for the user info panel to
    signal us when the content is loaded. Alternatively we could create the
    panel when an account is selected, before the user clicks on the
    "Personal details" button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696267

 src/goabackend/goatelepathyprovider.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goatelepathyprovider.c b/src/goabackend/goatelepathyprovider.c
index c9aeab7..2b53667 100644
--- a/src/goabackend/goatelepathyprovider.c
+++ b/src/goabackend/goatelepathyprovider.c
@@ -619,6 +619,15 @@ user_info_apply_cb (GObject      *object,
 }
 
 static gboolean
+personal_details_timeout_cb (gpointer user_data)
+{
+  EditPersonalDetailsData *data = user_data;
+
+  g_main_loop_quit (data->loop);
+  return G_SOURCE_REMOVE;
+}
+
+static gboolean
 edit_personal_details (GoaObject  *goa_object,
                        GtkWindow  *parent,
                        GError    **error)
@@ -660,6 +669,9 @@ edit_personal_details (GoaObject  *goa_object,
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
   gtk_box_pack_start (GTK_BOX (content_area), align, TRUE, TRUE, 0);
 
+  g_timeout_add (100, personal_details_timeout_cb, &data);
+  g_main_loop_run (data.loop);
+
   response = gtk_dialog_run (GTK_DIALOG (dialog));
   if (response == GTK_RESPONSE_OK)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]