Commit 782e26ae authored by Jean-Louis Dupond's avatar Jean-Louis Dupond

Fix deprecated functions

parent ed895f5e
......@@ -350,7 +350,7 @@ gboolean remmina_plugin_vnc_setcursor(RemminaProtocolWidget *gp)
cur = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), gpdata->queuecursor_pixbuf, gpdata->queuecursor_x,
gpdata->queuecursor_y);
gdk_window_set_cursor(gtk_widget_get_window(gpdata->drawing_area), cur);
gdk_cursor_unref(cur);
g_object_unref(cur);
g_object_unref(gpdata->queuecursor_pixbuf);
gpdata->queuecursor_pixbuf = NULL;
}
......@@ -1580,9 +1580,9 @@ static void remmina_plugin_vnc_on_realize(RemminaProtocolWidget *gp, gpointer da
/* Hide local cursor (show a small dot instead) */
pixbuf = gdk_pixbuf_new_from_xpm_data(dot_cursor_xpm);
cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), pixbuf, dot_cursor_x_hot, dot_cursor_y_hot);
gdk_pixbuf_unref(pixbuf);
g_object_unref(pixbuf);
gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(gp)), cursor);
gdk_cursor_unref(cursor);
g_object_unref(cursor);
}
}
......
......@@ -55,7 +55,7 @@ static gchar *remmina_option_plugin;
static gboolean remmina_option_quit;
static gchar *remmina_option_server;
static gchar *remmina_option_protocol;
static gboolean remmina_option_icon;
static gchar *remmina_option_icon;
static GOptionEntry remmina_options[] =
{
......
......@@ -128,14 +128,22 @@ static void remmina_connection_holder_create_fullscreen(RemminaConnectionHolder*
static void remmina_connection_window_class_init(RemminaConnectionWindowClass* klass)
{
gtk_rc_parse_string("style \"remmina-small-button-style\"\n"
GtkCssProvider *provider;
provider = gtk_css_provider_new();
gtk_css_provider_load_from_data (provider,
"*.remmina-small-button\n"
"{\n"
" GtkWidget::focus-padding = 0\n"
" GtkWidget::focus-line-width = 0\n"
" -GtkWidget::focus-padding = 0\n"
" -GtkWidget::focus-line-width = 0\n"
" xthickness = 0\n"
" ythickness = 0\n"
"}\n"
"widget \"*.remmina-small-button\" style \"remmina-small-button-style\"");
"}\n",
-1, NULL);
gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref(provider);
}
static void remmina_connection_holder_disconnect(RemminaConnectionHolder* cnnhld)
......@@ -150,14 +158,24 @@ static void remmina_connection_holder_disconnect(RemminaConnectionHolder* cnnhld
static void remmina_connection_holder_keyboard_grab(RemminaConnectionHolder* cnnhld)
{
DECLARE_CNNOBJ
GdkDisplay *display;
GdkDeviceManager *manager;
GdkDevice *keyboard = NULL;
display = gtk_widget_get_display(GTK_WIDGET(cnnhld->cnnwin));
manager = gdk_display_get_device_manager(display);
keyboard = gdk_device_manager_get_client_pointer(manager);
if (keyboard != NULL)
{
if (remmina_file_get_int(cnnobj->remmina_file, "keyboard_grab", FALSE))
{
gdk_keyboard_grab(gtk_widget_get_window(GTK_WIDGET(cnnhld->cnnwin)), TRUE, GDK_CURRENT_TIME);
gdk_device_grab(keyboard, gtk_widget_get_window(GTK_WIDGET(cnnhld->cnnwin)), GDK_OWNERSHIP_WINDOW, TRUE, GDK_KEY_PRESS | GDK_KEY_RELEASE, NULL, GDK_CURRENT_TIME);
}
else
{
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gdk_device_ungrab(keyboard, GDK_CURRENT_TIME);
}
}
}
......@@ -245,7 +263,7 @@ static gboolean remmina_connection_holder_floating_toolbar_motion(RemminaConnect
return FALSE;
}
gtk_widget_size_request(priv->floating_toolbar, &req);
gtk_widget_get_preferred_size(priv->floating_toolbar, &req, NULL);
gtk_window_get_position(GTK_WINDOW(priv->floating_toolbar), &x, &y);
if (priv->floating_toolbar_motion_show || priv->floating_toolbar_motion_visible)
......@@ -427,9 +445,9 @@ static void remmina_connection_object_init_adjustment(RemminaConnectionObject* c
screen_width = gdk_screen_get_width(screen);
screen_height = gdk_screen_get_height(screen);
adj = gtk_viewport_get_hadjustment(GTK_VIEWPORT(cnnobj->viewport));
adj = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(cnnobj->viewport));
gtk_adjustment_set_page_size(adj, screen_width);
adj = gtk_viewport_get_vadjustment(GTK_VIEWPORT(cnnobj->viewport));
adj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(cnnobj->viewport));
gtk_adjustment_set_page_size(adj, screen_height);
}
......@@ -763,14 +781,23 @@ static void remmina_connection_holder_scale_option_on_scaled(GtkWidget* widget,
static void remmina_connection_holder_scale_option_popdown(RemminaConnectionHolder* cnnhld)
{
GdkDisplay *display;
GdkDeviceManager *manager;
GdkDevice *device = NULL;
RemminaConnectionWindowPriv* priv = cnnhld->cnnwin->priv;
priv->sticky = FALSE;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(priv->scale_option_button), FALSE);
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gdk_pointer_ungrab(GDK_CURRENT_TIME);
display = gtk_widget_get_display(GTK_WIDGET(cnnhld));
manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(manager);
if (device != NULL)
{
gdk_device_ungrab(device, GDK_CURRENT_TIME);
}
if (scale_option_window)
{
gtk_grab_remove(scale_option_window);
......@@ -813,6 +840,9 @@ static void remmina_connection_holder_toolbar_scale_option(GtkWidget* widget, Re
GtkWidget* eventbox;
GtkWidget* frame;
GtkWidget* scaler;
GdkDisplay* display;
GdkDevice* pointer;
GdkDeviceManager* device_manager;
gint x, y;
gboolean pushin;
......@@ -863,10 +893,12 @@ static void remmina_connection_holder_toolbar_scale_option(GtkWidget* widget, Re
gtk_widget_show(window);
gtk_grab_add(window);
gdk_pointer_grab(gtk_widget_get_window(window), TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, NULL, NULL,
display = gdk_window_get_display(gtk_widget_get_window(window));
device_manager = gdk_display_get_device_manager(display);
pointer = gdk_device_manager_get_client_pointer(device_manager);
gdk_device_grab(pointer, gtk_widget_get_window(window), GDK_OWNERSHIP_NONE, TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, NULL,
GDK_CURRENT_TIME);
gdk_keyboard_grab(gtk_widget_get_window(window), TRUE, GDK_CURRENT_TIME);
scale_option_window = window;
priv->sticky = TRUE;
......@@ -1356,7 +1388,7 @@ static void remmina_connection_holder_showhide_toolbar(RemminaConnectionHolder*
& GDK_WINDOW_STATE_MAXIMIZED) == 0)
{
gtk_window_get_size(GTK_WINDOW(cnnhld->cnnwin), &width, &height);
gtk_widget_size_request(priv->toolbar, &req);
gtk_widget_get_preferred_size(priv->toolbar, &req, NULL);
if (remmina_pref.hide_connection_toolbar)
{
gtk_widget_hide(priv->toolbar);
......@@ -1444,10 +1476,20 @@ static gboolean remmina_connection_window_on_enter(GtkWidget* widget, GdkEventCr
static gboolean remmina_connection_window_on_leave(GtkWidget* widget, GdkEventCrossing* event, RemminaConnectionHolder* cnnhld)
{
GdkDisplay *display;
GdkDeviceManager *manager;
GdkDevice *device = NULL;
if (event->detail == GDK_NOTIFY_VIRTUAL || event->detail == GDK_NOTIFY_NONLINEAR
|| event->detail == GDK_NOTIFY_NONLINEAR_VIRTUAL)
{
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
display = gtk_widget_get_display(widget);
manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(manager);
if (device != NULL)
{
gdk_device_ungrab(device, GDK_CURRENT_TIME);
}
}
return FALSE;
}
......@@ -1531,7 +1573,7 @@ static gboolean remmina_connection_window_on_configure(GtkWidget* widget, GdkEve
if (priv->floating_toolbar)
{
gtk_widget_size_request(priv->floating_toolbar, &req);
gtk_widget_get_preferred_size(priv->floating_toolbar, &req, NULL);
gtk_window_get_position(GTK_WINDOW(priv->floating_toolbar), NULL, &y);
gtk_window_move(GTK_WINDOW(priv->floating_toolbar), event->x + MAX(0, (event->width - req.width) / 2), y);
......@@ -1579,14 +1621,14 @@ static void remmina_connection_holder_create_floating_toolbar(RemminaConnectionH
/* This has to be a popup window to become visible in fullscreen mode */
window = gtk_window_new(GTK_WINDOW_POPUP);
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_container_add(GTK_CONTAINER(window), vbox);
widget = remmina_connection_holder_create_toolbar(cnnhld, mode);
gtk_box_pack_start(GTK_BOX(vbox), widget, FALSE, FALSE, 0);
hbox = gtk_hbox_new(FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
......@@ -1763,7 +1805,7 @@ static GtkWidget* remmina_connection_object_create_tab(RemminaConnectionObject*
GtkWidget* widget;
GtkWidget* button;
hbox = gtk_hbox_new(FALSE, 4);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
gtk_widget_show(hbox);
widget = gtk_image_new_from_icon_name(remmina_file_get_icon_name(cnnobj->remmina_file), GTK_ICON_SIZE_MENU);
......@@ -1920,10 +1962,14 @@ remmina_connection_holder_on_notebook_create_window(GtkNotebook* notebook, GtkWi
RemminaConnectionWindow* dstcnnwin;
RemminaConnectionObject* cnnobj;
gint srcpagenum;
GdkDeviceManager* manager;
GdkDevice* device = NULL;
GdkWindow* window;
srccnnwin = REMMINA_CONNECTION_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(notebook)));
window = gdk_display_get_window_at_pointer(gdk_display_get_default(), &x, &y);
manager = gdk_display_get_device_manager(gdk_display_get_default());
device = gdk_device_manager_get_client_pointer(manager);
window = gdk_device_get_window_at_position(device, &x, &y);
dstcnnwin = REMMINA_CONNECTION_WINDOW(remmina_widget_pool_find_by_window(REMMINA_TYPE_CONNECTION_WINDOW, window));
if (srccnnwin == dstcnnwin)
......@@ -1985,7 +2031,7 @@ static void remmina_connection_holder_create_scrolled(RemminaConnectionHolder* c
cnnhld->cnnwin = REMMINA_CONNECTION_WINDOW(window);
/* Create the vbox container */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_container_add(GTK_CONTAINER(window), vbox);
......
......@@ -405,6 +405,9 @@ remmina_file_dup(RemminaFile *remminafile)
void remmina_file_update_screen_resolution(RemminaFile *remminafile)
{
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *device;
GdkScreen *screen;
gchar *pos;
gchar *resolution;
......@@ -415,7 +418,10 @@ void remmina_file_update_screen_resolution(RemminaFile *remminafile)
resolution = g_strdup(remmina_file_get_string(remminafile, "resolution"));
if (resolution == NULL || strchr(resolution, 'x') == NULL)
{
gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL);
display = gdk_display_get_default();
device_manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(device_manager);
gdk_device_get_position(device, &screen, &x, &y);
monitor = gdk_screen_get_monitor_at_point(screen, x, y);
gdk_screen_get_monitor_geometry(screen, monitor, &rect);
remmina_file_set_int(remminafile, "resolution_width", rect.width);
......
......@@ -195,7 +195,7 @@ static GtkWidget* remmina_file_editor_create_notebook_tab(RemminaFileEditor* gfe
GtkWidget* table;
GtkWidget* widget;
tablabel = gtk_hbox_new(FALSE, 0);
tablabel = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(tablabel);
widget = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
......@@ -206,7 +206,7 @@ static GtkWidget* remmina_file_editor_create_notebook_tab(RemminaFileEditor* gfe
gtk_box_pack_start(GTK_BOX(tablabel), widget, FALSE, FALSE, 0);
gtk_widget_show(widget);
tabbody = gtk_vbox_new(FALSE, 0);
tabbody = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(tabbody);
gtk_notebook_append_page(GTK_NOTEBOOK(gfe->priv->config_container), tabbody, tablabel);
......@@ -354,7 +354,7 @@ static void remmina_file_editor_create_server(RemminaFileEditor* gfe, const Remm
{
gfe->priv->avahi_service_type = (const gchar*) setting->opt1;
hbox = gtk_hbox_new (FALSE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
......@@ -433,7 +433,7 @@ static void remmina_file_editor_create_resolution(RemminaFileEditor* gfe, const
gtk_table_attach_defaults(GTK_TABLE(table), widget, 1, 2, row, row + 1);
gfe->priv->resolution_auto_radio = widget;
hbox = gtk_hbox_new(FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 1, 2, row + 1, row + 2);
......@@ -556,7 +556,7 @@ remmina_file_editor_create_chooser(RemminaFileEditor* gfe, GtkWidget* table, gin
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
gtk_table_attach(GTK_TABLE(table), widget, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
hbox = gtk_hbox_new(FALSE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, col + 1, col + 2, row, row + 1);
......@@ -594,7 +594,7 @@ static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkWidge
{
if (hbox == NULL)
{
hbox = gtk_hbox_new(TRUE, 0);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 2, row, row + 1);
}
......@@ -734,7 +734,7 @@ static void remmina_file_editor_create_ssh_tab(RemminaFileEditor* gfe, RemminaPr
table = remmina_file_editor_create_notebook_tab (gfe, GTK_STOCK_DIALOG_AUTHENTICATION,
"SSH", 9, 3);
hbox = gtk_hbox_new (TRUE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_table_attach_defaults (GTK_TABLE(table), hbox, 0, 3, 0, 1);
row++;
......
......@@ -749,7 +749,7 @@ static void remmina_ftp_client_create_toolbar(RemminaFTPClient *client)
GtkWidget *image;
gint i = 0;
box = gtk_hbutton_box_new();
box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
gtk_widget_show(box);
gtk_button_box_set_layout(GTK_BUTTON_BOX(box), GTK_BUTTONBOX_START);
gtk_box_pack_start(GTK_BOX(client), box, FALSE, TRUE, 0);
......@@ -849,14 +849,14 @@ static void remmina_ftp_client_init(RemminaFTPClient *client)
remmina_ftp_client_create_toolbar(client);
/* The Paned to separate File List and Task List */
vpaned = gtk_vpaned_new();
vpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
gtk_widget_show(vpaned);
gtk_box_pack_start(GTK_BOX(client), vpaned, TRUE, TRUE, 0);
priv->vpaned = vpaned;
/* Remote */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_paned_pack1(GTK_PANED(vpaned), vbox, TRUE, FALSE);
......
......@@ -73,7 +73,7 @@ static void remmina_init_dialog_init(RemminaInitDialog *dialog)
/**** Create the dialog content from here ****/
/* Create top-level hbox */
hbox = gtk_hbox_new(FALSE, 4);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
gtk_widget_show(hbox);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 15);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), hbox, TRUE, TRUE, 0);
......@@ -85,7 +85,7 @@ static void remmina_init_dialog_init(RemminaInitDialog *dialog)
dialog->image = widget;
/* Create vbox for other dialog content */
widget = gtk_vbox_new(FALSE, 4);
widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
gtk_widget_show(widget);
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 4);
dialog->content_vbox = widget;
......@@ -512,7 +512,7 @@ static gint remmina_init_dialog_serverkey_confirm(RemminaInitDialog *dialog, con
gtk_label_set_text(GTK_LABEL(dialog->status_label), (dialog->status ? dialog->status : dialog->title));
/* Create vbox */
vbox = gtk_vbox_new(FALSE, 4);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
gtk_widget_show(vbox);
/* Icon */
......
......@@ -1076,7 +1076,7 @@ static void remmina_main_init(RemminaMain *remminamain)
}
/* Create the main container */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(remminamain), vbox);
gtk_widget_show(vbox);
......
......@@ -265,7 +265,7 @@ static gboolean remmina_pref_dialog_add_pref_plugin(gchar *name, RemminaPlugin *
widget = gtk_label_new(pref_plugin->pref_label);
gtk_widget_show(widget);
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_notebook_append_page(GTK_NOTEBOOK(priv->notebook), vbox, widget);
......@@ -324,7 +324,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_widget_show(tablabel);
/* Options body */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, tablabel);
......@@ -443,7 +443,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(table), widget, 0, 1, 11, 12);
hbox = gtk_hbox_new(FALSE, 2);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 1, 2, 11, 12);
......@@ -465,7 +465,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_widget_show(tablabel);
/* Resolutions body */
vbox = gtk_vbox_new(FALSE, 2);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
gtk_widget_show(vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, tablabel);
......@@ -484,7 +484,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_widget_show(tablabel);
/* Applet body */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, tablabel);
......@@ -535,7 +535,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_widget_show(tablabel);
/* Keyboard body */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, tablabel);
......@@ -581,7 +581,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 3, 4, GTK_FILL, 0, 0, 0);
hbox = gtk_hbox_new(TRUE, 2);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 1, 2, 3, 4);
......@@ -650,7 +650,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_widget_show(tablabel);
/* Terminal body */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, tablabel);
......@@ -715,7 +715,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
gtk_table_attach(GTK_TABLE(table), widget, 0, 1, 4, 5, GTK_FILL, 0, 0, 0);
hbox = gtk_hbox_new(FALSE, 2);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 1, 2, 4, 5);
......@@ -736,7 +736,7 @@ static void remmina_pref_dialog_init(RemminaPrefDialog *dialog)
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
priv->vte_shortcutkey_copy_chooser = widget;
hbox = gtk_hbox_new(FALSE, 2);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
gtk_widget_show(hbox);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 1, 2, 5, 6);
......
......@@ -255,11 +255,21 @@ void remmina_protocol_widget_open_connection(RemminaProtocolWidget* gp, RemminaF
gboolean remmina_protocol_widget_close_connection(RemminaProtocolWidget* gp)
{
GdkDisplay *display;
GdkDeviceManager *manager;
GdkDevice *device = NULL;
if (!GTK_IS_WIDGET(gp) || gp->priv->closed)
return FALSE;
gp->priv->closed = TRUE;
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
display = gtk_widget_get_display(GTK_WIDGET(gp));
manager = gdk_display_get_device_manager(display);
device = gdk_device_manager_get_client_pointer(manager);
if (device != NULL)
{
gdk_device_ungrab(device, GDK_CURRENT_TIME);
}
if (gp->priv->chat_window)
{
......
......@@ -123,14 +123,14 @@ static void remmina_scaler_init(RemminaScaler *scaler)
gtk_table_resize(GTK_TABLE(scaler), 2, 2);
widget = gtk_hscale_new_with_range(MIN_SCALE_VALUE, 1.0, 0.01);
widget = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, MIN_SCALE_VALUE, 1.0, 0.01);
gtk_widget_show(widget);
gtk_widget_set_tooltip_text(widget, _("Horizontal scale"));
gtk_table_attach_defaults(GTK_TABLE(scaler), widget, 1, 2, 0, 1);
g_signal_connect(G_OBJECT(widget), "format-value", G_CALLBACK(remmina_scaler_format_scale_value), NULL);
priv->hscale_widget = widget;
widget = gtk_hscale_new_with_range(MIN_SCALE_VALUE, 1.0, 0.01);
widget = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, MIN_SCALE_VALUE, 1.0, 0.01);
gtk_widget_show(widget);
gtk_widget_set_tooltip_text(widget, _("Vertical scale"));
gtk_table_attach_defaults(GTK_TABLE(scaler), widget, 1, 2, 1, 2);
......
......@@ -30,6 +30,8 @@ static gboolean remmina_scrolled_viewport_motion_timeout(gpointer data)
RemminaScrolledViewport *gsv;
GtkWidget *child;
GdkDisplay *display;
GdkDeviceManager *device_manager;
GdkDevice *pointer;
GdkScreen *screen;
gint x, y, mx, my, w, h;
GtkAdjustment *adj;
......@@ -49,7 +51,9 @@ static gboolean remmina_scrolled_viewport_motion_timeout(gpointer data)
display = gdk_display_get_default();
if (!display)
return FALSE;
gdk_display_get_pointer(display, &screen, &x, &y, NULL);
device_manager = gdk_display_get_device_manager (display);
pointer = gdk_device_manager_get_client_pointer (device_manager);
gdk_device_get_position(pointer, &screen, &x, &y);
w = gdk_screen_get_width(screen);
h = gdk_screen_get_height(screen);
......@@ -58,7 +62,7 @@ static gboolean remmina_scrolled_viewport_motion_timeout(gpointer data)
if (mx != 0)
{
gint step = MAX(10, MIN(remmina_pref.auto_scroll_step, w / 5));
adj = gtk_viewport_get_hadjustment(GTK_VIEWPORT(child));
adj = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(child));
value = gtk_adjustment_get_value(GTK_ADJUSTMENT(adj)) + (gdouble)(mx * step);
value = MAX(0, MIN(value, gtk_adjustment_get_upper(GTK_ADJUSTMENT(adj)) - (gdouble) w + 2.0));
gtk_adjustment_set_value(GTK_ADJUSTMENT(adj), value);
......@@ -66,7 +70,7 @@ static gboolean remmina_scrolled_viewport_motion_timeout(gpointer data)
if (my != 0)
{
gint step = MAX(10, MIN(remmina_pref.auto_scroll_step, h / 5));
adj = gtk_viewport_get_vadjustment(GTK_VIEWPORT(child));
adj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(child));
value = gtk_adjustment_get_value(GTK_ADJUSTMENT(adj)) + (gdouble)(my * step);
value = MAX(0, MIN(value, gtk_adjustment_get_upper(GTK_ADJUSTMENT(adj)) - (gdouble) h + 2.0));
gtk_adjustment_set_value(GTK_ADJUSTMENT(adj), value);
......
......@@ -955,7 +955,7 @@ remmina_sftp_client_confirm_resume (RemminaSFTPClient *client, const gchar *path
NULL);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 4);
hbox = gtk_hbox_new (FALSE, 4);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_widget_show(hbox);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG(dialog))),
hbox, TRUE, TRUE, 4);
......@@ -964,7 +964,7 @@ remmina_sftp_client_confirm_resume (RemminaSFTPClient *client, const gchar *path
gtk_widget_show(widget);
gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 4);
vbox = gtk_vbox_new (FALSE, 4);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
gtk_widget_show(vbox);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 4);
......
......@@ -189,7 +189,7 @@ remmina_plugin_ssh_init (RemminaProtocolWidget *gp)
gpdata = g_new0 (RemminaPluginSshData, 1);
g_object_set_data_full (G_OBJECT(gp), "plugin-data", gpdata, g_free);
hbox = gtk_hbox_new (FALSE, 0);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show(hbox);
gtk_container_add(GTK_CONTAINER (gp), hbox);
g_signal_connect(G_OBJECT(hbox), "focus-in-event", G_CALLBACK(remmina_plugin_ssh_on_focus_in), gp);
......@@ -205,7 +205,7 @@ remmina_plugin_ssh_init (RemminaProtocolWidget *gp)
remmina_plugin_service->protocol_plugin_register_hostkey (gp, vte);
vscrollbar = gtk_vscrollbar_new (vte_terminal_get_adjustment (VTE_TERMINAL (vte)));
vscrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, vte_terminal_get_adjustment (VTE_TERMINAL (vte)));
gtk_widget_show(vscrollbar);
gtk_box_pack_start (GTK_BOX (hbox), vscrollbar, FALSE, TRUE, 0);
}
......
......@@ -206,7 +206,7 @@ static void remmina_string_list_init(RemminaStringList *gsl)
gtk_tree_view_append_column(GTK_TREE_VIEW(gsl->list), column);
/* buttons packed into a vbox */
vbox = gtk_vbox_new(FALSE, 0);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show(vbox);
gtk_table_attach(GTK_TABLE(gsl), vbox, 1, 2, 0, 3, 0, GTK_EXPAND | GTK_FILL, 0, 0);
......
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