You are not logged in.

#1 2011-07-11 22:51:13

Corubba
Member
From: Germany
Registered: 2010-11-14
Posts: 86

window observer

Hey,

I'm looking for a way to observe a window. Im using a specific tool within a virtual wine desktop that transform some files. I have to use it, there is no alternativ. The thing is, the application itself cant handle a list of files, so i need to use it manually for every single file. But there are about 400. So im looking for a way to automate the progress.

I wrote a script that workes with `xdotool` to interacte with it (there is no cli or anything, just a GUI). I used `sleep` to get a delay and give the application the time to run. But the difference of progresstime between all the files are very high. So i have to set it to a very high value, even if the real calculation only takes a very little part it waits the hole time. very unefficient. Thats why i want to improve the hole thing. When "calculating" there is a progressbar rissing, when finished, the gui "freezes". no notification, no change, nothing. So my idea was to check the pixel on specific (x,y) coordinates within that window. I can do this by taking a screenshot and use some graphic apps like imagemagick or so to get the information, but this feels some kind of "dirty".

Is there any way to do it more directly. Does the Xserver have some kind of api for these kind of things? Anyone know about some good information or other ideas for my Problem?
While googeling, i get the thought that maybe the data in RAM can be used to get the point of finishing, but the linux architecture isn't made for this without segfaulting. But inside of Wine maybe?

Greetz
Corubba

Last edited by Corubba (2011-07-11 22:53:58)

Offline

#2 2011-07-16 15:00:58

Corubba
Member
From: Germany
Registered: 2010-11-14
Posts: 86

Re: window observer

Since there was no reply here, and googleing for hours also dont bring up any other idea, i made it through the screenshot method. screenshot with import, crop to a 1x1px image, and get the color with imagemagick. And it works.

Offline

Board footer

Powered by FluxBB