_NET_WM_USER_TIME reconsidered



During a recent effort to reduce unnecessary wakeups of userspace
applications (in preparation for tickless kernels), it was brought to
my attention that the GNOME workspace switcher applet wakes up for
every key press in any window on the desktop. 

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=204968

The same happens with metacity; we're taking ~6 context switches per
key press, which is "not nice" for battery life on laptops.

It happens because the workspace switcher listens for property changes
on all toplevel windows (to catch icon changes, etc). And GTK+ follows
the EWMH and updates the _NET_WM_USER_TIME property on every user
input. 

A simple solution for this problem is to put the _NET_WM_USER_TIME
property on a separate window. Then applications listening for changes
of the toplevel window properties are not affected by its frequent
changes.

I'd like to propose the following addition to the EWMH:


  _NET_WM_USER_TIME_WINDOW WINDOW/32

  This property contains the XID of a window on which the client sets
  the _NET_WM_USER_TIME property. Clients should check whether the 
  window manager supports _NET_WM_USER_TIME_WINDOW and fall back to 
  setting the _NET_WM_USER_TIME property on the toplevel window if it 
  doesn't. 

  Rationale: Storing the frequently changing _NET_WM_USER_TIME property
  on the toplevel window itself causes every application that is   
  interested in any of the properties of that window to be woken up   
  on every keypress, which is particularly bad for laptops running on 
  battery power.


I have a patch which implements this in GTK+, and Elijah indicated
that he is willing to change Metacity to support
_NET_WM_USER_TIME_WINDOW.


Matthias


PS I should not forget to mention that Owen already pointed out this 
problem and the proposed solution when _NET_WM_USER_TIME was discussed
in 2003:

http://mail.gnome.org/archives/wm-spec-list/2003-May/msg00047.html





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]