mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-01-17 20:58:28 +01:00
Fix QT pWindow::setModal
As in higan, not my code.
This commit is contained in:
parent
1ebed1701a
commit
882e5d292f
@ -193,10 +193,11 @@ auto pWindow::setMinimumSize(Size size) -> void {
|
|||||||
|
|
||||||
auto pWindow::setModal(bool modal) -> void {
|
auto pWindow::setModal(bool modal) -> void {
|
||||||
if(modal) {
|
if(modal) {
|
||||||
//windowModality can only be enabled while window is invisible
|
bool isVisible = qtWindow->isVisible();
|
||||||
setVisible(false);
|
if(isVisible) setVisible(false);
|
||||||
qtWindow->setWindowModality(Qt::ApplicationModal);
|
qtWindow->setWindowModality(Qt::ApplicationModal);
|
||||||
setVisible(true);
|
if(isVisible) setVisible(true);
|
||||||
|
|
||||||
while(!Application::state().quit && state().modal) {
|
while(!Application::state().quit && state().modal) {
|
||||||
if(Application::state().onMain) {
|
if(Application::state().onMain) {
|
||||||
Application::doMain();
|
Application::doMain();
|
||||||
@ -205,7 +206,11 @@ auto pWindow::setModal(bool modal) -> void {
|
|||||||
}
|
}
|
||||||
Application::processEvents();
|
Application::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isVisible = qtWindow->isVisible();
|
||||||
|
if(isVisible) setVisible(false);
|
||||||
qtWindow->setWindowModality(Qt::NonModal);
|
qtWindow->setWindowModality(Qt::NonModal);
|
||||||
|
if(isVisible) setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user