2006-10-01 22:30:10 +00:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
/* Metacity window deletion */
|
|
|
|
|
|
|
|
/*
|
2002-06-10 03:00:21 +00:00
|
|
|
* Copyright (C) 2001, 2002 Havoc Pennington
|
2005-10-08 19:38:54 +00:00
|
|
|
* Copyright (C) 2004 Elijah Newren
|
2002-04-13 04:58:45 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-02-27 04:39:10 +00:00
|
|
|
#define _GNU_SOURCE
|
|
|
|
#define _SVID_SOURCE /* for gethostname() */
|
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
#include <config.h>
|
|
|
|
#include "util.h"
|
2008-05-19 00:00:09 +00:00
|
|
|
#include "window-private.h"
|
2002-04-13 04:58:45 +00:00
|
|
|
#include "errors.h"
|
2003-08-15 22:09:55 +00:00
|
|
|
#include "workspace.h"
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2003-09-29 16:55:26 +00:00
|
|
|
#include <stdio.h>
|
2002-04-13 04:58:45 +00:00
|
|
|
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
static void meta_window_present_delete_dialog (MetaWindow *window,
|
|
|
|
guint32 timestamp);
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
delete_ping_reply_func (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 16:32:33 +00:00
|
|
|
guint32 timestamp,
|
2002-04-13 04:58:45 +00:00
|
|
|
void *user_data)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Got reply to delete ping for %s\n",
|
2002-12-08 19:17:17 +00:00
|
|
|
((MetaWindow*)user_data)->desc);
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
/* we do nothing */
|
|
|
|
}
|
|
|
|
|
|
|
|
static Window
|
|
|
|
window_from_string (const char *str)
|
|
|
|
{
|
|
|
|
char *end;
|
|
|
|
unsigned long l;
|
|
|
|
|
|
|
|
end = NULL;
|
|
|
|
|
|
|
|
l = strtoul (str, &end, 16);
|
|
|
|
|
|
|
|
if (end == NULL || end == str)
|
|
|
|
{
|
|
|
|
meta_warning (_("Could not parse \"%s\" as an integer"),
|
|
|
|
str);
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*end != '\0')
|
|
|
|
{
|
|
|
|
meta_warning (_("Did not understand trailing characters \"%s\" in string \"%s\""),
|
|
|
|
end, str);
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
pid_from_string (const char *str)
|
|
|
|
{
|
|
|
|
char *end;
|
|
|
|
long l;
|
|
|
|
|
|
|
|
end = NULL;
|
|
|
|
|
|
|
|
l = strtol (str, &end, 10);
|
|
|
|
|
|
|
|
if (end == NULL || end == str)
|
|
|
|
{
|
|
|
|
meta_warning (_("Could not parse \"%s\" as an integer"),
|
|
|
|
str);
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*end != '\0')
|
|
|
|
{
|
|
|
|
meta_warning (_("Did not understand trailing characters \"%s\" in string \"%s\""),
|
|
|
|
end, str);
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
|
|
|
return l;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
parse_dialog_output (const char *str,
|
|
|
|
int *pid_out,
|
|
|
|
Window *win_out)
|
|
|
|
{
|
|
|
|
char **split;
|
|
|
|
|
|
|
|
split = g_strsplit (str, "\n", 2);
|
|
|
|
if (split && split[0] && split[1])
|
|
|
|
{
|
|
|
|
g_strchomp (split[0]);
|
|
|
|
g_strchomp (split[1]);
|
|
|
|
|
|
|
|
*pid_out = pid_from_string (split[0]);
|
|
|
|
*win_out = window_from_string (split[1]);
|
|
|
|
|
|
|
|
g_strfreev (split);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_strfreev (split);
|
|
|
|
meta_warning (_("Failed to parse message \"%s\" from dialog process\n"),
|
|
|
|
str);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
search_and_destroy_window (int pid,
|
|
|
|
Window xwindow)
|
|
|
|
{
|
|
|
|
/* Find the window with the given dialog PID,
|
|
|
|
* double check that it matches "xwindow", then
|
|
|
|
* kill the window.
|
|
|
|
*/
|
|
|
|
GSList *tmp;
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
gboolean found = FALSE;
|
|
|
|
GSList *windows;
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
if (xwindow == None)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Window to destroy is None, doing nothing\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
windows = meta_display_list_windows (meta_get_display ());
|
|
|
|
tmp = windows;
|
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
MetaWindow *w = tmp->data;
|
2002-04-13 04:58:45 +00:00
|
|
|
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
if (w->dialog_pid == pid)
|
2002-04-13 04:58:45 +00:00
|
|
|
{
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
if (w->xwindow != xwindow)
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Dialog pid matches but not xwindow (0x%lx vs. 0x%lx)\n",
|
|
|
|
w->xwindow, xwindow);
|
|
|
|
else
|
2002-04-13 04:58:45 +00:00
|
|
|
{
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
meta_window_kill (w);
|
|
|
|
found = TRUE;
|
2002-04-13 04:58:45 +00:00
|
|
|
}
|
|
|
|
}
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
g_slist_free (windows);
|
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
if (!found)
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Did not find a window with dialog pid %d xwindow 0x%lx\n",
|
|
|
|
pid, xwindow);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
release_window_with_fd (int fd)
|
|
|
|
{
|
|
|
|
/* Find the window with the given dialog PID,
|
|
|
|
* double check that it matches "xwindow", then
|
|
|
|
* kill the window.
|
|
|
|
*/
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
gboolean found = FALSE;
|
2002-04-13 04:58:45 +00:00
|
|
|
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
GSList *windows = meta_display_list_windows (meta_get_display ());
|
|
|
|
GSList *tmp = windows;
|
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
MetaWindow *w = tmp->data;
|
2002-04-13 04:58:45 +00:00
|
|
|
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
if (w->dialog_pid >= 0 &&
|
|
|
|
w->dialog_pipe == fd)
|
2002-04-13 04:58:45 +00:00
|
|
|
{
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Removing dialog with fd %d pid %d from window %s\n",
|
|
|
|
fd, w->dialog_pid, w->desc);
|
|
|
|
meta_window_free_delete_dialog (w);
|
|
|
|
found = TRUE;
|
2002-04-13 04:58:45 +00:00
|
|
|
}
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
MetaDisplay becomes a singleton. The static variable which holds this
2008-03-25 Thomas Thurman <tthurman@gnome.org>
* src/core/display.c (meta_display_queue_retheme_all_windows,
meta_set_syncing, meta_display_set_cursor_theme, disable_compositor,
meta_display_for_x_display, meta_display_open, meta_display_close,
meta_display_ungrab): MetaDisplay becomes a singleton. The static
variable which holds this singleton is renamed "the_display" so as
not to mask the this parameter in the methods.
* src/core/main.c (main):
* src/core/session.c (warn_about_lame_clients_and_finish_inte,
save_state, io_from_warning_dialog):
* src/core/core.c (meta_core_increment_event_serial):
* src/core/delete.c (release_window_with_fd, search_and_destroy_window):
sympathy changes for this, and consequent simplification.
Closes #499301.
svn path=/trunk/; revision=3663
2008-03-25 03:39:13 +00:00
|
|
|
g_slist_free (windows);
|
|
|
|
|
2002-04-13 04:58:45 +00:00
|
|
|
if (!found)
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Did not find a window with a dialog pipe %d\n",
|
|
|
|
fd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
io_from_ping_dialog (GIOChannel *channel,
|
|
|
|
GIOCondition condition,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"IO handler from ping dialog, condition = %x\n",
|
|
|
|
condition);
|
|
|
|
|
|
|
|
if (condition & G_IO_IN)
|
|
|
|
{
|
|
|
|
char *str;
|
2008-05-03 17:12:15 +00:00
|
|
|
gsize len;
|
2002-04-13 04:58:45 +00:00
|
|
|
GError *err;
|
|
|
|
|
|
|
|
/* Go ahead and block for all data from child */
|
|
|
|
str = NULL;
|
|
|
|
len = 0;
|
|
|
|
err = NULL;
|
|
|
|
g_io_channel_read_to_end (channel,
|
|
|
|
&str, &len,
|
|
|
|
&err);
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
meta_warning (_("Error reading from dialog display process: %s\n"),
|
|
|
|
err->message);
|
|
|
|
g_error_free (err);
|
|
|
|
}
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_PING,
|
2008-05-03 17:12:15 +00:00
|
|
|
"Read %" G_GSIZE_FORMAT " bytes strlen %d \"%s\" from child\n",
|
2007-12-19 21:38:15 +00:00
|
|
|
len, str ? (int) strlen (str) : 0, str ? str : "NULL");
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
if (len > 0)
|
|
|
|
{
|
|
|
|
/* We're supposed to kill the given window */
|
|
|
|
int pid;
|
|
|
|
Window xwindow;
|
|
|
|
|
|
|
|
if (parse_dialog_output (str, &pid, &xwindow))
|
|
|
|
search_and_destroy_window (pid, xwindow);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (str);
|
|
|
|
}
|
|
|
|
|
|
|
|
release_window_with_fd (g_io_channel_unix_get_fd (channel));
|
|
|
|
|
|
|
|
/* Remove the callback */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
delete_ping_timeout_func (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 16:32:33 +00:00
|
|
|
guint32 timestamp,
|
2002-04-13 04:58:45 +00:00
|
|
|
void *user_data)
|
|
|
|
{
|
|
|
|
MetaWindow *window = user_data;
|
|
|
|
GError *err;
|
|
|
|
int child_pid;
|
|
|
|
int outpipe;
|
2004-08-26 00:59:12 +00:00
|
|
|
char *argv[9];
|
2003-09-29 16:55:26 +00:00
|
|
|
char numbuf[32];
|
2004-08-26 00:59:12 +00:00
|
|
|
char timestampbuf[32];
|
2002-04-13 04:58:45 +00:00
|
|
|
char *window_id_str;
|
2007-08-03 07:43:03 +00:00
|
|
|
char *window_title;
|
2002-04-13 04:58:45 +00:00
|
|
|
GIOChannel *channel;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Got delete ping timeout for %s\n",
|
|
|
|
window->desc);
|
|
|
|
|
|
|
|
if (window->dialog_pid >= 0)
|
|
|
|
{
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
meta_window_present_delete_dialog (window, timestamp);
|
2002-04-13 04:58:45 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
window_id_str = g_strdup_printf ("0x%lx", window->xwindow);
|
2007-08-03 07:43:03 +00:00
|
|
|
window_title = g_locale_from_utf8 (window->title, -1, NULL, NULL, NULL);
|
2003-09-29 16:55:26 +00:00
|
|
|
|
|
|
|
sprintf (numbuf, "%d", window->screen->number);
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 16:32:33 +00:00
|
|
|
sprintf (timestampbuf, "%u", timestamp);
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
argv[0] = METACITY_LIBEXECDIR"/metacity-dialog";
|
2003-09-29 16:55:26 +00:00
|
|
|
argv[1] = "--screen";
|
|
|
|
argv[2] = numbuf;
|
2004-08-26 00:59:12 +00:00
|
|
|
argv[3] = "--timestamp";
|
|
|
|
argv[4] = timestampbuf;
|
|
|
|
argv[5] = "--kill-window-question";
|
2007-08-03 07:43:03 +00:00
|
|
|
argv[6] = window_title;
|
2004-08-26 00:59:12 +00:00
|
|
|
argv[7] = window_id_str;
|
|
|
|
argv[8] = NULL;
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
err = NULL;
|
|
|
|
if (!g_spawn_async_with_pipes ("/",
|
|
|
|
argv,
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
NULL, NULL,
|
|
|
|
&child_pid,
|
|
|
|
NULL,
|
|
|
|
&outpipe,
|
|
|
|
NULL,
|
|
|
|
&err))
|
|
|
|
{
|
|
|
|
meta_warning (_("Error launching metacity-dialog to ask about killing an application: %s\n"),
|
|
|
|
err->message);
|
|
|
|
g_error_free (err);
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
window->dialog_pid = child_pid;
|
|
|
|
window->dialog_pipe = outpipe;
|
|
|
|
|
|
|
|
channel = g_io_channel_unix_new (window->dialog_pipe);
|
|
|
|
g_io_add_watch_full (channel, G_PRIORITY_DEFAULT,
|
2002-06-10 03:00:21 +00:00
|
|
|
G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
|
2002-04-13 04:58:45 +00:00
|
|
|
io_from_ping_dialog,
|
|
|
|
NULL, NULL);
|
|
|
|
g_io_channel_unref (channel);
|
|
|
|
|
|
|
|
out:
|
2007-08-03 07:43:03 +00:00
|
|
|
g_free (window_title);
|
2002-04-13 04:58:45 +00:00
|
|
|
g_free (window_id_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_window_delete (MetaWindow *window,
|
Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13 Elijah Newren <newren gmail com>
* src/common.h (MetaWindowMenuFunc):
* src/core.[ch] (meta_core_user_lower_and_unfocus,
meta_core_user_focus, meta_core_show_window_menu,
meta_core_begin_grab_op, meta_core_end_grab_op):
* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
meta_window_delete):
* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
sanity_check_timestamps, meta_display_open, event_callback,
meta_spew_event, meta_display_set_grab_op_cursor,
meta_display_begin_grab_op, meta_display_end_grab_op,
meta_display_ping_timeout, meta_display_ping_window,
process_pong_message, timestamp_too_old,
meta_display_set_input_focus_window):
* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
meta_screen_grab_all_keys, meta_window_grab_all_keys,
meta_window_ungrab_all_keys, error_on_generic_command,
error_on_command, error_on_terminal_command):
* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
error_about_command, main):
* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
meta_screen_show_desktop, meta_screen_apply_startup_properties):
* src/session.c (warn_about_lame_clients_and_finish_interact):
* src/window.[ch] (struct _MetaWindow,
intervening_user_event_occurred, window_activate,
meta_window_delete, meta_window_focus,
meta_window_send_icccm_message, meta_window_client_message,
menu_callback, meta_window_show_menu, struct EventScannerData,
check_use_this_motion_notify, meta_window_begin_grab_op,
meta_window_set_user_time):
* src/workspace.[ch] (focus_ancestor_or_mru_window,
meta_workspace_activate_with_focus, meta_workspace_activate,
meta_workspace_focus_default_window,
focus_ancestor_or_mru_window):
Fix issues on 64-bit machines with timestamps by using guint32
(like gtk+ does) instead of Time. #348305
2006-09-13 16:32:33 +00:00
|
|
|
guint32 timestamp)
|
2002-04-13 04:58:45 +00:00
|
|
|
{
|
|
|
|
meta_error_trap_push (window->display);
|
|
|
|
if (window->delete_window)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Deleting %s with delete_window request\n",
|
|
|
|
window->desc);
|
|
|
|
meta_window_send_icccm_message (window,
|
2008-05-02 18:49:01 +00:00
|
|
|
window->display->atom_WM_DELETE_WINDOW,
|
2002-04-13 04:58:45 +00:00
|
|
|
timestamp);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Deleting %s with explicit kill\n",
|
|
|
|
window->desc);
|
|
|
|
XKillClient (window->display->xdisplay, window->xwindow);
|
|
|
|
}
|
2002-10-21 21:44:35 +00:00
|
|
|
meta_error_trap_pop (window->display, FALSE);
|
2002-04-13 04:58:45 +00:00
|
|
|
|
|
|
|
meta_display_ping_window (window->display,
|
|
|
|
window,
|
|
|
|
timestamp,
|
|
|
|
delete_ping_reply_func,
|
|
|
|
delete_ping_timeout_func,
|
|
|
|
window);
|
|
|
|
|
|
|
|
if (window->has_focus)
|
|
|
|
{
|
2003-09-29 17:35:11 +00:00
|
|
|
/* FIXME Clean this up someday
|
|
|
|
* http://bugzilla.gnome.org/show_bug.cgi?id=108706
|
|
|
|
*/
|
|
|
|
#if 0
|
2002-04-13 04:58:45 +00:00
|
|
|
/* This is unfortunately going to result in weirdness
|
|
|
|
* if the window doesn't respond to the delete event.
|
|
|
|
* I don't know how to avoid that though.
|
|
|
|
*/
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
2004-06-24 20:02:46 +00:00
|
|
|
"Focusing default window because focus window %s was deleted/killed\n",
|
2002-04-13 04:58:45 +00:00
|
|
|
window->desc);
|
2004-06-24 20:02:46 +00:00
|
|
|
meta_workspace_focus_default_window (window->screen->active_workspace,
|
|
|
|
window);
|
2003-09-29 17:35:11 +00:00
|
|
|
#else
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Not unfocusing %s on delete/kill\n",
|
|
|
|
window->desc);
|
|
|
|
#endif
|
2002-04-13 04:58:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_FOCUS,
|
|
|
|
"Window %s was deleted/killed but didn't have focus\n",
|
|
|
|
window->desc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_window_kill (MetaWindow *window)
|
|
|
|
{
|
|
|
|
char buf[257];
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Killing %s brutally\n",
|
|
|
|
window->desc);
|
|
|
|
|
|
|
|
if (window->wm_client_machine != NULL &&
|
|
|
|
window->net_wm_pid > 0)
|
|
|
|
{
|
|
|
|
if (gethostname (buf, sizeof(buf)-1) == 0)
|
|
|
|
{
|
|
|
|
if (strcmp (buf, window->wm_client_machine) == 0)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Killing %s with kill()\n",
|
|
|
|
window->desc);
|
|
|
|
|
|
|
|
if (kill (window->net_wm_pid, 9) < 0)
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Failed to signal %s: %s\n",
|
|
|
|
window->desc, strerror (errno));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
meta_warning (_("Failed to get hostname: %s\n"),
|
|
|
|
strerror (errno));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Disconnecting %s with XKillClient()\n",
|
|
|
|
window->desc);
|
|
|
|
meta_error_trap_push (window->display);
|
|
|
|
XKillClient (window->display->xdisplay, window->xwindow);
|
2002-10-21 21:44:35 +00:00
|
|
|
meta_error_trap_pop (window->display, FALSE);
|
2002-04-13 04:58:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_window_free_delete_dialog (MetaWindow *window)
|
|
|
|
{
|
|
|
|
if (window->dialog_pid >= 0)
|
|
|
|
{
|
|
|
|
kill (window->dialog_pid, 9);
|
|
|
|
close (window->dialog_pipe);
|
|
|
|
window->dialog_pid = -1;
|
|
|
|
window->dialog_pipe = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
meta_window_present_delete_dialog (MetaWindow *window, guint32 timestamp)
|
2002-04-13 04:58:45 +00:00
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_PING,
|
|
|
|
"Presenting existing ping dialog for %s\n",
|
|
|
|
window->desc);
|
|
|
|
|
|
|
|
if (window->dialog_pid >= 0)
|
|
|
|
{
|
|
|
|
GSList *windows;
|
|
|
|
GSList *tmp;
|
|
|
|
|
|
|
|
/* Activate transient for window that belongs to
|
|
|
|
* metacity-dialog
|
|
|
|
*/
|
|
|
|
|
|
|
|
windows = meta_display_list_windows (window->display);
|
|
|
|
tmp = windows;
|
|
|
|
while (tmp != NULL)
|
|
|
|
{
|
|
|
|
MetaWindow *w = tmp->data;
|
|
|
|
|
|
|
|
if (w->xtransient_for == window->xwindow &&
|
|
|
|
w->res_class &&
|
|
|
|
g_strcasecmp (w->res_class, "metacity-dialog") == 0)
|
|
|
|
{
|
Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18 Elijah Newren <newren gmail com>
Partial audit to fix timestamp usage. One step towards fixing
#355180; see important comments in that bug.
* src/core.[ch] (meta_core_unshade, meta_core_shade):
* src/delete.c (meta_window_present_delete_dialog,
delete_ping_timeout_func):
* src/display.[ch] (meta_display_open, meta_display_close,
event_callback, meta_display_begin_grab_op,
process_selection_clear, meta_display_unmanage_screen,
meta_display_unmanage_windows_for_screen):
* src/frames.c (meta_frames_button_press_event):
* src/keybindings.c (handle_toggle_shade):
* src/main.c (main):
* src/screen.[ch] (update_num_workspaces, meta_screen_new,
meta_screen_free, prefs_changed_callback):
* src/window.[ch] (meta_window_free, finish_minimize,
implement_showing, meta_window_show, meta_window_maximize,
meta_window_make_fullscreen_internal,
meta_window_unmake_fullscreen, meta_window_shade,
meta_window_unshade, window_activate, send_sync_request,
meta_window_client_message, menu_callback,
meta_window_update_keyboard_resize):
Remove usage of CurrentTime, meta_display_get_current_time() and
meta_display_get_current_time_roundtrip() where possible, or
document why it isn't possible, or at very least add a FIXME with
some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
|
|
|
meta_window_activate (w, timestamp);
|
2002-04-13 04:58:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_slist_free (windows);
|
|
|
|
}
|
|
|
|
}
|