jD91mZM2 / xidlehook

GitLab: https://gitlab.com/jD91mZM2/xidlehook
MIT License
387 stars 33 forks source link

--not-when-fullscreen issue #5

Closed ghost closed 5 years ago

ghost commented 6 years ago

Hi, when running xidlehook with --not-when-fullscreen it still locks the screen, tested this with full screen video in youtube under archlinux with i3lock-fancy

jD91mZM2 commented 6 years ago

What DE/WM are you using? This has occured to me in xmonad due of a lack of EWMH hints.

To debug this, please run the following command and click a fullscreen window.

xprop | grep _NET_WM_STATE
ghost commented 6 years ago

I'm using i3-gaps-next right now. This is the output of your command:

_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN
jD91mZM2 commented 6 years ago

Is the fullscreen window currently active when it locks? xidlehook only checks for the currently active window.

jD91mZM2 commented 6 years ago

I just made a change related to fullscreen to be less of a hack. It probably won't change anything, but if nothing else works it'd be great if you tried the latest version on git.

jD91mZM2 commented 6 years ago

Hello?

jD91mZM2 commented 6 years ago

Closed due to inactivity

jpmorris commented 5 years ago

I'm happy to pick this up. My xprop shows:

$ xprop | grep _NET_WM_STATE
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_FOCUSED

I'm running i3 and both youtube and beachbody.com both go dim my screen after 60 seconds using this in my .i3/config file:

exec --no-startup-id xidlehook --not-when-fullscreen \
--timer normal 60 \
    'xrandr --output eDP1 --brightness .1' \
    'xrandr --output eDP1 --brightness 1' \
--timer primary 600 \
    'xrandr --output eDP1 --brightness 1; i3lock -nc 000000' \
    '' \
--timer normal 1200 \
    'grep 0 /sys/class/power_supply/AC/online > /dev/null && eystemctl suspend' \
    '' &
jD91mZM2 commented 5 years ago

When running xidlehook, I assume you get no warnings in the console? I'll double check that everything works on my end as soon as I can, which sadly is no sooner than the weekend.

jpmorris commented 5 years ago

No warnings/errors. I usually run it in the background, but I ran it in a console and tried youtube and I see no warnings/errors and after 60 seconds my screen dimmed.

jD91mZM2 commented 5 years ago

I cannot reproduce this, even in i3.

  1. What version of xidlehook is this? (xidlehook --version)
  2. Is the fullscreen window also the "active" one? (the one which gets keyboard input)
jpmorris commented 5 years ago
$ xidlehook --version
xidlehook 0.6.1

As far as I can tell it is the active one. I can click on the youtube video to pause it and I can press the spacebar to pause it. Moreover the xprop says as much:

$ xprop | grep _NET_WM_STATE
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_FOCUSED

I can take a video when I'm home, if that helps at all.

jD91mZM2 commented 5 years ago

I can take a video when I'm home, if that helps at all.

I suppose that could aid me in reproducing this issue, thanks!

mitchmcdee commented 5 years ago

Also having this issue on 0.6.1 :) my print out is: _NET_WM_STATE(ATOM) = _NET_WM_STATE_FOCUSED, _NET_WM_STATE_FULLSCREEN

jD91mZM2 commented 5 years ago

Also having this issue on 0.6.1 :) my print out is:

Very strange! Are you also using i3?

jD91mZM2 commented 5 years ago

I noticed that both of you have _NET_WM_STATE_FOCUSED, while I do not. I think this bug only shows on the latest version of i3, where this was added. So, @jpmorris, skip the video for now. I'll update i3 and try to reproduce

jD91mZM2 commented 5 years ago

I was able to reproduce it with the latest version of i3wm. Turns out I misunderstood the (vague) X11 documentation on a thing that made it read too little. Good thing is that it never should have caused undefined behavior.

It should now be fixed with 1de9de59b429bcb15240dc87220ec4f3dc6d771d, could you verify?

mitchmcdee commented 5 years ago

Confirmed fixed for me! Thanks for the speedy work!

jpmorris commented 5 years ago

sorry to resurrect this (I can also open a new bug) but this flag (although working on my laptop) doesn't work on my desktop with three monitors. Are you checking for the STATE on all current monitors?

jD91mZM2 commented 5 years ago

sorry to resurrect this (I can also open a new bug) but this flag (although working on my laptop) doesn't work on my desktop with three monitors. Are you checking for the STATE on all current monitors?

It's not about the monitor, it's about the currently focused window. If the mouse is on another monitor, it will select a different focused application and not work.

jpmorris commented 5 years ago

Thank you for the quick reply! Would possible to make this more Windows or caffeine-esque to disable when any fullscreen app is running? Sometimes I have it full screen on one monitor, and it would be nice to not have to remember to keep giving the video focus every time as I transition from working at the computer and away from the keyboard but I (or my toddler) still watching.

jD91mZM2 commented 5 years ago

Perhaps, I'll take a look later. For now you can try using --not-when-audio and see if that suits your need better?

jD91mZM2 commented 5 years ago

Moved your question to a new issue, #19

stevensonmt commented 5 years ago

I'm having a similar issue, I think. If Firefox is fullscreen it will still trigger the screenlock. If audio is running it will still trigger screen dimming but not lock.

#! /bin/bash

# Run xidlehook
xidlehook \
  `# but not when fullscreen` \
  --not-when-fullscreen \
  `# and not when audio playing` \
  --not-when-audio \
  `# dim after 60 seconds inactivity, undim if activity` \
  --timer normal 60 \
    'xrandr --output HDMI2 --brightness .4 --output VGA1 --brightness .4' \
    'xrandr --output HDMI2 --brightness 1 --output VGA1 --brightness 1' \
  `# after ten seconds undim and run gllock` \
  --timer primary 15 \
    'xrandr --output HDMI2 --brightness 1 --output VGA1 --brightness 1; gllock' \
    '' \
  `#if no activity in another 30 seconds suspend `\
    --timer normal 60 \
      'systemctl suspend'\
      ''