Changing Focus in SDL version under Linux?

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

Changing Focus in SDL version under Linux?

Postby Nil » Mon Sep 11, 2006 2:27 pm

Is it possible to change the keyboard / mouse focus under Linux with the SDL version to another application from in-game?
Somehow it must be possible, cos that happend recently when Xchat grabbed input focus when somebody sent me a DCC chat request.
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby esteel » Mon Sep 11, 2006 2:44 pm

When Nexuiz is in windowed mode you can open the console (` or when the menu is visible use shift-escape) Nexuiz will release the mouse then and you can use other windows. I do not think there is a way for this in fullscreen mode as Nexuiz would have to commiunicate with the windowmanager and there are lots and lors of different ones..
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby Nil » Mon Sep 11, 2006 2:48 pm

Ah, great, thanks! :)
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby divVerent » Mon Sep 11, 2006 5:15 pm

Some windowmanagers allow making windows borderless when they have a given title or class name. You can use this to make Nexuiz run windowed, but at full size without borders or title bars, on its own virtual desktop. To switch away, you then press Shift-Esc and then whatever you set your window manager to for changing desktops.

Window managers that can do that inlcude Fluxbox and E17. Not sure about KDE or GNOME as I don't use them... but maybe someone here can enlighten (pun not intended) us.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Nil » Tue Sep 12, 2006 1:32 pm

Thanks for this hint. I use Metacity and tried to undecorate and fullscreen windowed Nexuiz with Devil's Pie. Undecorating works, fullscreen not, maximizing neither.
Code: Select all
cat ~/.devilspie/nexuiz.ds
(if
        (is (application_name) "SDL_App")
        (begin
                (undecorate)
                (fullscreen)
        )
)

I don't think it's a problem with Metacity / Devil's Pie in general, because the same thing works for example with Firefox. Maybe Metacity can't properly deal with SDL-Applications.
As it would be very nice indeed to switch from fullscreen Nexuiz, I might try one of the window managers you mentioned but I'm to lazy for the hazzle at the moment. ;)
Maybe a seasoned Gnome user has a hint to what I'm missing in my Devil's Pie setup?
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby divVerent » Tue Sep 12, 2006 10:26 pm

Nil wrote:Thanks for this hint. I use Metacity and tried to undecorate and fullscreen windowed Nexuiz with Devil's Pie. Undecorating works, fullscreen not, maximizing neither.


No, no, you don't need to maximize. Set vid_width and vid_height to match your screen resolution. If you do that and undecorate, the window should cover the full screen.

Now all you need to do is moving it to an otherwise empty virtual desktop and MAYBE force it to end up at 0,0. Maybe (maximize) will do that for you, but it certainly can't change a SDL game's screen resolution.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Nil » Wed Sep 13, 2006 12:09 pm

Arghh, stupid me. Setting vid_witdh and vid_height in Nexuiz and "(geometry "+0+0")" in Devil's Pie config works bloddy fine, Thanks again!

Devil's Pie reports the following information when Nexuizs starts:
Window Title: 'untitled window'; Application Name: 'SDL_App'; Class: 'SDL_App'
I'm gonna try to find out how I can change these cos I'd like to have them more specific.

Cheers! :D
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby divVerent » Wed Sep 13, 2006 12:18 pm

for the SDL build, I get using xprop:

Code: Select all
WM_NAME(UTF8_STRING) = "Nexuiz"
WM_CLASS(STRING) = "SDL_App", "SDL_App"


and for the GLX build, I get:

Code: Select all
WM_NAME(STRING) = "Nexuiz"


Hm... no WM_CLASS? Strange... but at least in the GLX case, it should be easy to add. Maybe I'll do it if nobody else volunteers...
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Nil » Wed Sep 13, 2006 2:42 pm

Xprop output is the same here. When I run the GLX version Devil's Pie reports:
Window Title: 'Nexuiz'; Application Name: 'Nexuiz'; Class: ''; Geometry: 1600x1119+0+48
So for the GLX version I think everything is fine.
I guess Devil's Pie just can't deal with UTF-8 enconding. Running Devil's Pie from a shell where I exported LC_ALL=en_US.utf8 didn't help. Maybe Pie takes encoding information from somewhere else. If I feel like it I will dig into that.
I don't use the GLX version because I don't get sound there and I am too lazy to configure it properly (and SDL version works just fine). :oops:
Nil
Advanced member
 
Posts: 81
Joined: Wed Mar 01, 2006 5:10 pm

Postby divVerent » Thu Sep 14, 2006 5:52 am

Still, I'll check how hard it is to add proper WM_CLASS support and probably submit a patch for it.

As a workaround, I found this: http://www.archivesat.com/for_maemo_dev ... 390648.htm

If this really works (the SDL_VIDEO_X11_WMCLASS environment variable), it would be a cool candidate for nexuiz-linux-sdl.sh. For me it worked:

Code: Select all
$ SDL_VIDEO_X11_WMCLASS=foo ../darkplaces/nexuiz-sdl


and then xprop showed:

Code: Select all
WM_CLASS(STRING) = "foo", "foo"


That should help you... for users of the shell script, just add

Code: Select all
export SDL_VIDEO_X11_WMCLASS=NexuizSDL


after the first line of nexuiz-linux-sdl.sh.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Next

Return to Nexuiz - Support / Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron