commit 331f9752d55755f4a3699e042079d8e7d6a26c50
Author: Christian Bühler <christian@cbuehler.de>
Date:   Mon Oct 28 19:46:41 2013 +0100

    Use size of tab as desktop size for RDP protocol

diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index 0edb9ab..e9bb1e2 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -100,7 +100,7 @@ delay_connect (GObject *object)
   username = vinagre_connection_get_username (conn);
   i = 0;
 
-  arg = g_new (gchar *, 9);
+  arg = g_new (gchar *, 11);
   arg[i++] = g_strdup ("xfreerdp");
 
   arg[i++] = g_strdup ("-K");
@@ -108,6 +108,11 @@ delay_connect (GObject *object)
   if (vinagre_connection_get_fullscreen (conn))
     arg[i++] = g_strdup ("-f");
 
+  int w, h;
+  rdp_tab_get_dimensions (tab, &w, &h);
+  arg[i++] = g_strdup ("-g");
+  arg[i++] = g_strdup_printf ("%dx%d", w, h);
+
   arg[i++] = g_strdup ("-X");
   arg[i++] = g_strdup_printf ("%d", (int)gtk_socket_get_id (GTK_SOCKET (rdp_tab->priv->box)));
 

commit 68cc794e705bebc7b7229ec8f15479b5124fb47b
Author: Christian Bühler <christian@cbuehler.de>
Date:   Mon Oct 28 19:41:14 2013 +0100

    Revert "Allow to customize desktop size for RDP protocol"
    
    This reverts commit 01eadc757024cb8c3d3047f0dc912df2f4ba564f.
    
    Conflicts:
    	plugins/rdp/vinagre-rdp-tab.c

diff --git a/plugins/rdp/vinagre-rdp-connection.c b/plugins/rdp/vinagre-rdp-connection.c
index 99182c7..dfa9399 100644
--- a/plugins/rdp/vinagre-rdp-connection.c
+++ b/plugins/rdp/vinagre-rdp-connection.c
@@ -58,8 +58,7 @@ rdp_parse_item (VinagreConnection *conn, xmlNode *root)
 static void
 rdp_parse_options_widget (VinagreConnection *conn, GtkWidget *widget)
 {
-  GtkWidget *u_entry, *spin_button;
-  guint      width, height;
+  GtkWidget *u_entry;
 
   u_entry = g_object_get_data (G_OBJECT (widget), "username_entry");
   if (!u_entry)
@@ -73,34 +72,6 @@ rdp_parse_options_widget (VinagreConnection *conn, GtkWidget *widget)
   g_object_set (conn,
 		"username", gtk_entry_get_text (GTK_ENTRY (u_entry)),
 		NULL);
-
-
-  spin_button = g_object_get_data (G_OBJECT (widget), "width_spin_button");
-  if (!spin_button)
-    {
-      g_warning ("Wrong widget passed to rdp_parse_options_widget()");
-      return;
-    }
-
-  width = (guint) gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin_button));
-
-  vinagre_cache_prefs_set_integer  ("rdp-connection", "width", width);
-
-  vinagre_connection_set_width (conn, width);
-
-
-  spin_button = g_object_get_data (G_OBJECT (widget), "height_spin_button");
-  if (!spin_button)
-    {
-      g_warning ("Wrong widget passed to rdp_parse_options_widget()");
-      return;
-    }
-
-  height = (guint) gtk_spin_button_get_value (GTK_SPIN_BUTTON (spin_button));
-
-  vinagre_cache_prefs_set_integer  ("rdp-connection", "height", height);
-
-  vinagre_connection_set_height (conn, height);
 }
 
 static void
diff --git a/plugins/rdp/vinagre-rdp-plugin.c b/plugins/rdp/vinagre-rdp-plugin.c
index 149f7fa..41d7cd0 100644
--- a/plugins/rdp/vinagre-rdp-plugin.c
+++ b/plugins/rdp/vinagre-rdp-plugin.c
@@ -32,11 +32,6 @@
 #include "vinagre-rdp-connection.h"
 #include "vinagre-rdp-tab.h"
 
