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

Bruce bbruen at ...2308...
Tue Aug 28 04:08:28 CEST 2012


Hi Richard,

I tried your program here:
[System]
OperatingSystem=Linux
Kernel=2.6.38.8-pclos3.bfs
Architecture=i686
Memory=1553368 kB
DistributionVendor=PCLinuxOS
DistributionRelease="PCLinuxOS"
Desktop=LXDE

[Gambas 3]
Version=3.2.90
Path=/usr/local/bin/gbx3

[Libraries]
Qt4=libQtCore.so.4.8.2
GTK+=libgtk-x11-2.0.so.0.2400.10

and dont seem to get the same results as you.

On Sun, 2012-08-26 at 20:27 +0100, RICHARD WALKER wrote:
> 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.
Looks fine to me. Breakpointing at the line after 
        WindowWatcher = New DesktopWatcher(True) As "WindowWatcher"
the debugger show me a perfectly valid WindowWatcher object.

> (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.
Both buttons give me the same window list and I haven't been able to
reproduce "a swift and silent death".  However I do see the following
console output:

        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x209480e2
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x6c6f7645
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x6f697475
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x2a0006e
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x209480e2
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x209480e2
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x6c6f7645
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x6c6f7645
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x6f697475
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x6f697475
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x2a0006e
        X Error: BadWindow (invalid Window parameter) 3
          Major opcode: 20 (X_GetProperty)
          Resource id:  0x2a0006e
        
> (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.
Some strangeness here.  The left hand button always works and gives the
correct list.  The right hand button always works but does miss some
windows in the results - consistently (and always the same ones). So it
looks like Desktop.FindWindow(pattern) isn't too good on LXDE.
On thinking about this, I recall that I had a problem a few weeks ago
with this as well.  What is strange here is the properties revealed by
xprop don't seem to match expectation.
        [bb at ...2711... ~]$ xprop|grep WM_
        WM_STATE(WM_STATE):
        WM_CLIENT_LEADER(WINDOW): window id # 0x2e00004
        WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS,
        WM_NAME(STRING) = "Gambas project "TO DO" manager"
        WM_LOCALE_NAME(STRING) = "en_AU.UTF-8"
        WM_CLASS(STRING) = "tasklister2.gambas", "Tasklister2.gambas"
        WM_HINTS(WM_HINTS):
        WM_NORMAL_HINTS(WM_SIZE_HINTS):
        WM_CLIENT_MACHINE(STRING) = "bluecow.phnet"
        WM_COMMAND(STRING) = { "/usr/local/bin/tasklister2.gambas" }
        
There is no WM_WINDOW_ROLE! Maybe that is why those X errors above
occur? 

> (d) Just doesn't seem to do anything - it neither works nor throws a
> hissy fit.
Works fine here.

> (e) and (f) look to be too simple to fail, and they don't. 

The only straws I can offer you to grasp at are : Mageia vs PCLinuxOS
implementations of the Portland stuff or two monitors vs one?

Bruce










More information about the User mailing list