Fix preferences not recentering on resolution switch
This commit is contained in:
parent
2449dcf65b
commit
e805a38735
3 changed files with 14 additions and 0 deletions
|
@ -546,6 +546,18 @@ void raise_process_event()
|
|||
}
|
||||
}
|
||||
|
||||
void raise_resize_event()
|
||||
{
|
||||
SDL_Event event;
|
||||
event.window.type = SDL_WINDOWEVENT;
|
||||
event.window.event = SDL_WINDOWEVENT_RESIZED;
|
||||
event.window.windowID = 0; // We don't check this anyway... I think...
|
||||
event.window.data1 = CVideo::get_singleton().getx();
|
||||
event.window.data2 = CVideo::get_singleton().gety();
|
||||
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
void raise_draw_event()
|
||||
{
|
||||
if(event_contexts.empty() == false) {
|
||||
|
|
|
@ -116,6 +116,7 @@ public:
|
|||
};
|
||||
|
||||
void raise_process_event();
|
||||
void raise_resize_event();
|
||||
void raise_draw_event();
|
||||
void raise_draw_all_event();
|
||||
void raise_volatile_draw_event();
|
||||
|
|
|
@ -1236,6 +1236,7 @@ void tpreferences::handle_res_select(twindow& window)
|
|||
}
|
||||
|
||||
window.video().set_resolution(resolutions_[static_cast<size_t>(choice)]);
|
||||
events::raise_resize_event();
|
||||
set_resolution_list(res_list, window.video());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue