focus stealing prevention in xfdesktop
Brian J. Tarricone
bjt23 at cornell.edu
Thu Feb 23 19:35:45 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 2/23/2006 9:33 AM, Olivier Fourdan wrote:
> Brian J. Tarricone wrote:
>>> To achieve what you want, you may use the following (which is perfectly standard):
>>>
>>> gdk_x11_window_set_user_time (GdkWindow, GDK_CURRENT_TIME);
>>>
>>> That will tell the WM that you mean to focus the window anyway even if focus prevention is enabled.
>> Ah, cool, thanks. Which GdkWindow should be set as the parameter here?
>> I assume xfdesktop's vroot window, since that's really the only
>> persistent window, but technically it's the menu shell window that
>> causes the event.
>
> Well, maybe I missed the point. If you map an existing window (such as
> MCS plug-ins windows for example), then GTK doesn't update the user_time
> as there was no real user activity on the widnow since the last unmap.
> As a result, the window will unlikely be focused.
>
> To avoid that, prior to show the window, you should reset the user_time
> to GTK_CURRENT_TIME (actually 0) on the corresponding GdkWindow so that
> the windows gets focused.
>
> Now, I'm not sure what you mean by xfdesktop window as the vroot window
> is unlikely to be mapped/unmapped.
I think I'm just confused. *Where* does this function get called? In
the app that initiates the button click, or the app that pops up a new
window?
-brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
iD8DBQFD/gCB6XyW6VEeAnsRAk7QAJ0ZD0ok/Jl/gKzXB2GrM3ulA4fFugCgkTvy
gA9eHiTiq+UDnxDD1IDJFf4=
=eJ7Q
-----END PGP SIGNATURE-----
More information about the Xfce4-dev
mailing list