Solved

Unix X window activate duration

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rubik's Cube Code for Effective Presentation 3 77
Auto-indent certain lines in Notepad++ 10 145
"Black Box" Testing of Control System Software 2 96
Help Required 2 46
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

733 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