Fix the dialog flickering, and attempt to partially fix the issue of a dialog being momentarily drawn into the main window after it is closed

This commit is contained in:
2014-12-12 12:15:39 -05:00
parent 0b15937bb9
commit f1660cf7ed
2 changed files with 4 additions and 9 deletions

View File

@@ -296,6 +296,7 @@ void Handle_One_Event()
adjust_window_mode();
}
flushingInput = false;
redraw_screen(REFRESH_NONE);
mainPtr.display();
return;
}

View File

@@ -931,20 +931,14 @@ void cDialog::run(){
// For whatever reason, delaying 100 milliseconds appears to fix this.
sf::sleep(sf::milliseconds(100));
win.create(sf::VideoMode(winRect.width(), winRect.height()), "Dialog", sf::Style::Titlebar);
win.setActive();
draw();
win.setVisible(true);
makeFrontWindow(parent ? parent-> win : mainPtr);
makeFrontWindow(win);
ModalSession dlog(win);
paintTimer.restart();
animTimer.restart();
draw();
while(dialogNotToast){
// TODO: This is just a hack to prevent the constant flickering.
// All it actually does is slow the flickering to non-blinding frequency.
if(paintTimer.getElapsedTime().asMilliseconds() > 500) {
draw();
paintTimer.restart();
}
draw();
dlog.pumpEvents();
if(!win.pollEvent(currentEvent)) continue;
location where;