Lower process priority

This commit is contained in:
RedBlackAka
2026-06-22 01:41:40 +02:00
committed by Adam Honse
parent dfc1f8524a
commit 8fee041fad

View File

@@ -37,10 +37,15 @@
#include <string>
#include <functional>
#ifdef __linux__
#include <sys/resource.h>
#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 |
\*-----------------------------------------------------*/