Commit bf34393e authored by Antenore Gatta's avatar Antenore Gatta

Merging from next

parents 7ec707e5 73bfd1ea
# Change Log
## [v1.2.0-rcgit.24](https://github.com/FreeRDP/Remmina/tree/v1.2.0-rcgit.24) (2017-10-25)
[Full Changelog](https://github.com/FreeRDP/Remmina/compare/v1.2.0-rcgit.23...v1.2.0-rcgit.24)
**Closed issues:**
- vte no longer optional [\#1327](https://github.com/FreeRDP/Remmina/issues/1327)
- libwinpr.so.2 dependcy missing [\#1312](https://github.com/FreeRDP/Remmina/issues/1312)
**Merged pull requests:**
- Fix for \#1323 [\#1339](https://github.com/FreeRDP/Remmina/pull/1339) ([giox069](https://github.com/giox069))
## [v1.2.0-rcgit.23](https://github.com/FreeRDP/Remmina/tree/v1.2.0-rcgit.23) (2017-10-23)
[Full Changelog](https://github.com/FreeRDP/Remmina/compare/v1.2.0-rcgit.22...v1.2.0-rcgit.23)
**Implemented enhancements:**
- SSH session log to file [\#1320](https://github.com/FreeRDP/Remmina/issues/1320)
- Save SSH session to file \#1320 [\#1333](https://github.com/FreeRDP/Remmina/pull/1333) ([antenore](https://github.com/antenore))
**Merged pull requests:**
......@@ -149,6 +162,7 @@
- SSH Tunneling is broken with SSH Agent with public key [\#1228](https://github.com/FreeRDP/Remmina/issues/1228)
- Missing icons after compiling latest Git release [\#1221](https://github.com/FreeRDP/Remmina/issues/1221)
- RDP quality settings not saved [\#1216](https://github.com/FreeRDP/Remmina/issues/1216)
- RDP to Win10 makes ToolBar clear [\#1209](https://github.com/FreeRDP/Remmina/issues/1209)
- Cannot connect after upgrading Ubuntu to 16.04 [\#946](https://github.com/FreeRDP/Remmina/issues/946)
**Merged pull requests:**
......@@ -197,7 +211,6 @@
**Closed issues:**
- Invalid \(too large\) file size in rdp shared folder [\#1220](https://github.com/FreeRDP/Remmina/issues/1220)
- RDP to Win10 makes ToolBar clear [\#1209](https://github.com/FreeRDP/Remmina/issues/1209)
- Upgrading to 1.2 failed [\#1202](https://github.com/FreeRDP/Remmina/issues/1202)
- Multiple NICs [\#1188](https://github.com/FreeRDP/Remmina/issues/1188)
- "Public Key \(Automatic\)" option does not work with ed25519 keys [\#1187](https://github.com/FreeRDP/Remmina/issues/1187)
......
......@@ -108,7 +108,7 @@ set(WITH_LIBRARY_VERSIONING "ON")
set(REMMINA_VERSION_MAJOR "1")
set(REMMINA_VERSION_MINOR "2")
set(REMMINA_VERSION_REVISION "0")
set(REMMINA_VERSION_SUFFIX "rcgit-23")
set(REMMINA_VERSION_SUFFIX "rcgit-24")
set(REMMINA_VERSION "${REMMINA_VERSION_MAJOR}.${REMMINA_VERSION_MINOR}.${REMMINA_VERSION_REVISION}")
if(NOT ${REMMINA_VERSION_SUFFIX} STREQUAL "")
set(REMMINA_VERSION "${REMMINA_VERSION}-${REMMINA_VERSION_SUFFIX}")
......
......@@ -477,8 +477,8 @@ static gboolean remmina_plugin_nx_start_session(RemminaProtocolWidget *gp)
i = remmina_plugin_nx_service->file_get_int(remminafile, "quality", 0);
remmina_nx_session_add_parameter(nx, "link", i > 2 ? "lan" : i == 2 ? "adsl" : i == 1 ? "isdn" : "modem");
remmina_nx_session_add_parameter(nx, "geometry", "%ix%i",
remmina_plugin_nx_service->file_get_int(remminafile, "resolution_width", 0),
remmina_plugin_nx_service->file_get_int(remminafile, "resolution_height", 0));
remmina_plugin_nx_service->get_profile_remote_width(gp),
remmina_plugin_nx_service->get_profile_remote_height(gp));
remmina_nx_session_add_parameter(nx, "keyboard", remmina_kbtype);
remmina_nx_session_add_parameter(nx, "client", "linux");
remmina_nx_session_add_parameter(nx, "media", "0");
......
......@@ -230,16 +230,6 @@ static RemminaFile* remmina_rdp_file_import_channel(GIOChannel* channel)
g_free(line);
}
if (remmina_plugin_service->file_get_int(remminafile, "resolution_width", 0) > 0 &&
remmina_plugin_service->file_get_int(remminafile, "resolution_height", 0) > 0)
{
p = g_strdup_printf("%ix%i",
remmina_plugin_service->file_get_int(remminafile, "resolution_width", 0),
remmina_plugin_service->file_get_int(remminafile, "resolution_height", 0));
remmina_plugin_service->file_set_string(remminafile, "resolution", p);
g_free(p);
}
remmina_plugin_service->file_set_string(remminafile, "name",
remmina_plugin_service->file_get_string(remminafile, "server"));
remmina_plugin_service->file_set_string(remminafile, "protocol", "RDP");
......
......@@ -746,8 +746,8 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget* gp)
rfi->settings->ColorDepth = 32;
}
rfi->settings->DesktopWidth = remmina_plugin_service->file_get_int(remminafile, "resolution_width", 1024);
rfi->settings->DesktopHeight = remmina_plugin_service->file_get_int(remminafile, "resolution_height", 768);
rfi->settings->DesktopWidth = remmina_plugin_service->get_profile_remote_width(gp);
rfi->settings->DesktopHeight = remmina_plugin_service->get_profile_remote_height(gp);
dynresw = remmina_plugin_service->file_get_int(remminafile, "dynamic_resolution_width", 0);
dynresh = remmina_plugin_service->file_get_int(remminafile, "dynamic_resolution_height", 0);
......@@ -1087,6 +1087,12 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget* gp)
case FREERDP_ERROR_DNS_NAME_NOT_FOUND:
remmina_plugin_service->protocol_plugin_set_error(gp, _("Unable to find the address of RDP server %s."), rfi->settings->ServerHostname );
break;
case FREERDP_ERROR_TLS_CONNECT_FAILED:
remmina_plugin_service->protocol_plugin_set_error(gp, _("Error connecting to RDP server %s. TLS connection failed. Check that client and server support a common TLS version."), rfi->settings->ServerHostname );
break;
case FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED:
remmina_plugin_service->protocol_plugin_set_error(gp, _("Unable to establish a connection to RDP server %s."), rfi->settings->ServerHostname );
break;
default:
remmina_plugin_service->protocol_plugin_set_error(gp, _("Unable to connect to RDP server %s"), rfi->settings->ServerHostname);
break;
......
......@@ -119,8 +119,8 @@ static gboolean remmina_plugin_xdmcp_start_xephyr(RemminaProtocolWidget *gp)
{
argv[argc++] = g_strdup("-screen");
argv[argc++] = g_strdup_printf("%ix%ix%i",
remmina_plugin_service->file_get_int(remminafile, "resolution_width", 640),
remmina_plugin_service->file_get_int(remminafile, "resolution_height", 480), i);
remmina_plugin_service->get_profile_remote_width(gp),
remmina_plugin_service->get_profile_remote_height(gp), i);
}
if (i == 2)
......@@ -291,8 +291,8 @@ static gboolean remmina_plugin_xdmcp_open_connection(RemminaProtocolWidget *gp)
remminafile = remmina_plugin_service->protocol_plugin_get_file(gp);
width = remmina_plugin_service->file_get_int(remminafile, "resolution_width", 640);
height = remmina_plugin_service->file_get_int(remminafile, "resolution_height", 480);
width = remmina_plugin_service->get_profile_remote_width(gp);
height = remmina_plugin_service->get_profile_remote_height(gp);
remmina_plugin_service->protocol_plugin_set_width(gp, width);
remmina_plugin_service->protocol_plugin_set_height(gp, height);
gtk_widget_set_size_request(GTK_WIDGET(gp), width, height);
......
......@@ -226,6 +226,8 @@ typedef struct _RemminaPluginService
void (* get_server_port) (const gchar *server, gint defaultport, gchar **host, gint *port);
gboolean (* is_main_thread) (void);
gboolean (* gtksocket_available) (void);
gint (* get_profile_remote_width) (RemminaProtocolWidget *gp);
gint (* get_profile_remote_height) (RemminaProtocolWidget *gp);
} RemminaPluginService;
......
......@@ -4010,8 +4010,6 @@ GtkWidget* remmina_connection_window_open_from_file_full(RemminaFile* remminafil
RemminaConnectionObject* cnnobj;
GtkWidget* protocolwidget;
remmina_file_update_screen_resolution(remminafile);
cnnobj = g_new0(RemminaConnectionObject, 1);
cnnobj->remmina_file = remminafile;
......@@ -4021,6 +4019,13 @@ GtkWidget* remmina_connection_window_open_from_file_full(RemminaFile* remminafil
/* Create the RemminaProtocolWidget */
protocolwidget = cnnobj->proto = remmina_protocol_widget_new();
/* Set default remote desktop size in the profile, so the plugins can query
* protocolwidget and know WxH that the user put on the profile settings */
remmina_protocol_widget_update_remote_resolution((RemminaProtocolWidget*)protocolwidget,
remmina_file_get_int(remminafile, "resolution_width", -1),
remmina_file_get_int(remminafile, "resolution_height", -1)
);
/* Set a name for the widget, for CSS selector */
gtk_widget_set_name(GTK_WIDGET(cnnobj->proto),"remmina-protocol-widget");
......
......@@ -79,6 +79,7 @@ remmina_file_new_empty(void)
* it's used by remmina_file_store_secret_plugin_password() to know
* where to change */
remminafile->spsettings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
remminafile->prevent_saving = FALSE;
return remminafile;
}
......@@ -444,6 +445,9 @@ void remmina_file_save(RemminaFile *remminafile)
GKeyFile *gkeyfile;
gsize length = 0;
if (remminafile->prevent_saving)
return;
if ((gkeyfile = remmina_file_get_keyfile(remminafile)) == NULL)
return;
......@@ -554,55 +558,6 @@ remmina_file_dup(RemminaFile *remminafile)
return dupfile;
}
void remmina_file_update_screen_resolution(RemminaFile *remminafile)
{
TRACE_CALL("__func__");
GdkDisplay *display;
#if GTK_CHECK_VERSION(3, 20, 0)
/* TODO: rename to "seat" */
GdkSeat *seat;
GdkDevice *device;
#else
GdkDeviceManager *device_manager;
GdkDevice *device;
#endif
GdkScreen *screen;
#if GTK_CHECK_VERSION(3, 22, 0)
GdkMonitor *monitor;
#else
gint monitor;
#endif
const gchar *resolution_w, *resolution_h;
gint x, y;
GdkRectangle rect;
resolution_w = remmina_file_get_string(remminafile, "resolution_width");
resolution_h = remmina_file_get_string(remminafile, "resolution_height");
if (resolution_w == NULL || resolution_h == NULL || resolution_w[0] == 0 || resolution_h[0] == 0)
{
display = gdk_display_get_default();
/* gdk_display_get_device_manager deprecated since 3.20, Use gdk_display_get_default_seat */
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat(display);
device = gdk_seat_get_pointer(seat);
#else
device_manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(device_manager);
#endif
gdk_device_get_position(device, &screen, &x, &y);
#if GTK_CHECK_VERSION(3, 22, 0)
monitor = gdk_display_get_monitor_at_point(display, x, y);
gdk_monitor_get_geometry(monitor, &rect);
#else
monitor = gdk_screen_get_monitor_at_point(screen, x, y);
gdk_screen_get_monitor_geometry(screen, monitor, &rect);
#endif
remmina_file_set_int(remminafile, "resolution_width", rect.width);
remmina_file_set_int(remminafile, "resolution_height", rect.height);
}
}
const gchar*
remmina_file_get_icon_name(RemminaFile *remminafile)
{
......
......@@ -45,6 +45,7 @@ struct _RemminaFile
gchar *filename;
GHashTable *settings;
GHashTable *spsettings;
gboolean prevent_saving;
};
enum
......@@ -78,8 +79,6 @@ void remmina_file_save(RemminaFile *remminafile);
void remmina_file_free(RemminaFile *remminafile);
/* Duplicate a RemminaFile object */
RemminaFile* remmina_file_dup(RemminaFile *remminafile);
/* Update the screen width and height members */
void remmina_file_update_screen_resolution(RemminaFile *remminafile);
/* Get the protocol icon name */
const gchar* remmina_file_get_icon_name(RemminaFile *remminafile);
/* Duplicate a temporary RemminaFile and change the protocol */
......
......@@ -470,8 +470,14 @@ static GtkWidget* remmina_file_editor_create_password(RemminaFileEditor* gfe, Gt
static void remmina_file_editor_update_resolution(GtkWidget* widget, RemminaFileEditor* gfe)
{
TRACE_CALL("__func__");
gchar* res_str;
res_str = g_strdup_printf("%dx%d",
remmina_file_get_int(gfe->priv->remmina_file, "resolution_width",0),
remmina_file_get_int(gfe->priv->remmina_file, "resolution_height",0)
);
remmina_public_load_combo_text_d(gfe->priv->resolution_custom_combo, remmina_pref.resolutions,
remmina_file_get_string(gfe->priv->remmina_file, "resolution"), NULL);
res_str, NULL);
g_free(res_str);
}
static void remmina_file_editor_browse_resolution(GtkWidget* button, RemminaFileEditor* gfe)
......@@ -1165,7 +1171,7 @@ static void remmina_file_editor_update(RemminaFileEditor* gfe)
{
/* Resolution is set to a value from the list */
custom_resolution = remmina_public_combo_get_active_text(GTK_COMBO_BOX(priv->resolution_custom_combo));
if (sscanf(custom_resolution, "%dx%d", &w, &h) >= 2)
if (remmina_public_split_resolution_string(custom_resolution, &w, &h))
{
res_w = g_strdup_printf("%i", w);
res_h = g_strdup_printf("%i", h);
......@@ -1244,6 +1250,7 @@ static void remmina_file_editor_on_connect(GtkWidget* button, RemminaFileEditor*
remmina_file_set_string(gf, "name", remmina_file_get_string(gf, "server"));
}
gtk_widget_destroy(GTK_WIDGET(gfe));
gf->prevent_saving = TRUE;
remmina_connection_window_open_from_file(gf);
}
......
......@@ -185,7 +185,9 @@ RemminaPluginService remmina_plugin_manager_service =
remmina_connection_window_open_from_file_full,
remmina_public_get_server_port,
remmina_masterthread_exec_is_main_thread,
remmina_gtksocket_available
remmina_gtksocket_available,
remmina_protocol_widget_get_profile_remote_width,
remmina_protocol_widget_get_profile_remote_height
};
......
......@@ -79,6 +79,10 @@ struct _RemminaProtocolWidgetPriv
RemminaHostkeyFunc hostkey_func;
gpointer hostkey_func_data;
gint profile_remote_width;
gint profile_remote_height;
};
G_DEFINE_TYPE(RemminaProtocolWidget, remmina_protocol_widget, GTK_TYPE_EVENT_BOX)
......@@ -897,6 +901,21 @@ GtkWidget* remmina_protocol_widget_get_init_dialog(RemminaProtocolWidget* gp)
return gp->priv->init_dialog;
}
gint remmina_protocol_widget_get_profile_remote_width(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_protocol_widget_get_profile_remote_width");
/* Returns the width of remote desktop as choosen by the user profile */
return gp->priv->profile_remote_width;
}
gint remmina_protocol_widget_get_profile_remote_height(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_protocol_widget_get_profile_remote_height");
/* Returns the height of remote desktop as choosen by the user profile */
return gp->priv->profile_remote_height;
}
gint remmina_protocol_widget_get_width(RemminaProtocolWidget* gp)
{
TRACE_CALL("__func__");
......@@ -1012,11 +1031,12 @@ gint remmina_protocol_widget_init_authpwd(RemminaProtocolWidget* gp, RemminaAuth
s = g_strdup(_("Password"));
break;
}
ret = remmina_init_dialog_authpwd(
REMMINA_INIT_DIALOG(gp->priv->init_dialog),
s,
remmina_file_get_filename(remminafile) != NULL &&
allow_password_saving);
(remmina_file_get_filename(remminafile) != NULL &&
!remminafile->prevent_saving && allow_password_saving));
g_free(s);
return ret;
......@@ -1032,7 +1052,8 @@ gint remmina_protocol_widget_init_authuserpwd(RemminaProtocolWidget* gp, gboolea
want_domain,
remmina_file_get_string(remminafile, "username"),
want_domain ? remmina_file_get_string(remminafile, "domain") : NULL,
(remmina_file_get_filename(remminafile) != NULL) && allow_password_saving);
(remmina_file_get_filename(remminafile) != NULL &&
!remminafile->prevent_saving && allow_password_saving));
}
gint remmina_protocol_widget_init_certificate(RemminaProtocolWidget* gp, const gchar* subject, const gchar* issuer, const gchar* fingerprint)
......@@ -1315,3 +1336,53 @@ void remmina_protocol_widget_send_keys_signals(GtkWidget *widget, const guint *k
}
}
}
void remmina_protocol_widget_update_remote_resolution(RemminaProtocolWidget* gp, gint w, gint h)
{
TRACE_CALL("remmina_file_update_screen_resolution");
GdkDisplay *display;
#if GTK_CHECK_VERSION(3, 20, 0)
/* TODO: rename to "seat" */
GdkSeat *seat;
GdkDevice *device;
#else
GdkDeviceManager *device_manager;
GdkDevice *device;
#endif
GdkScreen *screen;
#if GTK_CHECK_VERSION(3, 22, 0)
GdkMonitor *monitor;
#else
gint monitor;
#endif
gint x, y;
GdkRectangle rect;
if (w <= 0 || h <= 0)
{
display = gdk_display_get_default();
/* gdk_display_get_device_manager deprecated since 3.20, Use gdk_display_get_default_seat */
#if GTK_CHECK_VERSION(3, 20, 0)
seat = gdk_display_get_default_seat(display);
device = gdk_seat_get_pointer(seat);
#else
device_manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(device_manager);
#endif
gdk_device_get_position(device, &screen, &x, &y);
#if GTK_CHECK_VERSION(3, 22, 0)
monitor = gdk_display_get_monitor_at_point(display, x, y);
gdk_monitor_get_geometry(monitor, &rect);
#else
monitor = gdk_screen_get_monitor_at_point(screen, x, y);
gdk_screen_get_monitor_geometry(screen, monitor, &rect);
#endif
w = rect.width;
h = rect.height;
}
gp->priv->profile_remote_width = w;
gp->priv->profile_remote_height = h;
}
......@@ -83,6 +83,9 @@ gint remmina_protocol_widget_get_width(RemminaProtocolWidget *gp);
void remmina_protocol_widget_set_width(RemminaProtocolWidget *gp, gint width);
gint remmina_protocol_widget_get_height(RemminaProtocolWidget *gp);
void remmina_protocol_widget_set_height(RemminaProtocolWidget *gp, gint height);
gint remmina_protocol_widget_get_profile_remote_width(RemminaProtocolWidget* gp);
gint remmina_protocol_widget_get_profile_remote_height(RemminaProtocolWidget* gp);
RemminaScaleMode remmina_protocol_widget_get_current_scale_mode(RemminaProtocolWidget *gp);
void remmina_protocol_widget_set_current_scale_mode(RemminaProtocolWidget *gp, RemminaScaleMode scalemode);
gboolean remmina_protocol_widget_get_expand(RemminaProtocolWidget *gp);
......@@ -152,6 +155,8 @@ void remmina_protocol_widget_send_keystrokes(RemminaProtocolWidget* gp, GtkMenuI
/* Take screenshot of plugin */
gboolean remmina_protocol_widget_plugin_screenshot(RemminaProtocolWidget* gp, RemminaPluginScreenshotData *rpsd);
void remmina_protocol_widget_update_remote_resolution(RemminaProtocolWidget* gp, gint w, gint h);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment