Solved

Unix X window activate duration

Posted on 2006-07-17
5
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Introduction to Processes

718 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