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 f95be93
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Source/Render/D3D/D3DRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,19 @@ 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)) {
SDL_SetWindowSize(sdl_window, ScreenSize.x, ScreenSize.y);
Vect2i size;
SDL_GetWindowSize(sdl_window, &size.x, &size.y);
if (size != ScreenSize) {
//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 f95be93

Please sign in to comment.