Is there a way to find out when a window has actually been activated?

3 posts / 0 new
Last post
hypex
hypex's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2011-09-09 16:20
Is there a way to find out when a window has actually been activated?

Hi guys.

A long time ago now, on OS4 as it happens, I discovered an issue with ActivateWindow(). It doesn't return when the window is activated as expected. Because of how Intuition works with it's event timers refreshing every 10th of a second or so. This has caused me trouble when working on a commodity that pastes text into the input stream. In some cases, where focus is taken away from the window, by the time the original window has been activated has been too late and my paste has been blanked out.

I wonder if there is any way to activate a window and be sure it has activated? The simple way would be to just delay using Delay() or timer.device. So I could do that.

I'm also thinking that an input handler or Cx filter could do the job. Waiting for the window to turn up in the activate event. Then signal my process.

Is there another way to call ActivateWindow() and be sure the window is activated, without other work arounds and patches to the system?

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
Re: Is there a way to find out when a window has actually...

Just wait for an IDCMP_ACTIVEWINDOW event.

hypex
hypex's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2011-09-09 16:20
Re: Is there a way to find out when a window has actually...

Thanks salass00. Unfortunately I can't do it that way. Since I'm running from a commodity my process doesn't own the window being activated. Although I do take the liberty of reactivating it since my commodity takes the focus off with it's own window. So I need to detect externally. If a gadget was active at the time it gets deeper as that needs to be reactivated as well. I perhaps should have asked this question in the context of a commodity rather than a general sense.

Log in or register to post comments