Commit 3bf80a96 authored by Marco Trevisan's avatar Marco Trevisan Committed by Marco Trevisan

window-x11: Move delete_window to MetaWindowX11Private

https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
parent 6c3b0cfc
......@@ -327,7 +327,6 @@ struct _MetaWindow
guint icon_geometry_set : 1;
/* These are the flags from WM_PROTOCOLS */
guint delete_window : 1;
guint can_ping : 1;
/* Globally active / No input */
guint input : 1;
......
......@@ -1079,7 +1079,6 @@ _meta_window_shared_new (MetaDisplay *display,
window->initial_timestamp_set = FALSE;
window->net_wm_user_time_set = FALSE;
window->user_time_window = None;
window->delete_window = FALSE;
window->can_ping = FALSE;
window->input = TRUE;
window->calc_placement = FALSE;
......
......@@ -1531,9 +1531,9 @@ reload_wm_protocols (MetaWindow *window,
{
int i;
window->delete_window = FALSE;
window->can_ping = FALSE;
meta_window_x11_set_wm_take_focus (window, FALSE);
meta_window_x11_set_wm_delete_window (window, FALSE);
if (value->type == META_PROP_VALUE_INVALID)
return;
......@@ -1546,7 +1546,7 @@ reload_wm_protocols (MetaWindow *window,
meta_window_x11_set_wm_take_focus (window, TRUE);
else if (value->v.atom_list.atoms[i] ==
window->display->x11_display->atom_WM_DELETE_WINDOW)
window->delete_window = TRUE;
meta_window_x11_set_wm_delete_window (window, TRUE);
else if (value->v.atom_list.atoms[i] ==
window->display->x11_display->atom__NET_WM_PING)
window->can_ping = TRUE;
......
......@@ -48,6 +48,7 @@ struct _MetaWindowX11Private
guint wm_state_skip_taskbar : 1;
guint wm_state_skip_pager : 1;
guint wm_take_focus : 1;
guint wm_delete_window : 1;
/* Weird "_NET_WM_STATE_MODAL" flag */
guint wm_state_modal : 1;
......
......@@ -691,14 +691,28 @@ meta_window_x11_ping (MetaWindow *window,
send_icccm_message (window, display->x11_display->atom__NET_WM_PING, serial);
}
void
meta_window_x11_set_wm_delete_window (MetaWindow *window,
gboolean delete_window)
{
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
MetaWindowX11Private *priv =
meta_window_x11_get_instance_private (window_x11);
priv->wm_delete_window = delete_window;
}
static void
meta_window_x11_delete (MetaWindow *window,
guint32 timestamp)
{
MetaWindowX11 *window_x11 = META_WINDOW_X11 (window);
MetaWindowX11Private *priv =
meta_window_x11_get_instance_private (window_x11);
MetaX11Display *x11_display = window->display->x11_display;
meta_x11_error_trap_push (x11_display);
if (window->delete_window)
if (priv->wm_delete_window)
{
meta_topic (META_DEBUG_WINDOW_OPS,
"Deleting %s with delete_window request\n",
......
......@@ -53,6 +53,8 @@ void meta_window_x11_set_net_wm_state (MetaWindow *window);
void meta_window_x11_set_wm_state (MetaWindow *window);
void meta_window_x11_set_wm_take_focus (MetaWindow *window,
gboolean take_focus);
void meta_window_x11_set_wm_delete_window (MetaWindow *window,
gboolean delete_window);
void meta_window_x11_set_allowed_actions_hint (MetaWindow *window);
void meta_window_x11_create_sync_request_alarm (MetaWindow *window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment