steamcompmgr: make cursor hide time configurable, -C in ms

This commit is contained in:
Pierre-Loup A. Griffais 2021-03-24 20:35:33 -07:00
parent 8f9a284d32
commit 5936baa865
2 changed files with 7 additions and 4 deletions

View file

@ -68,7 +68,7 @@ int main(int argc, char **argv)
bool bSleepAtStartup = false; bool bSleepAtStartup = false;
while ((o = getopt (argc, argv, ":R:T:w:h:W:H:r:o:NFSvVecsdlnbf")) != -1) while ((o = getopt (argc, argv, ":R:T:C:w:h:W:H:r:o:NFSvVecsdlnbf")) != -1)
{ {
switch (o) { switch (o) {
case 'w': case 'w':

View file

@ -184,7 +184,7 @@ bool hasRepaint = false;
unsigned long damageSequence = 0; unsigned long damageSequence = 0;
#define CURSOR_HIDE_TIME 10'000 unsigned int cursorHideTime = 10'000;
Bool gotXError = False; Bool gotXError = False;
@ -705,7 +705,7 @@ void MouseCursor::checkSuspension()
m_lastMovedTime = get_time_in_milliseconds(); m_lastMovedTime = get_time_in_milliseconds();
} }
const bool suspended = get_time_in_milliseconds() - m_lastMovedTime > CURSOR_HIDE_TIME; const bool suspended = get_time_in_milliseconds() - m_lastMovedTime > cursorHideTime;
if (!m_hideForMovement && suspended) { if (!m_hideForMovement && suspended) {
m_hideForMovement = true; m_hideForMovement = true;
@ -2737,7 +2737,7 @@ steamcompmgr_main (int argc, char **argv)
// :/ // :/
optind = 1; optind = 1;
while ((o = getopt (argc, argv, ":R:T:w:h:W:H:r:o:NFSvVecsdlnbf")) != -1) while ((o = getopt (argc, argv, ":R:T:C:w:h:W:H:r:o:NFSvVecsdlnbf")) != -1)
{ {
switch (o) { switch (o) {
case 'R': case 'R':
@ -2751,6 +2751,9 @@ steamcompmgr_main (int argc, char **argv)
statsThreads.detach(); statsThreads.detach();
} }
break; break;
case 'C':
cursorHideTime = atoi( optarg );
break;
case 'N': case 'N':
doRender = False; doRender = False;
break; break;