Solved

Unix X window activate duration

Posted on 2006-07-17
5
282 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
Comment Utility
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
Comment Utility
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
Comment Utility

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now