LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-12-2006, 10:10 PM   #1
3saul
Member
 
Registered: Aug 2004
Location: Brisbane, Australia
Distribution: Ubuntu/Fedora
Posts: 85

Rep: Reputation: 15
Check application visibility


I'm wanting to be able to check if a particular application is visible to the user. Is there an application that can check that and return the result? I've been doing some searching on google and the closest I've found is this (which is pygtk)....however this is to check an applications own visibility, not another applications visibility. Any help or direction much appreciated. I'm wanting something that can return the visibility status of any application...

To check if a gtk.Window is visible you can use the visible property inherited from gtk.Widget.

self.window =3D gtk.Window()
self.window.show()
self.window.get_property("visible")
 
Old 02-13-2006, 04:07 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
Quote:
I'm wanting something that can return the visibility status of any application...
Not sure what you mean by this. Do you mean you want to check if the particular app has focus on the desktop?
 
Old 02-13-2006, 05:16 PM   #3
3saul
Member
 
Registered: Aug 2004
Location: Brisbane, Australia
Distribution: Ubuntu/Fedora
Posts: 85

Original Poster
Rep: Reputation: 15
I think so. Basically I'm wanting to check if a screensaver or some other full screen application is running (a game, screensaver or some other full screen app)...
 
Old 02-13-2006, 05:30 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 58
I see. I have never heard of an app that does this, but that doesn't necessarily mean it doesn't exist
I don't even know what sort of term you could use to search for something like that?
 
Old 02-13-2006, 05:54 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165

Rep: Reputation: 243Reputation: 243Reputation: 243
Have a look at "xlswins", it will give you a list of all X server windows and "xwininfo -id win_id" that give some information about a window, including its "map state" that shows if the window is viewable or not.
 
Old 02-13-2006, 06:17 PM   #6
3saul
Member
 
Registered: Aug 2004
Location: Brisbane, Australia
Distribution: Ubuntu/Fedora
Posts: 85

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlliagre
Have a look at "xlswins", it will give you a list of all X server windows and "xwininfo -id win_id" that give some information about a window, including its "map state" that shows if the window is viewable or not.

Yes I did test out the xwininfo 'Map State' thing...unfortunately a window is shown as 'IsVisible' even if it's not visible (ie hidden behind another app or window).
 
Old 02-13-2006, 07:00 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165

Rep: Reputation: 243Reputation: 243Reputation: 243
I don't think the X server store layer information, the window manager does so you may want to interact with it/patch it to retrieve that information.

How would you handle transparent overlapping windows by the way ?
 
Old 02-13-2006, 07:22 PM   #8
3saul
Member
 
Registered: Aug 2004
Location: Brisbane, Australia
Distribution: Ubuntu/Fedora
Posts: 85

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlliagre
I don't think the X server store layer information, the window manager does so you may want to interact with it/patch it to retrieve that information.

How would you handle transparent overlapping windows by the way ?
This is getting very complicated.

I don't really care about other open applications that are windowed, even if they do cover my application. I'm just concerned with pausing (sleeping) my application if a full screen game or screen saver is started.
 
Old 02-13-2006, 07:55 PM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Ubuntu, OEL
Posts: 9,165

Rep: Reputation: 243Reputation: 243Reputation: 243
I guess you should be able to detect a full screen game by parsing "xlswins -l" output for full-screen windows, remove the root window and any window not viewable.

Concerning the screen-savers, they normally lock the display, so any X11 connection will be refused as long as they are running, easy for you to detect them so.
 
Old 02-13-2006, 08:43 PM   #10
3saul
Member
 
Registered: Aug 2004
Location: Brisbane, Australia
Distribution: Ubuntu/Fedora
Posts: 85

Original Poster
Rep: Reputation: 15
Thanks for your help on this. I've figured out I can do it all with xwininfo in the same way you suggested above.

Thanks again for your time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Wily Technology Extends End-to-End Application Visibility to oracle(R) Databases LXer Syndicated Linux News 0 12-14-2005 07:46 AM
gcc 4.0.2 and Elf Visibility SKelem Linux - Software 3 11-07-2005 04:12 PM
Problem with GCC 4.0 Visibility eelshcn Programming 0 09-22-2005 01:52 PM
check current version of application tarheel92x Fedora 1 04-21-2004 09:41 PM
apache directory visibility zepplin611 Linux - Software 1 01-26-2004 03:32 PM


All times are GMT -5. The time now is 08:39 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration