From 8fee041fad272d481a05c64bcfb7a1c954247ee8 Mon Sep 17 00:00:00 2001 From: RedBlackAka Date: Mon, 22 Jun 2026 01:41:40 +0200 Subject: [PATCH] Lower process priority --- qt/OpenRGBDialog/OpenRGBDialog.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/qt/OpenRGBDialog/OpenRGBDialog.cpp b/qt/OpenRGBDialog/OpenRGBDialog.cpp index b6cad235f..923210d23 100644 --- a/qt/OpenRGBDialog/OpenRGBDialog.cpp +++ b/qt/OpenRGBDialog/OpenRGBDialog.cpp @@ -37,10 +37,15 @@ #include #include +#ifdef __linux__ +#include +#endif + #ifdef __APPLE__ #include "macutils.h" #endif + static int GetIcon(device_type type) { /*-----------------------------------------------------*\ @@ -188,6 +193,18 @@ OpenRGBDialog::OpenRGBDialog(QWidget *parent) : QMainWindow(parent), ui(new Ui:: { ui->setupUi(this); + /*-----------------------------------------------------*\ + | Lower process priority to potentially reduce | + | interference with other programs. Positive nice values| + | decrease priority on Linux | + \*-----------------------------------------------------*/ +#if defined(__linux__) || defined(__APPLE__) + setpriority(PRIO_PROCESS, 0, 10); +#endif +#ifdef _WIN32 + SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); +#endif + /*-----------------------------------------------------*\ | Set window icon | \*-----------------------------------------------------*/