7

When playing Minecraft in fullscreen, if another application takes focus, or a desktop notification appears, Minecraft "minimizes" but still has control of my mouse. My keyboard works fine, applications keep running, and I can even move my mouse, but mouse clicks don't register. The only options I've found are to...

a) Regain Minecraft's focus with a hotkey (Super + number key; the same as clicking an icon in the launcher). The problem with this is that if the Minecraft icon is too far down the launcher, there's no hotkey to launch it.

b) Kill the application. Since my keyboard still works, I can hit Alt + F2 and killall java without much hassle. The cons of this method are obvious.

So I need two solutions:

  • How do I prevent this from happening?

  • How do I more reliably give the focus back to my Minecraft (java) process should this happen again, without relying on it being higher up on my launcher?

I don't have any issues running Minecraft in a window, even if it's been maximized by clicking the square icon.

  • This sounds like a bug with Minecraft. Whenever another app takes focus, the Minecraft window will usually pause (or, at least it does for me). – Kaz Wolfe Oct 7 '15 at 7:52
  • @Whaaaaaat It does pause (when I give it back focus it's paused), but the mouse clicks still don't register. Maybe it was a mistake to say it still controls the mouse, since I can move it. – Trae Oct 7 '15 at 7:59
  • 1
    Can't you just alt tab to the MC window? – TheWanderer Aug 20 '16 at 21:37
2

wmctrl tool provides command line access to window manager (not installed by default, the package is named wmctrl). The -a flag permits a user to Activate the window by switching to its desktop and raising it. (Note that you can find the window name with -f option)

$ wmctrl -l
0x01600007 -1 hostname Desktop
0x04200002  0 hostname mouse - What do I do when Minecraft in fullscreen loses focus? - Ask Ubuntu - Google Chrome
0x03200007  0 hostname Terminal
0x03e00015  0 hostname Minecraft 1.10.2
$ wmctrl -a "Minecraft 1.10"

Thus a complete recipe could be

  • Switch to virtual console Ctrl+Alt+F1
  • Login
  • DISPLAY=:0 wmctrl -a "Minecraft 1.10"
  • Switch to x server console Ctrl+Alt+F7 (or F8)

See this other answer for more details on wmctrl.

| improve this answer | |
0

@Whaaaaat is correct. This is a bug with minecraft. A quick workaround is to press Alt+Tab and navigate back to Minecraft.

Another workaround would be to pin Minecraft at the top of the launcher.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.