2006-10-01 18:30:10 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
|
|
|
/* Mutter window deletion */
|
2002-04-13 00:58:45 -04:00
|
|
|
|
2014-05-02 09:34:02 -04:00
|
|
|
/*
|
2002-06-09 23:00:21 -04:00
|
|
|
* Copyright (C) 2001, 2002 Havoc Pennington
|
2005-10-08 15:38:54 -04:00
|
|
|
* Copyright (C) 2004 Elijah Newren
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2002-04-13 00:58:45 -04: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.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2002-04-13 00:58:45 -04:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2014-01-11 20:42:06 -05:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2002-04-13 00:58:45 -04:00
|
|
|
*/
|
|
|
|
|
2010-06-07 13:09:46 -04:00
|
|
|
#define _XOPEN_SOURCE /* for kill() */
|
2008-02-26 23:39:10 -05:00
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-04-13 00:58:45 -04:00
|
|
|
#include <errno.h>
|
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "compositor/compositor-private.h"
|
|
|
|
#include "core/util-private.h"
|
|
|
|
#include "core/window-private.h"
|
|
|
|
#include "meta/meta-x11-errors.h"
|
|
|
|
#include "meta/workspace.h"
|
|
|
|
|
2002-04-13 00:58:45 -04:00
|
|
|
static void
|
2016-07-11 07:19:25 -04:00
|
|
|
close_dialog_response_cb (MetaCloseDialog *dialog,
|
|
|
|
MetaCloseDialogResponse response,
|
|
|
|
MetaWindow *window)
|
2002-04-13 00:58:45 -04:00
|
|
|
{
|
2016-07-11 07:19:25 -04:00
|
|
|
if (response == META_CLOSE_DIALOG_RESPONSE_FORCE_CLOSE)
|
2014-05-20 14:48:08 -04:00
|
|
|
meta_window_kill (window);
|
2002-04-13 00:58:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-07-11 07:19:25 -04:00
|
|
|
meta_window_ensure_close_dialog (MetaWindow *window)
|
2002-04-13 00:58:45 -04:00
|
|
|
{
|
2016-07-11 07:19:25 -04:00
|
|
|
MetaDisplay *display;
|
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-24 23:39:13 -04:00
|
|
|
|
2016-07-11 07:19:25 -04:00
|
|
|
if (window->close_dialog)
|
|
|
|
return;
|
2002-04-13 00:58:45 -04:00
|
|
|
|
2016-07-11 07:19:25 -04:00
|
|
|
display = window->display;
|
|
|
|
window->close_dialog = meta_compositor_create_close_dialog (display->compositor,
|
|
|
|
window);
|
|
|
|
g_signal_connect (window->close_dialog, "response",
|
|
|
|
G_CALLBACK (close_dialog_response_cb), window);
|
2014-05-20 14:48:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_window_set_alive (MetaWindow *window,
|
|
|
|
gboolean is_alive)
|
|
|
|
{
|
2016-07-11 07:19:25 -04:00
|
|
|
if (is_alive && window->close_dialog)
|
|
|
|
{
|
|
|
|
meta_close_dialog_hide (window->close_dialog);
|
|
|
|
}
|
|
|
|
else if (!is_alive)
|
|
|
|
{
|
|
|
|
meta_window_ensure_close_dialog (window);
|
|
|
|
meta_close_dialog_show (window->close_dialog);
|
2017-07-14 17:34:05 -04:00
|
|
|
|
|
|
|
if (window->display &&
|
|
|
|
window->display->event_route == META_EVENT_ROUTE_NORMAL &&
|
|
|
|
window == window->display->focus_window)
|
|
|
|
meta_close_dialog_focus (window->close_dialog);
|
2016-07-11 07:19:25 -04:00
|
|
|
}
|
2014-05-20 14:48:08 -04:00
|
|
|
}
|
|
|
|
|
2012-12-24 12:15:23 -05:00
|
|
|
void
|
|
|
|
meta_window_check_alive (MetaWindow *window,
|
|
|
|
guint32 timestamp)
|
|
|
|
{
|
2014-05-20 14:48:08 -04:00
|
|
|
meta_display_ping_window (window, timestamp);
|
2012-12-24 12:15:23 -05:00
|
|
|
}
|
|
|
|
|
2002-04-13 00:58:45 -04:00
|
|
|
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 12:32:33 -04:00
|
|
|
guint32 timestamp)
|
2002-04-13 00:58:45 -04:00
|
|
|
{
|
2014-03-20 15:07:44 -04:00
|
|
|
META_WINDOW_GET_CLASS (window)->delete (window, timestamp);
|
2002-04-13 00:58:45 -04:00
|
|
|
|
2012-12-24 12:15:23 -05:00
|
|
|
meta_window_check_alive (window, timestamp);
|
2002-04-13 00:58:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_window_kill (MetaWindow *window)
|
|
|
|
{
|
2020-04-06 07:03:49 -04:00
|
|
|
pid_t pid = meta_window_get_pid (window);
|
2016-10-08 11:32:27 -04:00
|
|
|
|
|
|
|
if (pid > 0)
|
|
|
|
{
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Killing %s with kill()\n",
|
|
|
|
window->desc);
|
|
|
|
|
|
|
|
if (kill (pid, 9) == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
meta_topic (META_DEBUG_WINDOW_OPS,
|
|
|
|
"Failed to signal %s: %s\n",
|
|
|
|
window->desc, strerror (errno));
|
|
|
|
}
|
|
|
|
|
2014-03-20 15:07:44 -04:00
|
|
|
META_WINDOW_GET_CLASS (window)->kill (window);
|
2002-04-13 00:58:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
meta_window_free_delete_dialog (MetaWindow *window)
|
|
|
|
{
|
2018-06-06 07:26:55 -04:00
|
|
|
if (window->close_dialog &&
|
|
|
|
meta_close_dialog_is_visible (window->close_dialog))
|
|
|
|
meta_close_dialog_hide (window->close_dialog);
|
2016-07-11 07:19:25 -04:00
|
|
|
g_clear_object (&window->close_dialog);
|
2002-04-13 00:58:45 -04:00
|
|
|
}
|