mattiasgustavsson / dos-like

Engine for making things with a MS-DOS feel, but for modern platforms
Other
1k stars 49 forks source link

Crashes on Linux/Xorg #7

Closed thp closed 3 years ago

thp commented 3 years ago

This crashes on Linux for me (using a Xorg session, not Wayland), the issue seems unrelated to #2:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  40 (X_TranslateCoords)
  Resource id in failed request:  0x6005c9
  Serial number of failed request:  270
  Current serial number in output stream:  270

Commenting out SDL_HideWindow( app->window ); in dos.h fixed the issue for me, but not sure if it's a reasonable fix.

mattiasgustavsson commented 3 years ago

I don't consider the SDL_HideWindow call to be essential - it is just there to avoid having the window show up briefly with its initial dimensions, just to be immediately resized to dimensions set by the user code. But it is a minor cosmetic details, so I'd be fine with commenting out SDL_HideWindow for a fix

thp commented 3 years ago

I haven't tested if it works (but assume it should), but you can pass in SDL_WINDOW_HIDDEN as a flag to SDL_CreateWindow() instead of creating it visible first and then immediately hiding it.

mattiasgustavsson commented 3 years ago

That sounds great, yes, will do that

mattiasgustavsson commented 3 years ago

Hopefully this should be fixed now, so closing the issue for now