File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -135,12 +135,33 @@ SDLBaseVideoSystem::create_sdl_window(Uint32 flags)
135
135
void
136
136
SDLBaseVideoSystem::apply_video_mode ()
137
137
{
138
+ const int displayidx = SDL_GetWindowDisplayIndex (m_sdl_window.get ());
139
+ if (displayidx < 0 )
140
+ {
141
+ log_warning << " Unable to get display index of window: "
142
+ << SDL_GetError () << std::endl;
143
+ return ;
144
+ }
145
+
146
+ SDL_DisplayMode display;
147
+ if (SDL_GetDesktopDisplayMode (displayidx, &display) != 0 )
148
+ {
149
+ log_warning << " Unable to get information for display number "
150
+ << displayidx << " : "
151
+ << SDL_GetError () << std::endl;
152
+ return ;
153
+ }
154
+
155
+ m_desktop_size.width = display.w ;
156
+ m_desktop_size.height = display.h ;
157
+
138
158
if (!g_config->use_fullscreen )
139
159
{
140
160
SDL_SetWindowFullscreen (m_sdl_window.get (), 0 );
141
161
142
162
Size window_size;
143
163
SDL_GetWindowSize (m_sdl_window.get (), &window_size.width , &window_size.height );
164
+
144
165
if (g_config->window_size != window_size)
145
166
{
146
167
SDL_SetWindowSize (m_sdl_window.get (), g_config->window_size .width , g_config->window_size .height );
You can’t perform that action at this time.
0 commit comments