diff options
-rw-r--r-- | capplets/mouse/gnome-mouse-properties.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/capplets/mouse/gnome-mouse-properties.c b/capplets/mouse/gnome-mouse-properties.c index fe88434f1..c5a05e9eb 100644 --- a/capplets/mouse/gnome-mouse-properties.c +++ b/capplets/mouse/gnome-mouse-properties.c @@ -580,6 +580,7 @@ main (int argc, char **argv) GtkBuilder *dialog; GtkWidget *dialog_win, *w; gchar *start_page = NULL; + guint32 socket_id; GOptionContext *context; GOptionEntry cap_options[] = { @@ -589,6 +590,14 @@ main (int argc, char **argv) /* TRANSLATORS: don't translate the terms in brackets */ N_("Specify the name of the page to show (general|accessibility)"), N_("page") }, + { "socket", + 's', + G_OPTION_FLAG_IN_MAIN, + G_OPTION_ARG_INT, + &socket_id, + /* TRANSLATORS: don't translate the terms in brackets */ + N_("ID of the socket to embed in"), + N_("socket") }, {NULL} }; @@ -610,9 +619,24 @@ main (int argc, char **argv) setup_dialog (dialog, NULL); setup_accessibility (dialog, client); - dialog_win = WID ("mouse_properties_dialog"); - g_signal_connect (dialog_win, "response", - G_CALLBACK (dialog_response_cb), NULL); + if (socket_id) { + GtkWidget *content, *plug; + + /* re-parent contents */ + content = WID ("prefs_widget"); + + plug = gtk_plug_new (socket_id); + gtk_widget_reparent (content, plug); + g_signal_connect (plug, "destroy", G_CALLBACK (gtk_main_quit), NULL); + + gtk_widget_show_all (plug); + dialog_win = plug; + } + else { + dialog_win = WID ("mouse_properties_dialog"); + g_signal_connect (dialog_win, "response", + G_CALLBACK (dialog_response_cb), NULL); + } if (start_page != NULL) { gchar *page_name; |