summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2010-09-01 15:15:14 +0100
committerBastien Nocera <hadess@hadess.net>2010-09-01 15:15:14 +0100
commit772e0e6691400f664b6bbaca42ceac93b5435953 (patch)
treece465c97b1b337b2782201ec0a3a3bffdad87835 /src
parentf03f355a8442d44bbda50ef75fdb370764a73be4 (diff)
downloadnautilus-sendto-772e0e6691400f664b6bbaca42ceac93b5435953.tar.gz
Add support for parenting the dialogue
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-sendto-command.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nautilus-sendto-command.c b/src/nautilus-sendto-command.c
index 1d7ba72..0fefc52 100644
--- a/src/nautilus-sendto-command.c
+++ b/src/nautilus-sendto-command.c
@@ -28,6 +28,9 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
+#ifdef GDK_WINDOWING_X11
+#include <gdk/gdkx.h>
+#endif
#include "nautilus-sendto-plugin.h"
#include "nautilus-sendto-mimetype.h"
@@ -48,6 +51,7 @@ enum {
/* Options */
static char **filenames = NULL;
static gboolean run_from_build_dir = FALSE;
+static gint64 xid = 0;
static PeasEngine *engine;
static PeasExtensionSet *exten_set;
@@ -72,6 +76,7 @@ typedef struct {
static const GOptionEntry entries[] = {
{ "run-from-build-dir", 'b', 0, G_OPTION_ARG_NONE, &run_from_build_dir, N_("Run from build directory"), NULL },
+ { "xid", 'x', 0, G_OPTION_ARG_INT64, &xid, N_("Use XID as parent to the send dialogue"), NULL },
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, N_("Files to send"), "[FILES...]" },
{ NULL }
};
@@ -432,6 +437,16 @@ nautilus_sendto_create_ui (NautilusSendto *nst)
nst->cancel_button = GTK_WIDGET (gtk_builder_get_object (app, "cancel_button"));
nst->send_button = GTK_WIDGET (gtk_builder_get_object (app, "send_button"));
+#ifdef GDK_WINDOWING_X11
+ if (xid != 0) {
+ GdkWindow *window;
+ gtk_widget_realize (nst->dialog);
+ window = gdk_window_foreign_new (xid);
+ gdk_window_set_transient_for (gtk_widget_get_window (nst->dialog),
+ window);
+ }
+#endif
+
nst->last_used = g_settings_get_string (nst->settings,
NAUTILUS_SENDTO_LAST_MEDIUM);