Fix temporary screencapture showing phantom windows

* Fix #9200
This commit is contained in:
Jonathan White 2023-03-05 22:43:34 -05:00
parent 988bb9c1cd
commit c112ffc3fc
2 changed files with 5 additions and 2 deletions

View File

@ -36,6 +36,7 @@ DatabaseOpenDialog::DatabaseOpenDialog(QWidget* parent)
{ {
setWindowTitle(tr("Unlock Database - KeePassXC")); setWindowTitle(tr("Unlock Database - KeePassXC"));
setWindowFlags(Qt::Dialog); setWindowFlags(Qt::Dialog);
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
// Linux requires this to overcome some Desktop Environments (also no Quick Unlock) // Linux requires this to overcome some Desktop Environments (also no Quick Unlock)
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);

View File

@ -1663,9 +1663,11 @@ void MainWindow::applySettingsChanges()
void MainWindow::setAllowScreenCapture(bool state) void MainWindow::setAllowScreenCapture(bool state)
{ {
m_allowScreenCapture = state; m_allowScreenCapture = state;
for (auto window : qApp->allWindows()) { for (auto window : qApp->topLevelWindows()) {
if (window->isVisible()) {
osUtils->setPreventScreenCapture(window, !m_allowScreenCapture); osUtils->setPreventScreenCapture(window, !m_allowScreenCapture);
} }
}
m_ui->actionAllowScreenCapture->blockSignals(true); m_ui->actionAllowScreenCapture->blockSignals(true);
m_ui->actionAllowScreenCapture->setChecked(m_allowScreenCapture); m_ui->actionAllowScreenCapture->setChecked(m_allowScreenCapture);
m_ui->actionAllowScreenCapture->blockSignals(false); m_ui->actionAllowScreenCapture->blockSignals(false);