[Gambas-user] DesktopWatcher doesn't watch...

Benoît Minisini gambas at ...1...
Mon Aug 27 23:00:19 CEST 2012


Le 26/08/2012 21:27, RICHARD WALKER a écrit :
> There is more to this problem than I first thought. It is not just
> DesktopWatcher that I do not understand, but some of Desktop and
> DesktopWindow too.
>
> I have built a quick'n'dirty test harness to display some of the
> difficulties I have encountered. It is attached.
>
> It may be simplest to list what I can use with some confidence that it
> will work as expected and not crash.
>
> 1. Read all Desktop static properties and suspend/resume the screen saver
> 2. Use Desktop static method SendKeys (I have not tried Open,
> OpenTerminal,  RunAsRoot , SendMail)
> 3. Use DesktopWindow properties; Desktop, Id, Name (I have not tried
> any of the methods Close,  GetIcon,  Move,  Refresh,  Resize)
>
> The test program will:
> (a) Try to implement a DesktopWatcher, trapping all events
> (b) Try to list all desktop windows
> (c) Try to list windows with names matching a pattern
> (d) Try to activate the screensaver for 5 seconds
> (e) Identify the currently active window
> (f) Identify the current desktop and the total number of desktops
>
>
> (a) will fail with no indication that anything is wrong. Could be I am
> not doing it correctly.
> (b) uses two methods. One will fail to list any windows opened after
> the test program starts. The other will, from time to time, produce a
> swift and silent death from an X error, but when it works it can find
> more windows than the first method.
> (c) Always works, if the first method of (b) is used to iterate
> through the windows - so sadly it will fail if the window you are
> searching for was opened after the test program starts. Using the
> second method from (b) it will sometimes work, but there are quite a
> few patterns it doesn't like looking for.
> (d) Just doesn't seem to do anything - it neither works nor throws a hissy fit.
> (e) and (f) look to be too simple to fail, and they don't.
>

I tried with KDE, and everything seems to work as expected. Maybe LXDE 
does not support some properties the KDE window manager defined on the 
Root window?

-- 
Benoît Minisini




More information about the User mailing list