ALT+TAB in Linux OpenGL games

Post anything on anything here

Moderator: Moderators

ALT+TAB in Linux OpenGL games

Postby BusterDBK » Thu Mar 01, 2007 10:29 pm

As there may still be people that are wondering how to do this, I decided to translate it from my website. Here goes nothin'...

Since many games can be set to run in a window, you can see other applications as you play, so you might be able to keep track of IM messages and other things. The problem is most of the games "lock" the controls, so the only thing you can interact with is the game itself. Not a bad idea at all considering we don't want to click in the AmaroK playlist instead of fragging, but this also takes away the possibility to quickly switch to another program and back again.

Buuut... You can still ALT+TAB in Linux, but don't expect it to be as easy as with Windows ;). (please backup the file I tell you about before you edit it, just to make sure nothing unexpected happens)

First thing's first: we need to "unlock" the controls. Xorg provides an option for this, called "AllowDeactivateGrabs". To set this to "ON" edit the file: "/etc/X11/xorg.conf" or, depending on your system: "/etc/X11/XF86Config" and find the "ServerFlags" option, where you'll add the line:
Code: Select all
Option "AllowDeactivateGrabs" "true"


If you can't find ServerFlags, add it yourself so you get something like this:
Code: Select all
Section "ServerFlags"
Option "AllowDeactivateGrabs" "true"
EndSection


After restarting the X server, start a game (Nexuiz for example), make sure it's running in windowed mode (I tried this when in fullscreen and it was a complete mess) and press CTRL+ALT+ KP_SLASH (that's the " / " sign in the right section of the keyboard, where all the numbers are :P) to unlock the controls. Now you can use ALT+TAB to switch to another application.

Potential problems:

-- It doesn't work all the time, I think you need some windows open and not being completely over the game window... I'll post updates as I experiment more with it.

-- Sometimes when going back to the game the mouse doesn't work anymore. CTRL+ALT+KP_SLASH again and ALT+TAB (and not click) to get into the game window. It usually solves it, if not, try again ;).

-- Once, in Nexuiz, I hit " ` " to open the console and it would not let me type some of the letters ("v", "p" and others). Worked well with CTRL+ESC and it didn't happen again. Don't know what caused it.

Also: I got this information from [1]and[2].

Have fun and happy multitask fraggin' ;).
BusterDBK
Alien
 
Posts: 195
Joined: Mon May 01, 2006 8:07 pm
Location: Bucharest, Romania

Postby esteel » Thu Mar 01, 2007 11:00 pm

Well in the case of Nexuiz (and other quake-based games) its enough to open the console that will release to mouse so you can click in other windows and alt-tab is also working in windows mode anyway
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby KadaverJack » Thu Mar 01, 2007 11:08 pm

And if you prefer to use fullscreen, etswitch is much easier to use and doesn't seem to have the problems you described.
(and you should be carefull with "AllowDeactivateGrabs": some applications just crash if you are deactivate their grab (fist of all you should check if your screensaver/-lock still works))
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby BusterDBK » Fri Mar 02, 2007 11:30 am

esteel >> Indeed, I somehow overlooked that one. I didn't know it would release it anyway (that is without that option activated). :lol: Too bad it doesn't work for a bunch of other games (eh, I play a lot of Quake-based stuff anyway so...).

KadaverJack >> I'll look into it. Thanks! :wink: And unfortunately you're painfully right about the lock. It doesn't allow much access to the applications, but it won't let me unlock things either. :roll:
BusterDBK
Alien
 
Posts: 195
Joined: Mon May 01, 2006 8:07 pm
Location: Bucharest, Romania


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron