Skip to content

Commit

Permalink
Qt: Work around a couple of Linux issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 19, 2024
1 parent 76208f5 commit f83cbbd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
8 changes: 7 additions & 1 deletion src/duckstation-qt/debuggerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,13 @@ void DebuggerWindow::setupAdditionalUi()
fixedFont.setStyleHint(QFont::TypeWriter);
fixedFont.setPointSize(10);
#else
const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);

#ifdef __linux__
// Fonts on Linux tend to be wider, so reduce the size.
// Otherwise the memory view gets cut off.
fixedFont.setPointSize(9);
#endif
#endif
m_ui.codeView->setFont(fixedFont);
m_ui.registerView->setFont(fixedFont);
Expand Down
21 changes: 12 additions & 9 deletions src/duckstation-qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,11 @@ void MainWindow::recreate()

// Recreate log window as well. Then make sure we're still on top.
LogWindow::updateSettings();
new_main_window->raise();
new_main_window->activateWindow();

// Qt+XCB will ignore the raise request of the settings window if we raise the main window.
// So skip that if we're going to be re-opening the settings window.
if (!settings_window_pos.has_value())
QtUtils::ShowOrRaiseWindow(new_main_window);

// Reload the sources we just closed.
g_emu_thread->reloadInputSources();
Expand All @@ -762,18 +765,18 @@ void MainWindow::recreate()
g_main_window->onFullscreenUIStateChange(g_emu_thread->isRunningFullscreenUI());
}

if (settings_window_pos.has_value())
{
SettingsWindow* dlg = g_main_window->getSettingsWindow();
dlg->move(settings_window_pos.value());
dlg->setCategoryRow(settings_window_row);
QtUtils::ShowOrRaiseWindow(dlg);
}
if (controller_settings_window_pos.has_value())
{
ControllerSettingsWindow* dlg = g_main_window->getControllerSettingsWindow();
dlg->move(controller_settings_window_pos.value());
dlg->setCategory(controller_settings_window_row);
dlg->show();
}
if (settings_window_pos.has_value())
{
SettingsWindow* dlg = g_main_window->getSettingsWindow();
dlg->move(settings_window_pos.value());
dlg->setCategoryRow(settings_window_row);
QtUtils::ShowOrRaiseWindow(dlg);
}
}
Expand Down

0 comments on commit f83cbbd

Please sign in to comment.