LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 11-07-2009, 12:55 PM   #1
robuust
LQ Newbie
 
Registered: Jul 2009
Posts: 13

Rep: Reputation: 0
shellscript to check if window has focus, possible?


I'm playing a game through wine (fullscreen), when I alt-tab back to my ubuntu desktop, the resolution doesn't change back, but stays at the game resolution.

I'm currently using a shellscript that changes the resolution back to my origional resolution (using xrandr -s 0)

Is it possible to check which window has focus using a shellscript.
If the game doesn't have focus change resolution to my origional resolution.
 
Old 11-08-2009, 02:17 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,434

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
maybe using xwininfo?
 
Old 11-08-2009, 01:44 PM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: Slackware64 13.37, Kubuntu 10.04
Posts: 2,941

Rep: Reputation: Disabled
That doesn't seem to show any differences regarding focus, but thanks for pointing out the tool!
Kevin Barry
 
Old 11-08-2009, 02:02 PM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,434

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
Okay, I should have checked... but I was looking at some other stuff I have around here today and 'xdotool' can identify the window which has focus.
 
  


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
Window Monitor Focus Ofc. Badiesel Linux - Newbie 1 05-03-2009 07:04 PM
click to focus window dynamicit Suse/Novell 0 08-01-2006 10:54 AM
New window focus in XFce xray_fl Programming 0 05-12-2005 02:05 PM
window focus thaprza Linux - Newbie 3 03-06-2005 03:25 PM
SDL window focus rebelcan Programming 1 10-06-2003 07:36 AM


All times are GMT -5. The time now is 10:55 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