From 9f39a18fc589274548eba39830bbe32b56445fd7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 17 Mar 2011 09:54:47 -0400 Subject: [PATCH] Update meta_show_dialog for gtk's removal of --screen gtk3 no longer has the --screen command-line argument, which mutter was passing to zenity. Use --display (with an explicitly-specified screen number) instead. https://bugzilla.gnome.org/show_bug.cgi?id=643683 --- src/core/delete.c | 4 ++-- src/core/keybindings.c | 14 +++++++------- src/core/session.c | 2 +- src/core/util.c | 8 +++----- src/meta/util.h | 4 ++-- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/core/delete.c b/src/core/delete.c index 0ae1676da..43bd503c7 100644 --- a/src/core/delete.c +++ b/src/core/delete.c @@ -103,8 +103,8 @@ delete_ping_timeout_func (MetaDisplay *display, dialog_pid = meta_show_dialog ("--question", - window_content, 0, - window->screen->number, + window_content, NULL, + window->screen->screen_name, _("_Wait"), _("_Force Quit"), window->xwindow, NULL, NULL); diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 69ca42942..79f1e42db 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2444,7 +2444,7 @@ static void error_on_command (int command_index, const char *command, const char *message, - int screen_number, + MetaScreen *screen, guint32 timestamp) { if (command_index < 0) @@ -2473,7 +2473,7 @@ error_on_command (int command_index, meta_show_dialog ("--error", text, NULL, - screen_number, + screen->screen_name, NULL, NULL, 0, NULL, NULL); @@ -2485,7 +2485,7 @@ error_on_command (int command_index, meta_show_dialog ("--error", message, NULL, - screen_number, + screen->screen_name, NULL, NULL, 0, NULL, NULL); } @@ -2557,7 +2557,7 @@ handle_run_command (MetaDisplay *display, s = g_strdup_printf (_("No command %d has been defined.\n"), which + 1); - error_on_command (which, NULL, s, screen->number, event->xkey.time); + error_on_command (which, NULL, s, screen, event->xkey.time); g_free (s); return; @@ -2566,7 +2566,7 @@ handle_run_command (MetaDisplay *display, err = NULL; if (!meta_spawn_command_line_async_on_screen (command, screen, &err)) { - error_on_command (which, command, err->message, screen->number, event->xkey.time); + error_on_command (which, command, err->message, screen, event->xkey.time); g_error_free (err); } @@ -3568,7 +3568,7 @@ handle_run_terminal (MetaDisplay *display, "keybinding press\n"); s = g_strdup_printf (_("No terminal command has been defined.\n")); - error_on_command (-1, NULL, s, screen->number, event->xkey.time); + error_on_command (-1, NULL, s, screen, event->xkey.time); g_free (s); return; @@ -3577,7 +3577,7 @@ handle_run_terminal (MetaDisplay *display, err = NULL; if (!meta_spawn_command_line_async_on_screen (command, screen, &err)) { - error_on_command (-1, command, err->message, screen->number, + error_on_command (-1, command, err->message, screen, event->xkey.time); g_error_free (err); diff --git a/src/core/session.c b/src/core/session.c index c11bce9d6..65542f39d 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -1804,7 +1804,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown) "and will have to be restarted manually next time " "you log in."), "240", - meta_screen_get_screen_number (meta_get_display()->active_screen), + meta_get_display()->active_screen->screen_name, NULL, NULL, None, columns, diff --git a/src/core/util.c b/src/core/util.c index 2ea5eb5a9..3144b9bd6 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -588,7 +588,7 @@ GPid meta_show_dialog (const char *type, const char *message, const char *timeout, - const gint screen_number, + const char *display, const char *ok_text, const char *cancel_text, const int transient_for, @@ -596,7 +596,6 @@ meta_show_dialog (const char *type, GSList *entries) { GError *error = NULL; - char *screen_number_text = g_strdup_printf("%d", screen_number); GSList *tmp; int i=0; GPid child_pid; @@ -607,8 +606,8 @@ meta_show_dialog (const char *type, argvl[i++] = "zenity"; argvl[i++] = type; - argvl[i++] = "--screen"; - argvl[i++] = screen_number_text; + argvl[i++] = "--display"; + argvl[i++] = display; argvl[i++] = "--class"; argvl[i++] = "mutter-dialog"; argvl[i++] = "--title"; @@ -673,7 +672,6 @@ meta_show_dialog (const char *type, unsetenv ("WINDOWID"); g_free (argvl); - g_free (screen_number_text); if (error) { diff --git a/src/meta/util.h b/src/meta/util.h index 815ced517..096cdb3a9 100644 --- a/src/meta/util.h +++ b/src/meta/util.h @@ -105,9 +105,9 @@ char* meta_g_utf8_strndup (const gchar *src, gsize n); void meta_free_gslist_and_elements (GSList *list_to_deep_free); GPid meta_show_dialog (const char *type, - const char *title, const char *message, - gint timeout, + const char *timeout, + const char *display, const char *ok_text, const char *cancel_text, const int transient_for,