set _NET_WM_USER_TIME on the window master
authorDana Jansens <danakj@orodu.net>
Sun, 2 Mar 2008 17:24:07 +0000 (12:24 -0500)
committerDana Jansens <danakj@orodu.net>
Wed, 19 May 2010 18:13:32 +0000 (14:13 -0400)
src/command.C
src/rxvt.h
src/rxvttoolkit.C
src/rxvttoolkit.h

index 52924d4..78fa3b5 100644 (file)
@@ -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;
 
index 77a6154..3799b62 100644 (file)
@@ -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;
index c1ba37c..c52c954 100644 (file)
@@ -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",
index 4f91564..d0ef9d6 100644 (file)
@@ -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,