diff --git a/src/core/window-private.h b/src/core/window-private.h index c0cf4f1b1..77f8e221a 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -275,9 +275,6 @@ struct _MetaWindow know about for this window */ guint32 net_wm_user_time; - /* window that gets updated net_wm_user_time values */ - Window user_time_window; - gboolean has_custom_frame_extents; MetaFrameBorder custom_frame_extents; diff --git a/src/core/window.c b/src/core/window.c index 6eed1acbb..9bf9c4177 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1058,7 +1058,6 @@ meta_window_constructed (GObject *object) window->initial_workspace_set = FALSE; window->initial_timestamp_set = FALSE; window->net_wm_user_time_set = FALSE; - window->user_time_window = None; window->input = TRUE; window->calc_placement = FALSE; window->have_focus_click_grab = FALSE; diff --git a/src/x11/events.c b/src/x11/events.c index 95aca722e..e8fa2a72e 100644 --- a/src/x11/events.c +++ b/src/x11/events.c @@ -1287,7 +1287,7 @@ handle_other_xevent (MetaX11Display *x11_display, * responding to UnmapNotify events is kind of bad. */ property_for_window = NULL; - if (window && modified == window->user_time_window) + if (window && modified == meta_window_x11_get_user_time_window (window)) { property_for_window = window; window = NULL; diff --git a/src/x11/window-props.c b/src/x11/window-props.c index 9ea0b51bf..b853790f7 100644 --- a/src/x11/window-props.c +++ b/src/x11/window-props.c @@ -419,17 +419,20 @@ reload_net_wm_user_time_window (MetaWindow *window, { if (value->type != META_PROP_VALUE_INVALID) { + MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); + MetaWindowX11Private *priv = meta_window_x11_get_private (window_x11); MetaWindow *prev_owner; + MetaWindowX11Private *prev_owner_priv; /* Unregister old NET_WM_USER_TIME_WINDOW */ - if (window->user_time_window != None) + if (priv->user_time_window != None) { /* See the comment to the meta_display_register_x_window call below. */ meta_x11_display_unregister_x_window (window->display->x11_display, - window->user_time_window); + priv->user_time_window); /* Don't get events on not-managed windows */ XSelectInput (window->display->x11_display->xdisplay, - window->user_time_window, + priv->user_time_window, NoEventMask); } @@ -438,16 +441,17 @@ reload_net_wm_user_time_window (MetaWindow *window, */ prev_owner = meta_x11_display_lookup_x_window (window->display->x11_display, value->v.xwindow); - if (prev_owner && prev_owner->user_time_window == value->v.xwindow) + prev_owner_priv = meta_window_x11_get_private (META_WINDOW_X11 (prev_owner)); + if (prev_owner && prev_owner_priv->user_time_window == value->v.xwindow) { meta_x11_display_unregister_x_window (window->display->x11_display, - value->v.xwindow); - prev_owner->user_time_window = None; + value->v.xwindow); + prev_owner_priv->user_time_window = None; } /* Obtain the new NET_WM_USER_TIME_WINDOW and register it */ - window->user_time_window = value->v.xwindow; - if (window->user_time_window != None) + priv->user_time_window = value->v.xwindow; + if (priv->user_time_window != None) { /* Kind of a hack; display.c:event_callback() ignores events * for unknown windows. We make window->user_time_window @@ -462,11 +466,11 @@ reload_net_wm_user_time_window (MetaWindow *window, * and it's not specified in the spec anyway. */ meta_x11_display_register_x_window (window->display->x11_display, - &window->user_time_window, + &priv->user_time_window, window); /* Just listen for property notify events */ XSelectInput (window->display->x11_display->xdisplay, - window->user_time_window, + priv->user_time_window, PropertyChangeMask); /* Manually load the _NET_WM_USER_TIME field from the given window @@ -475,7 +479,7 @@ reload_net_wm_user_time_window (MetaWindow *window, */ meta_window_reload_property_from_xwindow ( window, - window->user_time_window, + priv->user_time_window, window->display->x11_display->atom__NET_WM_USER_TIME, initial); } diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index b309586f2..85a51b2cd 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -81,6 +81,9 @@ struct _MetaWindowX11Private Window xclient_leader; Window xgroup_leader; + /* window that gets updated net_wm_user_time values */ + Window user_time_window; + /* Bypass compositor hints */ MetaBypassCompositorHint bypass_compositor; @@ -93,4 +96,6 @@ void meta_window_x11_initialize_state (MetaWindow *window); Window meta_window_x11_get_xgroup_leader (MetaWindow *window); +Window meta_window_x11_get_user_time_window (MetaWindow *window); + G_END_DECLS diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index f028c2f5c..216576ab7 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -699,11 +699,11 @@ meta_window_x11_unmanage (MetaWindow *window) * _NET_WM_USER_TIME_WINDOW and IPC, perhaps. */ - if (window->user_time_window != None) + if (priv->user_time_window != None) { meta_x11_display_unregister_x_window (x11_display, - window->user_time_window); - window->user_time_window = None; + priv->user_time_window); + priv->user_time_window = None; } if (META_X11_DISPLAY_HAS_SHAPE (x11_display)) @@ -2074,6 +2074,8 @@ meta_window_x11_constructed (GObject *object) priv->xvisual = attrs.visual; window->mapped = attrs.map_state != IsUnmapped; + priv->user_time_window = None; + window->decorated = TRUE; window->hidden = FALSE; priv->border_width = attrs.border_width; @@ -2883,6 +2885,7 @@ meta_window_x11_impl_process_property_notify (MetaWindow *window, XPropertyEvent *event) { Window xid = meta_window_x11_get_xwindow (window); + Window user_time_window = meta_window_x11_get_user_time_window (window); if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */ { @@ -2895,9 +2898,9 @@ meta_window_x11_impl_process_property_notify (MetaWindow *window, } if (event->atom == window->display->x11_display->atom__NET_WM_USER_TIME && - window->user_time_window) + user_time_window) { - xid = window->user_time_window; + xid = user_time_window; } meta_window_reload_property_from_xwindow (window, xid, event->atom, FALSE); @@ -4430,3 +4433,17 @@ meta_window_x11_get_xgroup_leader (MetaWindow *window) return priv->xgroup_leader; } + +Window +meta_window_x11_get_user_time_window (MetaWindow *window) +{ + MetaWindowX11 *window_x11; + MetaWindowX11Private *priv; + + g_return_val_if_fail (META_IS_WINDOW (window), None); + + window_x11 = META_WINDOW_X11 (window); + priv = meta_window_x11_get_instance_private (window_x11); + + return priv->user_time_window; +}