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 | \*-----------------------------------------------------*/