@ -9,7 +9,7 @@
# ifdef __APPLE__
# ifdef __APPLE__
# include <unistd.h> // for chdir
# include <unistd.h> // for chdir
# endif
# endif
# ifdef __ linu x__
# ifdef __ uni x__
# include <csignal>
# include <csignal>
# include <sys/socket.h>
# include <sys/socket.h>
# endif
# endif
@ -275,7 +275,7 @@ static void OverrideWindowsFont() {
# endif
# endif
bool GMainWindow : : CheckDarkMode ( ) {
bool GMainWindow : : CheckDarkMode ( ) {
# ifdef __ linu x__
# ifdef __ uni x__
const QPalette test_palette ( qApp - > palette ( ) ) ;
const QPalette test_palette ( qApp - > palette ( ) ) ;
const QColor text_color = test_palette . color ( QPalette : : Active , QPalette : : Text ) ;
const QColor text_color = test_palette . color ( QPalette : : Active , QPalette : : Text ) ;
const QColor window_color = test_palette . color ( QPalette : : Active , QPalette : : Window ) ;
const QColor window_color = test_palette . color ( QPalette : : Active , QPalette : : Window ) ;
@ -283,7 +283,7 @@ bool GMainWindow::CheckDarkMode() {
# else
# else
// TODO: Windows
// TODO: Windows
return false ;
return false ;
# endif // __ linu x__
# endif // __ uni x__
}
}
GMainWindow : : GMainWindow ( std : : unique_ptr < Config > config_ , bool has_broken_vulkan )
GMainWindow : : GMainWindow ( std : : unique_ptr < Config > config_ , bool has_broken_vulkan )
@ -291,7 +291,7 @@ GMainWindow::GMainWindow(std::unique_ptr<Config> config_, bool has_broken_vulkan
input_subsystem { std : : make_shared < InputCommon : : InputSubsystem > ( ) } , config { std : : move ( config_ ) } ,
input_subsystem { std : : make_shared < InputCommon : : InputSubsystem > ( ) } , config { std : : move ( config_ ) } ,
vfs { std : : make_shared < FileSys : : RealVfsFilesystem > ( ) } ,
vfs { std : : make_shared < FileSys : : RealVfsFilesystem > ( ) } ,
provider { std : : make_unique < FileSys : : ManualContentProvider > ( ) } {
provider { std : : make_unique < FileSys : : ManualContentProvider > ( ) } {
# ifdef __ linu x__
# ifdef __ uni x__
SetupSigInterrupts ( ) ;
SetupSigInterrupts ( ) ;
# endif
# endif
system - > Initialize ( ) ;
system - > Initialize ( ) ;
@ -509,7 +509,7 @@ GMainWindow::~GMainWindow() {
delete render_window ;
delete render_window ;
}
}
# ifdef __ linu x__
# ifdef __ uni x__
: : close ( sig_interrupt_fds [ 0 ] ) ;
: : close ( sig_interrupt_fds [ 0 ] ) ;
: : close ( sig_interrupt_fds [ 1 ] ) ;
: : close ( sig_interrupt_fds [ 1 ] ) ;
# endif
# endif
@ -1379,7 +1379,7 @@ void GMainWindow::OnDisplayTitleBars(bool show) {
}
}
void GMainWindow : : SetupPrepareForSleep ( ) {
void GMainWindow : : SetupPrepareForSleep ( ) {
# ifdef __ linu x__
# ifdef __ uni x__
auto bus = QDBusConnection : : systemBus ( ) ;
auto bus = QDBusConnection : : systemBus ( ) ;
if ( bus . isConnected ( ) ) {
if ( bus . isConnected ( ) ) {
const bool success = bus . connect (
const bool success = bus . connect (
@ -1393,7 +1393,7 @@ void GMainWindow::SetupPrepareForSleep() {
} else {
} else {
LOG_WARNING ( Frontend , " QDBusConnection system bus is not connected " ) ;
LOG_WARNING ( Frontend , " QDBusConnection system bus is not connected " ) ;
}
}
# endif // __ linu x__
# endif // __ uni x__
}
}
void GMainWindow : : OnPrepareForSleep ( bool prepare_sleep ) {
void GMainWindow : : OnPrepareForSleep ( bool prepare_sleep ) {
@ -1415,7 +1415,7 @@ void GMainWindow::OnPrepareForSleep(bool prepare_sleep) {
}
}
}
}
# ifdef __ linu x__
# ifdef __ uni x__
static std : : optional < QDBusObjectPath > HoldWakeLockLinux ( u32 window_id = 0 ) {
static std : : optional < QDBusObjectPath > HoldWakeLockLinux ( u32 window_id = 0 ) {
if ( ! QDBusConnection : : sessionBus ( ) . isConnected ( ) ) {
if ( ! QDBusConnection : : sessionBus ( ) . isConnected ( ) ) {
return { } ;
return { } ;
@ -1500,14 +1500,14 @@ void GMainWindow::OnSigInterruptNotifierActivated() {
emit SigInterrupt ( ) ;
emit SigInterrupt ( ) ;
}
}
# endif // __ linu x__
# endif // __ uni x__
void GMainWindow : : PreventOSSleep ( ) {
void GMainWindow : : PreventOSSleep ( ) {
# ifdef _WIN32
# ifdef _WIN32
SetThreadExecutionState ( ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED ) ;
SetThreadExecutionState ( ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED ) ;
# elif defined(HAVE_SDL2)
# elif defined(HAVE_SDL2)
SDL_DisableScreenSaver ( ) ;
SDL_DisableScreenSaver ( ) ;
# ifdef __ linu x__
# ifdef __ uni x__
auto reply = HoldWakeLockLinux ( winId ( ) ) ;
auto reply = HoldWakeLockLinux ( winId ( ) ) ;
if ( reply ) {
if ( reply ) {
wake_lock = std : : move ( reply . value ( ) ) ;
wake_lock = std : : move ( reply . value ( ) ) ;
@ -1521,7 +1521,7 @@ void GMainWindow::AllowOSSleep() {
SetThreadExecutionState ( ES_CONTINUOUS ) ;
SetThreadExecutionState ( ES_CONTINUOUS ) ;
# elif defined(HAVE_SDL2)
# elif defined(HAVE_SDL2)
SDL_EnableScreenSaver ( ) ;
SDL_EnableScreenSaver ( ) ;
# ifdef __ linu x__
# ifdef __ uni x__
if ( ! wake_lock . path ( ) . isEmpty ( ) ) {
if ( ! wake_lock . path ( ) . isEmpty ( ) ) {
ReleaseWakeLockLinux ( wake_lock ) ;
ReleaseWakeLockLinux ( wake_lock ) ;
}
}
@ -4070,7 +4070,7 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
}
}
void GMainWindow : : changeEvent ( QEvent * event ) {
void GMainWindow : : changeEvent ( QEvent * event ) {
# ifdef __ linu x__
# ifdef __ uni x__
// PaletteChange event appears to only reach so far into the GUI, explicitly asking to
// PaletteChange event appears to only reach so far into the GUI, explicitly asking to
// UpdateUITheme is a decent work around
// UpdateUITheme is a decent work around
if ( event - > type ( ) = = QEvent : : PaletteChange ) {
if ( event - > type ( ) = = QEvent : : PaletteChange ) {
@ -4085,7 +4085,7 @@ void GMainWindow::changeEvent(QEvent* event) {
}
}
last_window_color = window_color ;
last_window_color = window_color ;
}
}
# endif // __ linu x__
# endif // __ uni x__
QWidget : : changeEvent ( event ) ;
QWidget : : changeEvent ( event ) ;
}
}