Add a user_time field.
2004-08-23 Matthias Clasen <mclasen@redhat.com> * gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Add a user_time field. * gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Update toplevel->user_time. (show_window_internal): Update the user time when re-mapping a toplevel window. (#150502, Elijah Newren) * gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest EWMH additions to the _NET_ACTIVE_WINDOW client message format. (#150668, Elijah Newren)
This commit is contained in:
committed by
Matthias Clasen
parent
bf54ef87c6
commit
9573059b2d
@@ -1,5 +1,13 @@
|
||||
2004-08-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Add a
|
||||
user_time field.
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Update
|
||||
toplevel->user_time.
|
||||
(show_window_internal): Update the user time when re-mapping a
|
||||
toplevel window. (#150502, Elijah Newren)
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest
|
||||
EWMH additions to the _NET_ACTIVE_WINDOW client message
|
||||
format. (#150668, Elijah Newren)
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
2004-08-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Add a
|
||||
user_time field.
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Update
|
||||
toplevel->user_time.
|
||||
(show_window_internal): Update the user time when re-mapping a
|
||||
toplevel window. (#150502, Elijah Newren)
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest
|
||||
EWMH additions to the _NET_ACTIVE_WINDOW client message
|
||||
format. (#150668, Elijah Newren)
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
2004-08-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Add a
|
||||
user_time field.
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Update
|
||||
toplevel->user_time.
|
||||
(show_window_internal): Update the user time when re-mapping a
|
||||
toplevel window. (#150502, Elijah Newren)
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest
|
||||
EWMH additions to the _NET_ACTIVE_WINDOW client message
|
||||
format. (#150668, Elijah Newren)
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
2004-08-23 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/x11/gdkwindow-x11.h (struct _GdkToplevelX11): Add a
|
||||
user_time field.
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (_gdk_x11_window_set_user_time): Update
|
||||
toplevel->user_time.
|
||||
(show_window_internal): Update the user time when re-mapping a
|
||||
toplevel window. (#150502, Elijah Newren)
|
||||
|
||||
* gdk/x11/gdkwindow-x11.c (gdk_window_focus): Support the latest
|
||||
EWMH additions to the _NET_ACTIVE_WINDOW client message
|
||||
format. (#150668, Elijah Newren)
|
||||
|
||||
@@ -105,6 +105,14 @@ static gpointer parent_class = NULL;
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
|
||||
|
||||
/* Return whether time1 is considered later than time2 as far as xserver
|
||||
* time is concerned. Accounts for wraparound.
|
||||
*/
|
||||
#define XSERVER_TIME_IS_LATER(time1, time2) \
|
||||
( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \
|
||||
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
|
||||
)
|
||||
|
||||
GType
|
||||
gdk_window_impl_x11_get_type (void)
|
||||
{
|
||||
@@ -1187,6 +1195,8 @@ show_window_internal (GdkWindow *window,
|
||||
gboolean raise)
|
||||
{
|
||||
GdkWindowObject *private;
|
||||
GdkDisplayX11 *display_x11;
|
||||
GdkToplevelX11 *toplevel;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -1211,6 +1221,17 @@ show_window_internal (GdkWindow *window,
|
||||
|
||||
g_assert (GDK_WINDOW_IS_MAPPED (window));
|
||||
|
||||
if (GDK_WINDOW_IS_TOPLEVEL (window))
|
||||
{
|
||||
display_x11 = GDK_DISPLAY_X11 (gdk_drawable_get_display (window));
|
||||
toplevel = _gdk_x11_window_get_toplevel (window);
|
||||
|
||||
if (toplevel->user_time != 0 &&
|
||||
display_x11->user_time != 0 &&
|
||||
XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time))
|
||||
_gdk_x11_window_set_user_time (window, display_x11->user_time);
|
||||
}
|
||||
|
||||
if (impl->position_info.mapped)
|
||||
XMapWindow (xdisplay, xwindow);
|
||||
}
|
||||
@@ -3349,6 +3370,7 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDisplayX11 *display_x11;
|
||||
GdkToplevelX11 *toplevel;
|
||||
glong timestamp_long = (glong)timestamp;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
@@ -3359,6 +3381,7 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
|
||||
display = gdk_drawable_get_display (window);
|
||||
display_x11 = GDK_DISPLAY_X11 (display);
|
||||
toplevel = _gdk_x11_window_get_toplevel (window);
|
||||
|
||||
XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"),
|
||||
@@ -3367,6 +3390,8 @@ _gdk_x11_window_set_user_time (GdkWindow *window,
|
||||
|
||||
if (timestamp_long != GDK_CURRENT_TIME)
|
||||
display_x11->user_time = timestamp_long;
|
||||
|
||||
toplevel->user_time = timestamp_long;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,6 +114,9 @@ struct _GdkToplevelX11
|
||||
GdkPixmap *icon_window;
|
||||
GdkWindow *group_leader;
|
||||
|
||||
/* Time of most recent user interaction. */
|
||||
gulong user_time;
|
||||
|
||||
/* We use an extra X window for toplevel windows that we XSetInputFocus()
|
||||
* to in order to avoid getting keyboard events redirected to subwindows
|
||||
* that might not even be part of this app
|
||||
|
||||
Reference in New Issue
Block a user