Solved

Unix X window activate duration

Posted on 2006-07-17
5
284 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

930 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

12 Experts available now in Live!

Get 1:1 Help Now