Skip to content

Commit

Permalink
Apply extra workaround for ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Sep 24, 2023
1 parent ef256ac commit 6cee95a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Render/D3D/D3DRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,15 @@ int cD3DRender::Init(int xscr,int yscr,int Mode, SDL_Window* wnd, int RefreshRat

gb_RenderDevice3D = this;

//Workaround for Linux setting window bigger than originally requested
//Workaround for some distros (Ubuntu?) setting window bigger than originally requested
//Since Steam Linux Runtime is based on ubuntu it affects there too
if (sdl_window && (RenderMode & RENDERDEVICE_MODE_WINDOW)) {
//Set correct size
SDL_SetWindowSize(sdl_window, ScreenSize.x, ScreenSize.y);
//Put on center again
int screen = SDL_GetWindowDisplayIndex(sdl_window);
int windowPos = SDL_WINDOWPOS_CENTERED_DISPLAY(screen);
SDL_SetWindowPosition(sdlWindow, windowPos, windowPos);
}

RenderSubmitEvent(RenderEvent::INIT, "D3D9 end");
Expand Down

0 comments on commit 6cee95a

Please sign in to comment.