LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 04-10-2007, 07:11 PM   #1
belhifet
LQ Newbie
 
Registered: Apr 2007
Distribution: Arch
Posts: 8

Rep: Reputation: 0
task switch between applications


I want to make a simple task switcher.
When a special event happens (e.g. when the mouse wheel is clicked), I want the program to switch the current application with the lastly used one.
I'm using C.

1. How can I get which is the current application running (having focus in X.org) and the lastly used one?
2. How can i switch the focus from the current one to the lastly used one (like if you had clicked at the lastly used application on the taskbar, and it would bring it to front, getting the focus)?
 
Old 04-10-2007, 09:18 PM   #2
rocket357
Member
 
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 485
Blog Entries: 187

Rep: Reputation: 74
Quote:
Originally Posted by belhifet
I want to make a simple task switcher.
When a special event happens (e.g. when the mouse wheel is clicked), I want the program to switch the current application with the lastly used one.
I'm using C.

1. How can I get which is the current application running (having focus in X.org) and the lastly used one?
2. How can i switch the focus from the current one to the lastly used one (like if you had clicked at the lastly used application on the taskbar, and it would bring it to front, getting the focus)?
Couple of questions:

1) what window manager are you using, as it will more than likely be the one to handle those tasks?
2) are you attempting to write a task switcher that is wm-independant, and if so, are you crazy?

Just kidding about the crazy stuff...but seriously, that's where I'd look first. Let me know if you run into trouble finding information...
 
Old 04-11-2007, 07:21 AM   #3
belhifet
LQ Newbie
 
Registered: Apr 2007
Distribution: Arch
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for the answer.

1. I'm using KDE, so kwin.
2. I would prefer to make a daemon that constantly runs and checks if the event happens. If it happens, it should switch the 2 applications.
But I would rather use some API in X.org, if there is one, because that would make it more independent of the user's WM choise.

Don't think at "task switcher" like the low level kernel scheduler.
I was thinking of using some X.org API or something.

Any ideas?
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Task bar no longer shows task Richard Rahl Linux - Newbie 3 04-12-2010 09:39 AM
Alt-tab Task switch replacements, know of any? nova_ Linux - Software 1 12-03-2006 01:17 AM
thread switch results in kernel stack switch superstition Linux - General 1 05-17-2005 11:48 PM
Open applications no longer on task/toolbar mr_zx9r Linux - Newbie 2 06-15-2004 10:53 AM
set up DSL thru SWITCH - winXp connected to SWITCH too husz Linux - Newbie 5 04-22-2004 12:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:35 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration