[gnome-online-accounts] telepathy: Ensure that the dialog is not unnecessarily tall



commit db2abfec37bdc9a8405d5f8d7176bd575fa81e4e
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 14 19:19:05 2016 +0100

    telepathy: Ensure that the dialog is not unnecessarily tall
    
    The GtkWindow size handling logic has changed in newer GTK+. We should
    be using GtkWindow API, not GtkWidget API, to get and set the size of
    a dialog, so that things like CSD chrome are correctly handled.
    
    However, gtk_window_set_default_size didn't work with non-resizable
    GtkWindows, until now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762548

 src/goabackend/goatelepathyprovider.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/goabackend/goatelepathyprovider.c b/src/goabackend/goatelepathyprovider.c
index 75c410f..931a71d 100644
--- a/src/goabackend/goatelepathyprovider.c
+++ b/src/goabackend/goatelepathyprovider.c
@@ -408,8 +408,8 @@ add_account (GoaProvider  *provider,
   AddAccountData data;
   TpawAccountSettings *settings = NULL;
   TpawAccountWidget *account_widget = NULL;
-  GtkRequisition req;
   gint response;
+  gint width;
 
   settings = tpaw_protocol_create_account_settings (priv->protocol);
   if (settings == NULL)
@@ -447,8 +447,8 @@ add_account (GoaProvider  *provider,
   /* The dialog now contains a lot of empty space between the account widget
    * and the buttons. We force it's vertical size to be just right to fit the
    * widget. */
-  gtk_widget_get_preferred_size (GTK_WIDGET (dialog), NULL, &req);
-  gtk_widget_set_size_request (GTK_WIDGET (dialog), req.width, 1);
+  gtk_window_get_size (GTK_WINDOW (dialog), &width, NULL);
+  gtk_window_set_default_size (GTK_WINDOW (dialog), width, -1);
 
   response = gtk_dialog_run (GTK_DIALOG (dialog));
   if (response != GTK_RESPONSE_OK && response != GTK_RESPONSE_APPLY)


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