-#define DEFAULT_WIDTH   800
-#define DEFAULT_HEIGHT  600
-#define MIN_SIZE          1
-#define MAX_SIZE       8192
-
 void rdp_register_types (void);
 static void vinagre_rdp_protocol_iface_init (VinagreProtocolInterface *iface);
 
@@ -94,30 +89,28 @@ vinagre_rdp_plugin_init (VinagreRdpPlugin *plugin)
 static GtkWidget *
 impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
 {
-  GtkWidget *grid, *label, *u_entry, *spin_button;
+  GtkWidget *box, *label, *u_box, *u_entry;
   gchar     *str;
 
-  grid = gtk_grid_new ();
-  gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
-  gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
+  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
 
   str = g_strdup_printf ("<b>%s</b>", _("RDP Options"));
   label = gtk_label_new (str);
   g_free (str);
   gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
+  gtk_container_add (GTK_CONTAINER (box), label);
+
+  u_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
 
   label = gtk_label_new_with_mnemonic (_("_Username:"));
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
-  gtk_widget_set_margin_left (label, 12);
+  gtk_box_pack_start (GTK_BOX (u_box), label, FALSE, FALSE, 0);
 
   u_entry = gtk_entry_new ();
   /* Translators: This is the tooltip for the username field in a RDP connection */
   gtk_widget_set_tooltip_text (u_entry, _("Optional. If blank, your username will be used. Also, it can be supplied in the Host field above, in the form username@hostname."));
-  g_object_set_data (G_OBJECT (grid), "username_entry", u_entry);
-  gtk_grid_attach (GTK_GRID (grid), u_entry, 1, 1, 1, 1);
+  g_object_set_data (G_OBJECT (box), "username_entry", u_entry);
+  gtk_container_add (GTK_CONTAINER (u_box), u_entry);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), u_entry);
   str = g_strdup (VINAGRE_IS_CONNECTION (conn) ?
 		  vinagre_connection_get_username (conn) :
@@ -126,40 +119,9 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
   gtk_entry_set_activates_default (GTK_ENTRY (u_entry), TRUE);
   g_free (str);
 
-
-  /* Host width */
-  label = gtk_label_new_with_mnemonic (_("_Width:"));
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
-  gtk_widget_set_margin_left (label, 12);
-
-  spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
-  /* Translators: This is the tooltip for the width field in a RDP connection */
-  gtk_widget_set_tooltip_text (spin_button, _("Set width of the remote desktop"));
-  gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_WIDTH);
-  g_object_set_data (G_OBJECT (grid), "width_spin_button", spin_button);
-  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 2, 1, 1);
-  gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
-  gtk_entry_set_activates_default (GTK_ENTRY (spin_button), TRUE);
-
-
-  /* Host height */
-  label = gtk_label_new_with_mnemonic (_("_Height:"));
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
-  gtk_widget_set_margin_left (label, 12);
-
-  spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
-  /* Translators: This is the tooltip for the height field in a RDP connection */
-  gtk_widget_set_tooltip_text (spin_button, _("Set height of the remote desktop"));
-  gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_HEIGHT);
-  g_object_set_data (G_OBJECT (grid), "height_spin_button", spin_button);
-  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 3, 1, 1);
-  gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
-  gtk_entry_set_activates_default (GTK_ENTRY (spin_button), TRUE);
-
-
-  return grid;
+  gtk_widget_set_margin_left (u_box, 12);
+  gtk_container_add (GTK_CONTAINER (box), u_box);
+  return box;
 }
 
 static void
diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index abe33e1..0edb9ab 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -100,7 +100,7 @@ delay_connect (GObject *object)
   username = vinagre_connection_get_username (conn);
   i = 0;
 
-  arg = g_new (gchar *, 11);
+  arg = g_new (gchar *, 9);
   arg[i++] = g_strdup ("xfreerdp");
 
   arg[i++] = g_strdup ("-K");
