From: Dana Jansens Date: Sun, 2 Mar 2008 17:24:07 +0000 (-0500) Subject: set _NET_WM_USER_TIME on the window X-Git-Url: http://git.openbox.org/?p=dana%2Furxvt.git;a=commitdiff_plain;h=73e8d50fd2ef4ddb91d9f2e9b77c5116985e7a5c set _NET_WM_USER_TIME on the window --- diff --git a/src/command.C b/src/command.C index 52924d4..78fa3b5 100644 --- a/src/command.C +++ b/src/command.C @@ -402,6 +402,13 @@ map_function_key (KeySym keysym) } void +rxvt_term::update_user_time (Time time) +{ + XChangeProperty (dpy, parent[0], xa[XA_NET_WM_USER_TIME], XA_CARDINAL, + 32, PropModeReplace, (unsigned char*)&time, 1); +} + +void rxvt_term::key_press (XKeyEvent &ev) { int ctrl, meta, shft, len; @@ -1362,6 +1369,7 @@ rxvt_term::x_cb (XEvent &ev) switch (ev.type) { case KeyPress: + update_user_time (ev.xkey.time); key_press (ev.xkey); break; @@ -1370,6 +1378,7 @@ rxvt_term::x_cb (XEvent &ev) break; case ButtonPress: + update_user_time (ev.xbutton.time); button_press (ev.xbutton); break; diff --git a/src/rxvt.h b/src/rxvt.h index 77a6154..3799b62 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -1245,6 +1245,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen // command.C void key_press (XKeyEvent &ev); void key_release (XKeyEvent &ev); + void update_user_time (Time time); unsigned int cmd_write (const char *str, unsigned int count); wchar_t next_char () NOTHROW; diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C index c1ba37c..c52c954 100644 --- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -62,6 +62,7 @@ const char *const xa_names[] = "_NET_WM_ICON_NAME", "_NET_WM_PING", "_NET_WM_ICON", + "_NET_WM_USER_TIME", #endif #if USE_XIM "WM_LOCALE_NAME", diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h index 4f91564..d0ef9d6 100644 --- a/src/rxvttoolkit.h +++ b/src/rxvttoolkit.h @@ -62,6 +62,7 @@ enum { XA_NET_WM_ICON_NAME, XA_NET_WM_PING, XA_NET_WM_ICON, + XA_NET_WM_USER_TIME, #endif #if USE_XIM XA_WM_LOCALE_NAME,