summaryrefslogtreecommitdiff
path: root/src/keybindings.c
diff options
context:
space:
mode:
authorElijah Newren <newren@math.utah.edu>2004-08-26 00:59:12 +0000
committerElijah Newren <newren@src.gnome.org>2004-08-26 00:59:12 +0000
commit044d8999a33f2cc36de36e5ccd03cdadc89b368c (patch)
treeb55c2a65383f4bdcebcb63919837de8d9ba4cce3 /src/keybindings.c
parent07c406cad960590d2d882232745b3b8351a4b63b (diff)
downloadmetacity-044d8999a33f2cc36de36e5ccd03cdadc89b368c.tar.gz
Make dialogs that Metacity shows follow focus-stealing-prevention
2004-08-25 Elijah Newren <newren@math.utah.edu> Make dialogs that Metacity shows follow focus-stealing-prevention conventions. (fixes one issue in #149028; see comments 47-54) * src/delete.c (delete_ping_reply_func, delete_ping_timeout_func): Make callback functions take a timestamp arg, (delete_ping_timeout_func): pass the timestamp to metacity-dialog * src/display.c (meta_display_ping_timeout): add a timestamp to the call to the ping_timeout_func, (meta_display_ping_window, process_pong_message): add a timestamp to the call to the ping_reply_func * src/display.h (MetaWindowPingFunc typedef): add a timestamp to this function typedef * src/keybindings.c (error_on_command): require a timestamp and pass the timestamp on to metacity-dialog, (handle_run_command): pass a timestamp to error_on_command * src/metacity-dialog.c (copy_of_gdk_x11_window_set_user_time): new function (temporary; only for use while using gtk+-2.4), (kill_window_question, warn_about_no_sm_support, error_about_command): make these functions take a timestamp and call copy_of_gdk_x11_window_set_user_time, (main): require the first two args to the program to be "--timestamp <timestamp>" * src/session.c (warn_about_lame_clients_and_finish_inter): pass a timestamp of 0 to metacity-dialog to prevent focus (it's a popup not generated by and kind of user request).
Diffstat (limited to 'src/keybindings.c')
-rw-r--r--src/keybindings.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/keybindings.c b/src/keybindings.c
index 9039e96a..19316a2d 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -2486,12 +2486,14 @@ static void
error_on_command (int command_index,
const char *command,
const char *message,
- int screen_number)
+ int screen_number,
+ Time timestamp)
{
GError *err;
- char *argv[8];
+ char *argv[10];
char *key;
char numbuf[32];
+ char timestampbuf[32];
meta_warning ("Error on command %d \"%s\": %s\n",
command_index, command, message);
@@ -2499,15 +2501,18 @@ error_on_command (int command_index,
key = meta_prefs_get_gconf_key_for_command (command_index);
sprintf (numbuf, "%d", screen_number);
+ sprintf (timestampbuf, "%lu", timestamp);
argv[0] = METACITY_LIBEXECDIR"/metacity-dialog";
argv[1] = "--screen";
argv[2] = numbuf;
- argv[3] = "--command-failed-error";
- argv[4] = key;
- argv[5] = (char*) (command ? command : "");
- argv[6] = (char*) message;
- argv[7] = NULL;
+ argv[3] = "--timestamp";
+ argv[4] = timestampbuf;
+ argv[5] = "--command-failed-error";
+ argv[6] = key;
+ argv[7] = (char*) (command ? command : "");
+ argv[8] = (char*) message;
+ argv[9] = NULL;
err = NULL;
if (!g_spawn_async_with_pipes ("/",
@@ -2596,7 +2601,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);
+ error_on_command (which, NULL, s, screen->number, event->xkey.time);
g_free (s);
return;
@@ -2605,7 +2610,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);
+ error_on_command (which, command, err->message, screen->number, event->xkey.time);
g_error_free (err);
}