profanity icon indicating copy to clipboard operation
profanity copied to clipboard

Idle detection via xscreensaver does not work

Open lynix opened this issue 3 years ago • 5 comments

Expected Behavior

Status is set to 'away' when mouse movements are stopped longer than autoaway.awaytime seconds and back to 'online' once mouse is moved again.

Current Behavior

Status is set to 'away' after configured timeout but not restored to 'online' if mouse is moved. It is restored to 'online' once commands are typed.

Possible Solution

I have noticed that neither the binary nor the library is linked against libXss.so, which should be the case with --with-xscreensaver being supplied to configure.

Checking configure.log I found xscrnsaver_LIBS='-lXss ' so the configure stage seems to have found the library via pkgconf, but somehow that library does not make it into LIBS.

Unfortunately I don't know enough about autoconf/automake to trace this further down. Could it be a side effect of 28a9605a?

Steps to Reproduce (for bugs)

  1. build and install Profanity (with --with-xscreensaver, see below)
  2. enable autoaway

Environment

Output of profanity -v:

Profanity, version 0.12.1
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 - 2021 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.17.1)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.10.4)
GTK icons/clipboard: Enabled

Arguments to configure from Arch Linux package:

./configure \
      --prefix=/usr \
      --enable-icons-and-clipboard \
      --with-xscreensaver \
      --enable-notifications \
      --enable-python-plugins \
      --enable-c-plugins \
      --enable-plugins \
      --enable-otr \
      --enable-omemo \
      --enable-pgp

lynix avatar Apr 21 '22 08:04 lynix

Hmm could indeed be a regression in 0.12.x that occurred from our build files cleanup.

Can you test with an earlier version and see if it works there?

jubalh avatar Apr 21 '22 08:04 jubalh

Sure, just tested with an old package and I can confirm that the issue is not present with 0.11.1.

lynix avatar Apr 21 '22 09:04 lynix

@lynix please test latest master.

jubalh avatar Apr 21 '22 10:04 jubalh

I have modified the Arch PKGBUILD to include b4857c60 as a patch against 0.12.1. I can see that libprofanity.so is now linked against libXss.so while the executable is not.

Unfortunately the issue is still present, status is set to 'away' but not back.

I'll try to build a package from master and see if that makes a difference.

lynix avatar Apr 22 '22 05:04 lynix

Same results with master version, status set to 'away' no matter if I move the mouse or not.

lynix avatar Apr 22 '22 05:04 lynix

So the issue is still present with 0.13.1, anything I can do to help getting this fixed?

lynix avatar Jan 10 '23 08:01 lynix

Sorry, I don't use a screensaver myself which is why this was not high prio for me.

I also see that @paulfertser made some changes to the configure to try to fix this (thanks again).

I have modified the Arch PKGBUILD to include https://github.com/profanity-im/profanity/commit/b4857c6043f8b8a4a0e4e8f8dd091d128effa9ca as a patch against 0.12.1. I can see that libprofanity.so is now linked against libXss.so while the executable is not.

Hmm weird. @sjaeckel do you have an idea?

jubalh avatar Jan 10 '23 09:01 jubalh

I don't use a screensaver either but I tend to walk around in my office and speak to other colleagues (in the same room). I then somewhat rely on the auto-away feature so my contacts get an indication that I'm not at my desk and can't read what they are sending me.

Being permanently 'away' for the past few months has earned me some questions from my boss. I guess I will disable auto-away for now and hope I'll not forget to set it manually when going out for lunch.

lynix avatar Jan 10 '23 12:01 lynix

If I'm not mistaken you are a developer yourself, right? Were you able to find anything out that was not mentioned so far?

jubalh avatar Jan 10 '23 15:01 jubalh

Yes I am but I'm afraid I've got no new findings.

As the executable is still not linked against libXss I'd assume all the parts that are guarded by #ifdef HAVE_LIBXSS are missing, which is why idle time is taken from g_timer_elapsed(ui_idle_time, NULL) instead (in core.c).

Unfortunately autoconf/automake is black magic to me, so I haven't been able to figure out what could cause libXss to not be included despite b4857c6.

lynix avatar Jan 11 '23 09:01 lynix