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:
@@ -296,6 +296,7 @@ void Handle_One_Event()
|
|||||||
adjust_window_mode();
|
adjust_window_mode();
|
||||||
}
|
}
|
||||||
flushingInput = false;
|
flushingInput = false;
|
||||||
|
redraw_screen(REFRESH_NONE);
|
||||||
mainPtr.display();
|
mainPtr.display();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -931,20 +931,14 @@ void cDialog::run(){
|
|||||||
// For whatever reason, delaying 100 milliseconds appears to fix this.
|
// For whatever reason, delaying 100 milliseconds appears to fix this.
|
||||||
sf::sleep(sf::milliseconds(100));
|
sf::sleep(sf::milliseconds(100));
|
||||||
win.create(sf::VideoMode(winRect.width(), winRect.height()), "Dialog", sf::Style::Titlebar);
|
win.create(sf::VideoMode(winRect.width(), winRect.height()), "Dialog", sf::Style::Titlebar);
|
||||||
win.setActive();
|
draw();
|
||||||
win.setVisible(true);
|
win.setVisible(true);
|
||||||
|
makeFrontWindow(parent ? parent-> win : mainPtr);
|
||||||
makeFrontWindow(win);
|
makeFrontWindow(win);
|
||||||
ModalSession dlog(win);
|
ModalSession dlog(win);
|
||||||
paintTimer.restart();
|
|
||||||
animTimer.restart();
|
animTimer.restart();
|
||||||
draw();
|
|
||||||
while(dialogNotToast){
|
while(dialogNotToast){
|
||||||
// TODO: This is just a hack to prevent the constant flickering.
|
draw();
|
||||||
// All it actually does is slow the flickering to non-blinding frequency.
|
|
||||||
if(paintTimer.getElapsedTime().asMilliseconds() > 500) {
|
|
||||||
draw();
|
|
||||||
paintTimer.restart();
|
|
||||||
}
|
|
||||||
dlog.pumpEvents();
|
dlog.pumpEvents();
|
||||||
if(!win.pollEvent(currentEvent)) continue;
|
if(!win.pollEvent(currentEvent)) continue;
|
||||||
location where;
|
location where;
|
||||||
|
Reference in New Issue
Block a user