mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-06-24 05:38:49 -04:00
Lower process priority
This commit is contained in:
@@ -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 |
|
||||
\*-----------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user