@@ -108,11 +108,6 @@ delay_connect (GObject *object)
   if (vinagre_connection_get_fullscreen (conn))
     arg[i++] = g_strdup ("-f");
 
-  arg[i++] = g_strdup ("-g");
-  arg[i++] = g_strdup_printf ("%dx%d",
-			      vinagre_connection_get_width (conn),
-			      vinagre_connection_get_height (conn));
-
   arg[i++] = g_strdup ("-X");
   arg[i++] = g_strdup_printf ("%d", (int)gtk_socket_get_id (GTK_SOCKET (rdp_tab->priv->box)));
 
diff --git a/vinagre/vinagre-connection.c b/vinagre/vinagre-connection.c
index 3a3b9ac..ffa8e94 100644
--- a/vinagre/vinagre-connection.c
+++ b/vinagre/vinagre-connection.c
@@ -29,11 +29,6 @@
 #include "vinagre-plugins-engine.h"
 #include "vinagre-vala.h"
 
-#define DEFAULT_WIDTH   800
-#define DEFAULT_HEIGHT  600
-#define MIN_SIZE          1
-#define MAX_SIZE       8192
-
 struct _VinagreConnectionPrivate
 {
   gchar *protocol;
@@ -43,8 +38,6 @@ struct _VinagreConnectionPrivate
   gchar *password;
   gchar *name;
   gboolean fullscreen;
-  guint  width;
-  guint  height;
 };
 
 enum
@@ -57,9 +50,7 @@ enum
   PROP_PASSWORD,
   PROP_NAME,
   PROP_BEST_NAME,
-  PROP_FULLSCREEN,
-  PROP_WIDTH,
-  PROP_HEIGHT
+  PROP_FULLSCREEN
 };
 
 #define VINAGRE_CONNECTION_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), VINAGRE_TYPE_CONNECTION, VinagreConnectionPrivate))
@@ -77,8 +68,6 @@ vinagre_connection_init (VinagreConnection *conn)
   conn->priv->username = NULL;
   conn->priv->name = NULL;
   conn->priv->fullscreen = FALSE;
-  conn->priv->width = DEFAULT_WIDTH;
-  conn->priv->height = DEFAULT_HEIGHT;
 }
 
 static void
@@ -134,14 +123,6 @@ vinagre_connection_set_property (GObject *object, guint prop_id, const GValue *v
 	vinagre_connection_set_name (conn, g_value_get_string (value));
 	break;
 
-      case PROP_WIDTH:
-	vinagre_connection_set_width (conn, g_value_get_uint (value));
-	break;
-
-      case PROP_HEIGHT:
-	vinagre_connection_set_height (conn, g_value_get_uint (value));
-	break;
-
       default:
 	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 	break;
@@ -192,14 +173,6 @@ vinagre_connection_get_property (GObject *object, guint prop_id, GValue *value,
 	g_value_set_string (value, vinagre_connection_get_best_name (conn));
 	break;
 
-      case PROP_WIDTH:
-	g_value_set_uint (value, conn->priv->width);
-	break;
-
-      case PROP_HEIGHT:
-	g_value_set_uint (value, conn->priv->height);
-	break;
-
       default:
 	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 	break;
@@ -216,8 +189,6 @@ default_fill_writer (VinagreConnection *conn, xmlTextWriter *writer)
   xmlTextWriterWriteElement (writer, BAD_CAST "username", BAD_CAST (conn->priv->username ? conn->priv->username : ""));
   xmlTextWriterWriteFormatElement (writer, BAD_CAST "port", "%d", conn->priv->port);
   xmlTextWriterWriteFormatElement (writer, BAD_CAST "fullscreen", "%d", conn->priv->fullscreen);
-  xmlTextWriterWriteFormatElement (writer, BAD_CAST "width", "%d", conn->priv->width);
-  xmlTextWriterWriteFormatElement (writer, BAD_CAST "height", "%d", conn->priv->height);
 }
 
 static void
@@ -240,10 +211,6 @@ default_parse_item (VinagreConnection *conn, xmlNode *root)
 	vinagre_connection_set_port (conn, atoi ((const char *)s_value));
       else if (!xmlStrcmp(curr->name, BAD_CAST "fullscreen"))
 	vinagre_connection_set_fullscreen (conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
-      else if (!xmlStrcmp(curr->name, BAD_CAST "width"))
-	vinagre_connection_set_width (conn, atoi ((const char *)s_value));
-      else if (!xmlStrcmp(curr->name, BAD_CAST "height"))
-	vinagre_connection_set_height (conn, atoi ((const char *)s_value));
 
       xmlFree (s_value);
     }
@@ -380,30 +347,6 @@ vinagre_connection_class_init (VinagreConnectionClass *klass)
                                                         G_PARAM_STATIC_NAME |
                                                         G_PARAM_STATIC_BLURB));
 
-  g_object_class_install_property (object_class,
-                                   PROP_WIDTH,
-                                   g_param_spec_uint ("width",
-                                                      "width",
-                                                      "width of screen",
-                                                       MIN_SIZE,
-                                                       MAX_SIZE,
-                                                       DEFAULT_WIDTH,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT |
-                                                       G_PARAM_STATIC_STRINGS));
-
-  g_object_class_install_property (object_class,
-                                   PROP_HEIGHT,
-                                   g_param_spec_uint ("height",
-                                                      "height",
-                                                      "height of screen",
-                                                       MIN_SIZE,
-                                                       MAX_SIZE,
-                                                       DEFAULT_HEIGHT,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT |
-                                                       G_PARAM_STATIC_STRINGS));
-
 }
 
 void
@@ -526,38 +469,6 @@ vinagre_connection_get_name (VinagreConnection *conn)
   return conn->priv->name;
 }
 
-void
-vinagre_connection_set_width (VinagreConnection *conn,
-			      guint width)
-{
-  g_return_if_fail (VINAGRE_IS_CONNECTION (conn));
-
-  conn->priv->width = width;
-}
-guint
-vinagre_connection_get_width (VinagreConnection *conn)
-{
-  g_return_val_if_fail (VINAGRE_IS_CONNECTION (conn), 0);
-
-  return conn->priv->width;
-}
-
-void
-vinagre_connection_set_height (VinagreConnection *conn,
-			       guint height)
-{
-  g_return_if_fail (VINAGRE_IS_CONNECTION (conn));
-
-  conn->priv->height = height;
-}
-guint
-vinagre_connection_get_height (VinagreConnection *conn)
-{
-  g_return_val_if_fail (VINAGRE_IS_CONNECTION (conn), 0);
-
-  return conn->priv->height;
-}
-
 /**
  * vinagre_connection_split_string:
  * @uri: The URI to be splitted.
diff --git a/vinagre/vinagre-connection.h b/vinagre/vinagre-connection.h
index 7fc130c..16b8971 100644
--- a/vinagre/vinagre-connection.h
+++ b/vinagre/vinagre-connection.h
@@ -88,14 +88,6 @@ gboolean	    vinagre_connection_get_fullscreen	(VinagreConnection *conn);
 void		    vinagre_connection_set_fullscreen	(VinagreConnection *conn,
 							 gboolean value);
 
-guint		    vinagre_connection_get_width	(VinagreConnection *conn);
-void		    vinagre_connection_set_width	(VinagreConnection *conn,
-							 guint width);
-
-guint		    vinagre_connection_get_height	(VinagreConnection *conn);
-void		    vinagre_connection_set_height	(VinagreConnection *conn,
-							 guint height);
-
 VinagreConnection*  vinagre_connection_new_from_string	(const gchar *url, gchar **error_msg, gboolean use_bookmarks);
 VinagreConnection*  vinagre_connection_new_from_file	(const gchar *uri, gchar **error_msg, gboolean use_bookmarks);
 
