hiro/qt: Add #if guards to X11 code

This is a backport from ares:
b85395fe7b

Co-authored-by: invertego <invertego@users.noreply.github.com>
This commit is contained in:
John Chadwick
2025-09-01 19:26:14 -04:00
committed by Screwtapello
parent ec8aed3f3b
commit f83bc75270
2 changed files with 4 additions and 0 deletions

2
hiro/qt/application.cpp Executable file → Normal file
View File

@@ -34,6 +34,7 @@ auto pApplication::quit() -> void {
QApplication::quit();
qtApplication = nullptr; //note: deleting QApplication will crash libQtGui
#if defined(DISPLAY_XORG)
if(state().display) {
if(state().screenSaverXDG && state().screenSaverWindow) {
//this needs to run synchronously, so that XUnmapWindow() won't happen before xdg-screensaver is finished
@@ -44,6 +45,7 @@ auto pApplication::quit() -> void {
XCloseDisplay(state().display);
state().display = nullptr;
}
#endif
}
auto pApplication::setScreenSaver(bool screenSaver) -> void {

2
hiro/qt/header.hpp Executable file → Normal file
View File

@@ -3,6 +3,7 @@
#include <QtWidgets>
#undef foreach
#if defined(DISPLAY_XORG)
#include <nall/xorg/guard.hpp>
#define XK_MISCELLANY
#define XK_LATIN1
@@ -11,3 +12,4 @@
#undef XK_MISCELLANY
#undef XK_LATIN1
#include <nall/xorg/guard.hpp>
#endif