Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idle detection via xscreensaver does not work #1695

Closed
lynix opened this issue Apr 21, 2022 · 10 comments · Fixed by #1696 or #1787
Closed

Idle detection via xscreensaver does not work #1695

lynix opened this issue Apr 21, 2022 · 10 comments · Fixed by #1696 or #1787
Labels
Milestone

Comments

@lynix
Copy link

lynix commented Apr 21, 2022

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 28a9605?

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
Copy link
Member

jubalh commented Apr 21, 2022

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
Copy link
Author

lynix commented Apr 21, 2022

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

paulfertser added a commit to paulfertser/profanity that referenced this issue Apr 21, 2022
Using pkg-config to find libraries requires explicit mention of the
relevant _CFLAGS and _LIBS variables.

Fixes profanity-im#1695.
@jubalh jubalh added the bug label Apr 21, 2022
@jubalh jubalh added this to the 0.13.0 milestone Apr 21, 2022
@jubalh
Copy link
Member

jubalh commented Apr 21, 2022

@lynix please test latest master.

@lynix
Copy link
Author

lynix commented Apr 22, 2022

I have modified the Arch PKGBUILD to include b4857c6 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
Copy link
Author

lynix commented Apr 22, 2022

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

@jubalh jubalh reopened this Apr 22, 2022
cockroach pushed a commit to cockroach/profanity that referenced this issue Apr 22, 2022
Using pkg-config to find libraries requires explicit mention of the
relevant _CFLAGS and _LIBS variables.

Fixes profanity-im#1695.
@jubalh jubalh removed this from the 0.13.0 milestone Sep 7, 2022
@lynix
Copy link
Author

lynix commented Jan 10, 2023

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

@jubalh
Copy link
Member

jubalh commented Jan 10, 2023

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 b4857c6 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
Copy link
Author

lynix commented Jan 10, 2023

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
Copy link
Member

jubalh commented Jan 10, 2023

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
Copy link
Author

lynix commented Jan 11, 2023

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.

jubalh pushed a commit that referenced this issue Jan 11, 2023
In 28a9605 we migrated from AC_CHECK_LIB which defines HAVE_LIBXSS automatically. With pkg-config way you need it explicit. And also x11 is needed or else linking will fail missing XFree().

Patch provided by Paul Fertser and comitted by jubalh.
Thanks Paul!

Fix #1695
@jubalh jubalh added this to the next milestone Jan 12, 2023
thexhr pushed a commit to thexhr/profanity that referenced this issue Jan 26, 2023
In 28a9605 we migrated from AC_CHECK_LIB which defines HAVE_LIBXSS automatically. With pkg-config way you need it explicit. And also x11 is needed or else linking will fail missing XFree().

Patch provided by Paul Fertser and comitted by jubalh.
Thanks Paul!

Fix profanity-im#1695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants