Skip to content

client (Unix): add support for idle detection in a separate process#6242

Merged
davidpanderson merged 11 commits intomasterfrom
dpa_idle_time2
Apr 12, 2026
Merged

client (Unix): add support for idle detection in a separate process#6242
davidpanderson merged 11 commits intomasterfrom
dpa_idle_time2

Conversation

@davidpanderson
Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings April 11, 2025 21:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread client/hostinfo_unix.cpp Outdated
Comment thread client/hostinfo_unix.cpp Outdated
…ction.

shm_open() and mmap() are the standard way to do this.

This requires -lrt.
I just added this to Makefile.am; probably not the right way.
@jamescowens
Copy link
Copy Markdown

jamescowens commented Apr 12, 2025

@davidpanderson do you mind making these signed 64 bit ints instead of unsigned so that we conform to the new time standard?

POSIX requires time to be a signed int. The complete spec in <time.h> is actually

struct timespec {
    time_t   tv_sec;        /* seconds */
    long     tv_nsec;       /* nanoseconds */
};

Where time_t is typedefd internally in the header file to a 64 bit signed integer type on that platform.

We obviously don't need the nanoseconds part for this so just using the 64 bit signed integer is perfectly fine.

@davidpanderson
Copy link
Copy Markdown
Contributor Author

Uh, sure.

@AenBleidd
Copy link
Copy Markdown
Member

This PR fails during the build for Android:

hostinfo_unix.cpp:567:52: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
            strlcpy(buf2, strchr(buf, ':') + 2, ((t<sizeof(buf2))?t:sizeof(buf2)));
                                                  ~^~~~~~~~~~~~~
hostinfo_unix.cpp:2219:18: error: use of undeclared identifier 'shm_open'
        int fd = shm_open("/idle_detect_shmem",  O_RDONLY, 0);
                 ^
1 warning and 1 error generated.

@davidpanderson
Copy link
Copy Markdown
Contributor Author

fixed (I hope)

- include -lcrypto after -lssl
- include -lrt only if it exists
Don't use xss detection on Wayland.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Copilot AI review requested due to automatic review settings April 12, 2026 04:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/hostinfo_unix.cpp Outdated
Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp Outdated
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Copilot AI review requested due to automatic review settings April 12, 2026 05:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp
Comment thread client/hostinfo_unix.cpp
@AenBleidd
Copy link
Copy Markdown
Member

AenBleidd commented Apr 12, 2026

@davidpanderson, please review and merge if it looks fine to you.
I have tested new idle detection mechanism, and it looks like it works as expected.

@davidpanderson davidpanderson merged commit cde0ce5 into master Apr 12, 2026
433 checks passed
@davidpanderson davidpanderson deleted the dpa_idle_time2 branch April 12, 2026 20:47
@github-project-automation github-project-automation bot moved this from In progress to Merged in Client/Manager Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment