diff options
author | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2008-09-29 22:05:32 +0000 |
---|---|---|
committer | Olivier Fourdan <fourdan.olivier@wanadoo.fr> | 2008-09-29 22:05:32 +0000 |
commit | 44a82298e88567d6998f05e1b40bdc3cdb08009a (patch) | |
tree | 93ba8042a50f1c0311d7f01bdcc7197c5636cb3d /helper-dialog | |
parent | 08e4774db58bc90579e05b3eb0bc00517d43271c (diff) | |
download | xfwm4-44a82298e88567d6998f05e1b40bdc3cdb08009a.tar.gz |
Improve dialog
(Old svn revision: 27990)
Diffstat (limited to 'helper-dialog')
-rw-r--r-- | helper-dialog/Makefile.am | 13 | ||||
-rw-r--r-- | helper-dialog/helper-dialog.c | 28 |
2 files changed, 35 insertions, 6 deletions
diff --git a/helper-dialog/Makefile.am b/helper-dialog/Makefile.am index 045a6268f..7f20223fc 100644 --- a/helper-dialog/Makefile.am +++ b/helper-dialog/Makefile.am @@ -2,19 +2,26 @@ INCLUDES = \ $(GTK_CFLAGS) \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBX11_CFLAGS) \ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" helper_dialogdir = $(libexecdir)/xfce4/xfwm4 -helper_dialog_PROGRAMS = \ +helper_dialog_PROGRAMS = \ helper-dialog helper_dialog_SOURCES = \ helper-dialog.c -helper_dialog_CFLAGS = \ +helper_dialog_CFLAGS = \ + $(LIBXFCE4UTIL_CFLAGS) \ + $(LIBX11_CFLAGS) \ $(GTK_CFLAGS) -helper_dialog_LDADD = \ +helper_dialog_LDADD = \ + $(LIBXFCE4UTIL_LIBS) \ + $(LIBX11_LIBS) \ + $(LIBX11_LDFLAGS) \ $(GTK_LIBS) diff --git a/helper-dialog/helper-dialog.c b/helper-dialog/helper-dialog.c index 70e202ff7..767ad9ab1 100644 --- a/helper-dialog/helper-dialog.c +++ b/helper-dialog/helper-dialog.c @@ -19,9 +19,27 @@ #include <config.h> #endif +#include <X11/X.h> +#include <X11/Xlib.h> +#include <glib.h> +#include <gdk/gdk.h> +#include <gdk/gdkx.h> #include <gtk/gtk.h> +#include <libxfce4util/libxfce4util.h> #include <stdlib.h> +static void +on_realize (GtkWidget *dialog, + gpointer data) +{ + Window xid; + + xid = (Window) GPOINTER_TO_INT (data); + gdk_error_trap_push (); + XSetTransientForHint (gdk_display, GDK_WINDOW_XID (dialog->window), xid); + gdk_error_trap_pop (); +} + int main (int argc, char **argv) { @@ -30,6 +48,8 @@ main (int argc, char **argv) gulong xid; gchar *title, *newstr; + xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8"); + gtk_init (&argc, &argv); if (argc < 2) @@ -56,14 +76,16 @@ main (int argc, char **argv) dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_WARNING, GTK_BUTTONS_YES_NO, - "This window might be busy and is not responding.\n" - "Do you want to terminate the application?", + _("This window might be busy and is not responding.\n" + "Do you want to terminate the application?"), NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES); gtk_widget_set (GTK_WIDGET (dialog), "secondary-text", title, NULL); gtk_window_set_title (GTK_WINDOW (dialog), title); - gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE); + g_signal_connect (G_OBJECT (dialog), "realize", + G_CALLBACK (on_realize), (gpointer) GINT_TO_POINTER (xid)); + gtk_widget_realize (dialog); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES) { |