Skip to content

Commit

Permalink
Fix preferences not recentering on resolution switch
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Mar 21, 2016
1 parent 2449dcf commit e805a38
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/events.cpp
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/events.hpp
Expand Up @@ -116,6 +116,7 @@ class pump_monitor {
};

void raise_process_event();
void raise_resize_event();
void raise_draw_event();
void raise_draw_all_event();
void raise_volatile_draw_event();
Expand Down
1 change: 1 addition & 0 deletions src/gui/dialogs/preferences_dialog.cpp
Expand Up @@ -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());
}

Expand Down

0 comments on commit e805a38

Please sign in to comment.