[Xfce4-commits] <thunar:master> Fix outdated Thunar D-Bus API in the trash panel applet.
Jannis Pohlmann
noreply at xfce.org
Wed Nov 10 17:18:01 CET 2010
Updating branch refs/heads/master
to 117e927874dd607685d9bd752a6a4d20de937e49 (commit)
from 42c5b95e3ee2169537659a45a9ec4740c56a1cf6 (commit)
commit 117e927874dd607685d9bd752a6a4d20de937e49
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Wed Nov 10 17:17:18 2010 +0100
Fix outdated Thunar D-Bus API in the trash panel applet.
plugins/thunar-tpa/thunar-tpa-bindings.xml | 33 +++++++++++++++++-----------
plugins/thunar-tpa/thunar-tpa.c | 16 +++++++++++--
2 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/plugins/thunar-tpa/thunar-tpa-bindings.xml b/plugins/thunar-tpa/thunar-tpa-bindings.xml
index 505809f..8d95699 100644
--- a/plugins/thunar-tpa/thunar-tpa-bindings.xml
+++ b/plugins/thunar-tpa/thunar-tpa-bindings.xml
@@ -28,43 +28,49 @@
Managers that support a trash bin.
-->
<interface name="org.xfce.Trash">
- <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="thunar_dbus_service" />
-
<!--
DisplayTrash (display : STRING) : VOID
- display : the screen on which to display the trash folder
- contents or "" to use the default screen of the
- file manager.
+ display : the screen on which to display the trash folder
+ contents or "" to use the default screen of the
+ file manager.
+ startup_id : the DESKTOP_STARTUP_ID environment variable for properly
+ handling startup notification and focus stealing.
Opens a new file manager window showing the trash folder
contents.
-->
<method name="DisplayTrash">
<arg direction="in" name="display" type="s" />
+ <arg direction="in" name="startup_id" type="s" />
</method>
<!--
EmptyTrash (display : STRING) : VOID
- display : the screen on which to display the confirmation of
- the operation and the progress status or "" to use
- the default screen of the file manager.
+ display : the screen on which to display the confirmation of
+ the operation and the progress status or "" to use
+ the default screen of the file manager.
+ startup_id : the DESKTOP_STARTUP_ID environment variable for properly
+ handling startup notification and focus stealing.
Tells the file manager to empty the trash bin.
-->
<method name="EmptyTrash">
<arg direction="in" name="display" type="s" />
+ <arg direction="in" name="startup_id" type="s" />
</method>
<!--
MoveToTrash (uris : ARRAY OF STRING, display : STRING) : VOID
- filenames : an array of file:-URIs or absolute paths for the files
- that should be moved to the trash can.
- display : the screen on which to display the progress dialog
- and possible error messages and confirmation dialogs
- or "" to use the default screen of the file manager.
+ filenames : an array of file:-URIs or absolute paths for the files
+ that should be moved to the trash can.
+ display : the screen on which to display the progress dialog
+ and possible error messages and confirmation dialogs
+ or "" to use the default screen of the file manager.
+ startup_id : the DESKTOP_STARTUP_ID environment variable for properly
+ handling startup notification and focus stealing.
Tells the file manager to move all files specified by the filenames
to the trash bin.
@@ -72,6 +78,7 @@
<method name="MoveToTrash">
<arg direction="in" name="filenames" type="as" />
<arg direction="in" name="display" type="s" />
+ <arg direction="in" name="startup_id" type="s" />
</method>
<!--
diff --git a/plugins/thunar-tpa/thunar-tpa.c b/plugins/thunar-tpa/thunar-tpa.c
index c4f334a..e5d5d7a 100644
--- a/plugins/thunar-tpa/thunar-tpa.c
+++ b/plugins/thunar-tpa/thunar-tpa.c
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2006 Benedikt Meurer <benny at xfce.org>
* Copyright (c) 2010 Nick Schermer <nick at xfce.org>
+ * Copyright (c) 2010 Jannis Pohlmann <jannis at xfce.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -460,6 +461,7 @@ static void
thunar_tpa_display_trash (ThunarTpa *plugin)
{
gchar *display_name;
+ gchar *startup_id;
g_return_if_fail (THUNAR_IS_TPA (plugin));
@@ -472,7 +474,9 @@ thunar_tpa_display_trash (ThunarTpa *plugin)
/* schedule a new call */
display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
- plugin->display_trash_call = org_xfce_Trash_display_trash_async (plugin->proxy, display_name, thunar_tpa_display_trash_reply, plugin);
+ 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);
g_free (display_name);
}
}
@@ -483,6 +487,7 @@ static void
thunar_tpa_empty_trash (ThunarTpa *plugin)
{
gchar *display_name;
+ gchar *startup_id;
g_return_if_fail (THUNAR_IS_TPA (plugin));
@@ -495,7 +500,9 @@ thunar_tpa_empty_trash (ThunarTpa *plugin)
/* schedule a new call */
display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
- plugin->empty_trash_call = org_xfce_Trash_empty_trash_async (plugin->proxy, display_name, thunar_tpa_empty_trash_reply, plugin);
+ 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);
g_free (display_name);
}
}
@@ -507,6 +514,7 @@ thunar_tpa_move_to_trash (ThunarTpa *plugin,
const gchar **uri_list)
{
gchar *display_name;
+ gchar *startup_id;
g_return_val_if_fail (THUNAR_IS_TPA (plugin), FALSE);
g_return_val_if_fail (uri_list != NULL, FALSE);
@@ -521,7 +529,9 @@ thunar_tpa_move_to_trash (ThunarTpa *plugin,
/* schedule a new call */
display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
- plugin->move_to_trash_call = org_xfce_Trash_move_to_trash_async (plugin->proxy, uri_list, display_name, thunar_tpa_move_to_trash_reply, plugin);
+ 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);
g_free (display_name);
return TRUE;
More information about the Xfce4-commits
mailing list