Solved

Unix X window activate duration

Posted on 2006-07-17
5
285 Views
Last Modified: 2008-02-01
In unix, is it possible to estimate the total activate duration of particular window?

Let say i launch an x-term, when the mouse is inside the xterm (active), the counter start. On the other hand, when the mouse is outside (de-avtive) xterm, the counter pause. While the time i exit the xterm, the counter can tell me how much time the xterm is actuvated compared to the time it being launched.

Expert out there, is it possible to do this? Anyone please help me.
0
Comment
Question by:lenz8as
  • 2
5 Comments
 
LVL 1

Expert Comment

by:zzhang2006
ID: 17151132
The answer really depends on how your situations,

                                      1)  if the the X-window application, is made by you, by programming for example
                                           C++, and etc/X libraries/Motiff, then you can log the activation time through some
                                           X-window API in the program.

                                       2)  If is is existing X window clients, such as xterm, x-clock, or other games,  it again
                                              branch into two cases:
                                                                               a)  the application has an startup option, say,  xterm -l log_active
                                                                                         , then you need set the alias to that application to
                                                                                           start with the log. Need look into the man pages of
                                                                                             the particular X-application.  

                                                                                    b)  If above is does not work for you, the last hope is thorugh
                                                                                          the X-Server options, depending on the versions of your
                                                                                           UNIX/Linux, the X Window server may be started with
                                                                                           logging options for all the clients. (note it might be
                                                                                              per userid/application/process-id.) In general, the
                                                                                               X-window server starts at the the system boot time
                                                                                               , you need locate the system boot configuration files
                                                                                               on you system to do such tricks.

Hope this helps.


Ze
                                                                                             options, the for
 
                                                                                     
0
 

Author Comment

by:lenz8as
ID: 17160740
I think the x window API maybe help me (suggestion 1). Can you explain more on this.
Thanks.
0
 
LVL 1

Accepted Solution

by:
zzhang2006 earned 500 total points
ID: 17162047

We are talking about Unix X-window programing -- creating applications that has graphic user interface.
Normally it is done by  calling the Motif -> Xt (X toolkid) -> Xlib routines, with the Xlib at the lowest
level. You probablity don't need to directly call the Xlib functions, if you are making an higher level
application. There are high level language interfaces to Motif and Xt you just need to call them. The starting
point is here, if you totally new to GUI programming in under X windows:

http://wwweic.eri.u-tokyo.ac.jp/computer/manual/

http://wwweic.eri.u-tokyo.ac.jp/computer/manual/lx/SGI_Developer/books/XLib_WinSys/sgi_html/index.html

http://www.openmotif.org/    Motif


Ze
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question