anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
47 stars 16 forks source link

Game crashes upon reentering from having cmd-tabbed out #506

Open VeryGoodDog opened 4 years ago

VeryGoodDog commented 4 years ago

Game Version: 1.12.14 Platform: Mac Modded: No

Description

Command + tab to move to another application defocuses the game window and upon reentering and typing some characters do not appear and some crash the game. The characters appear to be those that are part of cmd-key hotkeys. I suspect this is because the game registers the command key being pressed then when the tab key is pressed it loses focus and doesn't detect the command key being released.

How to reproduce

  1. Press cmd-tab to exit game window.
  2. Open chat and press v.

Logs

Version: v1.12.14 (Stable)4/12/2020 9:50:43 AM: Critical error occurred
System.NullReferenceException: Object reference not set to an instance of an object
  at Vintagestory.API.Client.GuiElementEditableTextBase.OnKeyDown (Vintagestory.API.Client.ICoreClientAPI api, Vintagestory.API.Client.KeyEvent args) [0x00170] in <97f87400996549bcaa796080030a18a5>:0 
  at Vintagestory.API.Client.GuiComposer.OnKeyDown (Vintagestory.API.Client.KeyEvent args, System.Boolean haveFocus) [0x0001a] in <97f87400996549bcaa796080030a18a5>:0 
  at Vintagestory.API.Client.GuiDialog.OnKeyDown (Vintagestory.API.Client.KeyEvent args) [0x00019] in <97f87400996549bcaa796080030a18a5>:0 
  at Vintagestory.Client.NoObf.HudDialogChat.OnKeyDown (Vintagestory.API.Client.KeyEvent args) [0x003d4] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
  at _poIApIdgKznG7HGgMZNS4oA51Vm._Oy0GkyuVXem6XhfdpqRkRihlAWE (Vintagestory.API.Client.KeyEvent ) [0x000c5] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
  at _hLaepLRCOckdCEvZTPp1GxfgrdT._Oy0GkyuVXem6XhfdpqRkRihlAWE (Vintagestory.API.Client.KeyEvent ) [0x0007f] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
  at _wbw3WsD1ic8cZIS5Ql2MkIqPWmb._Oy0GkyuVXem6XhfdpqRkRihlAWE (Vintagestory.API.Client.KeyEvent ) [0x00000] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
  at _s54YxMQ8l5DBeihbmw81nJkPTSU._Oy0GkyuVXem6XhfdpqRkRihlAWE (Vintagestory.API.Client.KeyEvent ) [0x0006e] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
  at Vintagestory.Client.NoObf.ClientPlatformWindows.game_KeyDown (System.Object sender, OpenTK.Input.KeyboardKeyEventArgs e) [0x00082] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
  at (wrapper delegate-invoke) System.EventHandler`1[OpenTK.Input.KeyboardKeyEventArgs].invoke_void_object_TEventArgs(object,OpenTK.Input.KeyboardKeyEventArgs)
  at OpenTK.NativeWindow.OnKeyDown (OpenTK.Input.KeyboardKeyEventArgs e) [0x00000] in <7ef43334b29e406ba375449554b0451a>:0 
  at OpenTK.NativeWindow.OnKeyDownInternal (System.Object sender, OpenTK.Input.KeyboardKeyEventArgs e) [0x00000] in <7ef43334b29e406ba375449554b0451a>:0 
  at (wrapper delegate-invoke) System.EventHandler`1[OpenTK.Input.KeyboardKeyEventArgs].invoke_void_object_TEventArgs(object,OpenTK.Input.KeyboardKeyEventArgs)
  at OpenTK.Platform.NativeWindowBase.OnKeyDown (OpenTK.Input.Key key, System.Boolean repeat) [0x0002e] in <7ef43334b29e406ba375449554b0451a>:0 
  at OpenTK.Platform.MacOS.CocoaNativeWindow.ProcessEvents () [0x000d7] in <7ef43334b29e406ba375449554b0451a>:0 
  at OpenTK.NativeWindow.ProcessEvents (System.Boolean retainEvents) [0x00035] in <7ef43334b29e406ba375449554b0451a>:0 
  at OpenTK.NativeWindow.ProcessEvents () [0x00000] in <7ef43334b29e406ba375449554b0451a>:0 
  at OpenTK.GameWindow.Run (System.Double updates_per_second, System.Double frames_per_second) [0x000da] in <7ef43334b29e406ba375449554b0451a>:0 
  at OpenTK.GameWindow.Run () [0x00000] in <7ef43334b29e406ba375449554b0451a>:0 
  at _gilSYm6aSzOct8TKUm64HAM8OHp._tyidesQGCE1oKHv8YEo8HwYCSty (_RxGTCHor7fqeGRNMEH5pZVfBHHK , System.String[] ) [0x00342] in <701c01ef14634430872060429f1d21c2>:0 
  at _gilSYm6aSzOct8TKUm64HAM8OHp+_6eMaTe2Mm7x9arQAXqYqer2f92b._9FxIL4yW4T9qebkEnphf1OK8WKC () [0x00000] in <701c01ef14634430872060429f1d21c2>:0 
  at _xmrDk9pogtvR6xvbzmBc2dtFsbu._tyidesQGCE1oKHv8YEo8HwYCSty (System.Threading.ThreadStart ) [0x00007] in <2d6eef6f99694be1be89f6f6b9c7766e>:0 
-------------------------------
copygirl commented 4 years ago

I have not noticed this being an issue on Linux so I will just assume it has something to do with poor MacOS support in OpenTK.

VeryGoodDog commented 4 years ago

I have not noticed this being an issue on Linux so I will just assume it has something to do with poor MacOS support in OpenTK.

I assumed something like that, does Linux even have a cmd+tab function?

copygirl commented 4 years ago

I assumed something like that, does Linux even have a cmd+tab function?

Many window managers have a similar function, often bound to Alt+Tab (like Windows).