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
205 spec = MIR_mir_connection_create_spec_for_changes(mir_data->connection);
206 SDL_Log("Before SPEC mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen is ... %d", (MIR_mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen));
207 MIR_mir_surface_spec_set_state(spec, state);
208 MIR_mir_surface_apply_spec(mir_window->surface, spec);
209 MIR_mir_surface_spec_release(spec);
210 SDL_Log("After SPEC mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen is ... %d", (MIR_mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen));
211
212 SDL_Log("Before NO_SPEC mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen is ... %d", (MIR_mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen));
213 {
214 SDL_Log("Apply to surface without wait for");
215 MIR_mir_wait_for(MIR_mir_surface_set_state(mir_window->surface,state));
216 }
217 SDL_Log("After NO_SPEC mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen is ... %d", (MIR_mir_surface_get_state(mir_window->surface) == mir_surface_state_fullscreen));
218
219
220 }