Anything in PowerBuilder (e.g. the Idle event) is on the application level, so if you want to track this on the window level, you're going to have to roll your own.
The first factor in how difficult this could be is your framework. If all your application level windows are descendants of framework windows and all the controls on them are descendants of framework user objects, then you're golden. If you've got 500 windows, all descending straight off of system classes (e.g. "from window" or "from datawindow" in the source of your objects), you're probably out of luck.
The next question is, what is "activity"? Is it editing a DataWindow (e.g. EditChanged), scrolling through a listview, or just flicking the mouse around? This will generate your list of events in the framework you have to code. In each of these, I'd probably call a service so that you could encapsulate the functionality in one place. In this, I'd probably Start() a independent Timing object at the window level. (You need to be careful about how much you do here; you don't want a 100 wpm typist or someone playing with the mouse to peg the CPU.)
Of course, in the Timer event of the Timing object, you can disconnect. Equally obvious, I hope, is that you have to adjust your save routines (in the framework?) to gracefully deal with a disconnected state.
Good luck,
Terry.