184 void
185 MIR_SetWindowFullscreen(_THIS, SDL_Window* window,
186 SDL_VideoDisplay* display,
187 SDL_bool fullscreen)
188 {
189 MIR_Data* mir_data = _this->driverdata;
190 MIR_Window* mir_window = window->driverdata;
191 MirSurfaceSpec* spec;
192 MirSurfaceState state;
193
194 if (IsSurfaceValid(mir_window) < 0)
195 return;
196
197 if (fullscreen) {
198 SDL_Log("slvn MIR_SetWindowFullscreen ON");
199 state = mir_surface_state_fullscreen;
200 } else {
201 SDL_Log("slvn MIR_SetWindowFullscreen OFF");
202 state = mir_surface_state_restored;
203
204 SDL_Log("... forcing to ON");
205 state = mir_surface_state_fullscreen;
206 }
207
208 spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
209 MIR_mir_surface_spec_set_state(spec, state);
210
211 {
212
213 SDL_Log("... done");
214 MIR_mir_wait_for(MIR_mir_surface_set_state(mir_window->surface,state));
215 SDL_Log("... wait done");
216 }
217
218
219 MIR_mir_surface_apply_spec(mir_window->surface, spec);
220 MIR_mir_surface_spec_release(spec);
221
222 {
223
224 SDL_Log("... done");
225 MIR_mir_wait_for(MIR_mir_surface_set_state(mir_window->surface,state));
226 SDL_Log("... wait done");
227 }
228
229
230 }