profanity-im / profanity

Ncurses based XMPP client
https://profanity-im.github.io/
Other
1.32k stars 187 forks source link

Idle detection via xscreensaver does not work #1695

Closed lynix closed 1 year ago

lynix commented 2 years ago

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 <boothj5web@gmail.com>.
Copyright (C) 2019 - 2021 Michael Vetter <jubalh@iodoru.org>.
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
jubalh commented 2 years ago

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?

lynix commented 2 years ago

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

jubalh commented 2 years ago

@lynix please test latest master.

lynix commented 2 years ago

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 commented 2 years ago

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

lynix commented 1 year ago

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

jubalh commented 1 year ago

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?

lynix commented 1 year ago

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.

jubalh commented 1 year ago

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

lynix commented 1 year ago

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.