Commit aafb30d6 authored by Andre Miranda's avatar Andre Miranda

Handle a few deprecations

parent c57c4cba
......@@ -493,8 +493,9 @@ thunar_tpa_trash_changed (DBusGProxy *proxy,
static void
thunar_tpa_display_trash (ThunarTpa *plugin)
{
gchar *display_name;
gchar *startup_id;
gchar *display_name;
gchar *startup_id;
GdkScreen *screen;
g_return_if_fail (THUNAR_IS_TPA (plugin));
......@@ -506,7 +507,8 @@ thunar_tpa_display_trash (ThunarTpa *plugin)
dbus_g_proxy_cancel_call (plugin->proxy, plugin->display_trash_call);
/* schedule a new call */
display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
startup_id = g_strdup_printf ("_TIME%d", gtk_get_current_event_time ());
plugin->display_trash_call = org_xfce_Trash_display_trash_async (plugin->proxy, display_name, startup_id, thunar_tpa_display_trash_reply, plugin);
g_free (startup_id);
......@@ -519,8 +521,9 @@ thunar_tpa_display_trash (ThunarTpa *plugin)
static void
thunar_tpa_empty_trash (ThunarTpa *plugin)
{
gchar *display_name;
gchar *startup_id;
gchar *display_name;
gchar *startup_id;
GdkScreen *screen;
g_return_if_fail (THUNAR_IS_TPA (plugin));
......@@ -532,7 +535,8 @@ thunar_tpa_empty_trash (ThunarTpa *plugin)
dbus_g_proxy_cancel_call (plugin->proxy, plugin->empty_trash_call);
/* schedule a new call */
display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
startup_id = g_strdup_printf ("_TIME%d", gtk_get_current_event_time ());
plugin->empty_trash_call = org_xfce_Trash_empty_trash_async (plugin->proxy, display_name, startup_id, thunar_tpa_empty_trash_reply, plugin);
g_free (startup_id);
......@@ -546,8 +550,9 @@ static gboolean
thunar_tpa_move_to_trash (ThunarTpa *plugin,
const gchar **uri_list)
{
gchar *display_name;
gchar *startup_id;
gchar *display_name;
gchar *startup_id;
GdkScreen *screen;
g_return_val_if_fail (THUNAR_IS_TPA (plugin), FALSE);
g_return_val_if_fail (uri_list != NULL, FALSE);
......@@ -561,7 +566,8 @@ thunar_tpa_move_to_trash (ThunarTpa *plugin,
dbus_g_proxy_cancel_call (plugin->proxy, plugin->move_to_trash_call);
/* schedule a new call */
display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
startup_id = g_strdup_printf ("_TIME%d", gtk_get_current_event_time ());
plugin->move_to_trash_call = org_xfce_Trash_move_to_trash_async (plugin->proxy, uri_list, display_name, startup_id, thunar_tpa_move_to_trash_reply, plugin);
g_free (startup_id);
......
......@@ -939,7 +939,7 @@ thunar_application_volman_idle (gpointer user_data)
screen = xfce_gdk_screen_get_active (NULL);
if (screen != NULL)
display = gdk_screen_make_display_name (screen);
display = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
/* try to spawn the volman on the active screen */
if (g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, thunar_setup_display_cb, display, &pid, &err))
......
......@@ -399,6 +399,7 @@ thunar_chooser_dialog_response (GtkDialog *widget,
gchar *name;
gchar *s;
GList list;
GdkScreen *screen;
/* no special processing for non-accept responses */
if (G_UNLIKELY (response != GTK_RESPONSE_ACCEPT))
......@@ -487,8 +488,9 @@ thunar_chooser_dialog_response (GtkDialog *widget,
if (G_LIKELY (succeed && dialog->open))
{
/* create launch context */
context = gdk_app_launch_context_new ();
gdk_app_launch_context_set_screen (context, gtk_widget_get_screen (GTK_WIDGET (dialog)));
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
/* create fake file list */
......
......@@ -469,7 +469,7 @@ thunar_emblem_chooser_create_button (ThunarEmblemChooser *chooser,
g_object_unref (G_OBJECT (icon));
done:
gtk_icon_info_free (info);
g_object_unref (info);
return button;
}
......
......@@ -1830,7 +1830,7 @@ thunar_file_launch (ThunarFile *file,
path_list.next = path_list.prev = NULL;
/* create a launch context */
context = gdk_app_launch_context_new ();
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
......
......@@ -506,7 +506,7 @@ thunar_icon_factory_lookup_icon (ThunarIconFactory *factory,
pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
/* cleanup */
gtk_icon_info_free (icon_info);
g_object_unref (icon_info);
}
}
......@@ -848,7 +848,7 @@ thunar_icon_factory_load_file_icon (ThunarIconFactory *factory,
{
/* try to load the pixbuf from the icon info */
icon = gtk_icon_info_load_icon (icon_info, NULL);
gtk_icon_info_free (icon_info);
g_object_unref (icon_info);
}
}
else if (G_IS_LOADABLE_ICON (gicon))
......
......@@ -655,7 +655,7 @@ thunar_launcher_open_paths (GAppInfo *app_info,
screen = (launcher->widget != NULL) ? gtk_widget_get_screen (launcher->widget) : NULL;
/* create launch context */
context = gdk_app_launch_context_new ();
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
gdk_app_launch_context_set_icon (context, g_app_info_get_icon (app_info));
......
......@@ -708,7 +708,7 @@ thunar_preferences_dialog_configure (ThunarPreferencesDialog *dialog)
screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
if (screen != NULL)
display = gdk_screen_make_display_name (screen);
display = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
/* invoke the configuration interface of thunar-volman */
if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, thunar_setup_display_cb, display, NULL, &err))
......
......@@ -173,18 +173,7 @@ thunar_session_client_connect (ThunarSessionClient *session_client,
/* tell GDK about our new session id */
gdk_x11_set_sm_client_id (id);
/* remember the returned client id */
if (g_mem_is_system_malloc ())
{
/* just use the memory */
session_client->id = id;
}
else
{
/* use GLib memory management */
session_client->id = g_strdup (id);
free (id);
}
session_client->id = id;
/* determine the session file path */
spec = g_strconcat ("sessions/Thunar-", session_client->id, NULL);
......
......@@ -245,7 +245,7 @@ thunar_shortcuts_icon_renderer_render (GtkCellRenderer *renderer,
if (G_LIKELY (icon_info != NULL))
{
icon = gtk_icon_info_load_icon (icon_info, NULL);
gtk_icon_info_free (icon_info);
g_object_unref (icon_info);
}
/* render the icon (if any) */
......
......@@ -3392,7 +3392,7 @@ thunar_standard_view_drag_data_received (GtkWidget *view,
screen = gtk_widget_get_screen (GTK_WIDGET (view));
if (screen != NULL)
display = gdk_screen_make_display_name (screen);
display = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
/* try to run exo-desktop-item-edit */
succeed = g_spawn_async (working_directory, argv, NULL,
......
......@@ -2665,7 +2665,7 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data)
if (G_UNLIKELY (offset != 0))
{
/* determine the vertical adjustment */
vadjustment = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (view));
vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (view));
/* determine the new value */
value = CLAMP (gtk_adjustment_get_value (vadjustment) + 2 * offset, gtk_adjustment_get_lower (vadjustment), gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment));
......
......@@ -3456,9 +3456,9 @@ thunar_window_notify_loading (ThunarView *view,
/* setup the proper cursor */
if (thunar_view_get_loading (view))
{
cursor = gdk_cursor_new (GDK_WATCH);
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (view)), GDK_WATCH);
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), cursor);
gdk_cursor_unref (cursor);
g_object_unref (cursor);
}
else
{
......
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