Jump to content
The Dark Mod Forums

A patch to allow alt-tabbing under Linux


NagaHuntress

Recommended Posts

I've created a patch to fix the problem where it was impossible alt-tab (or use any other window manager key combos) to switch away from TDM. This patch works for both windowed and full screen modes.

tdm-linux-window-manager-key-fix.txt

Changes:
- It will no longer grab exclusive input of the keyboard by default. This allows the window manager to process the keyboard input and do things like alt-tabbing. To get the old behaviour set 'in_grabkeyboard' to 1 (Exception: Full screen console will now ungrab, previously only windowed console would ungrab.).
- In order to get the above behaviour to work in full screen mode, full screen mode initialisation has been modified so that it asks the window manager to handle the window as a full screen window. To get the old behaviour set 'v_nowmfullscreen' to 1 (this will force it to grab the keyboard input too, regardless of 'in_grabkeyboard' or other conditions).


I've only tested it on Linux Mint 17.2, 64 bit.

  • Like 3
Link to comment
Share on other sites

Thanks for the patch! This would be something useful we could do for Windows users too.

 

Please open a bugtracker and attach the patch. Do we have any other Linux users building their own TDM right now who can confirm the fix? You can assign the tracker to me in the meantime. If no-one steps forward to build and test it immediately, we can still include it for testing in the next packaged version, which covers both platforms.

Link to comment
Share on other sites

  • 2 weeks later...

After some test, I've found that the games doesn't let go of the mouse when it loses focus due to alt tabbing, however, switching workspaces via the keyboard does work to force it to let go. It needs to be modified further so that it will let go of the mouse when it loses focus.

I've also tested it on Ubuntu 12.04 and it performs the same.

Link to comment
Share on other sites

Ok, shall I hold off on committing your patch until you say?

 

The only reason I didn't commit it right away is I couldn't test it myself. I was looking for another Linux user who builds their own to test it. But I haven't found a volunteer so we‘ll test it with the rest of 2.04, which will remove the "build it yourself" requirement.

Link to comment
Share on other sites

Even with the bug I've mentioned, I find being to alt-tab out of game immensely useful. So, in that respect I'm for putting the patch in as is, but I can certainly understand on holding off until it's of better quality.

 

Regardlees, I'll try and work on a better version of this patch as time permits.

Link to comment
Share on other sites

Okay, I've added 'in_grabmouse' to make the mouse grab behaviour like that of the keyboard's. This will fix the bug where it won't let go of the mouse on loss of focus.

 

It's not the proper fix where it grabs and ungrabs based on focus being gained and lost respectively, but it should work well enough for now. It might have problems if the mouse moves fast enough to escape the window before it moves the cursor back to center.

The diff is up on the bug tracker. #4190

Link to comment
Share on other sites

Thanks very much. To be clear, I was only waiting for the nod from you to say you'd done working on it for now.

 

The small chance of a bug in the circs you describe is much less impact than the current situation, that locks the mouse to the game all the time.

Link to comment
Share on other sites

  • 9 months later...
  • 2 weeks later...

Okay, I've added 'in_grabmouse' to make the mouse grab behaviour like that of the keyboard's. This will fix the bug where it won't let go of the mouse on loss of focus.

 

It's not the proper fix where it grabs and ungrabs based on focus being gained and lost respectively, but it should work well enough for now. It might have problems if the mouse moves fast enough to escape the window before it moves the cursor back to center.

 

The diff is up on the bug tracker. #4190

 

If you're on Windows, bringing down the console (CTRL+ALT+~) will allow the mouse to function as normal in Windows.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 4 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...