slgobinath / SafeEyes

Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder
http://slgobinath.github.io/SafeEyes/
GNU General Public License v3.0
1.45k stars 160 forks source link

[Ubuntu] Only one screen is locked #252

Open xZero707 opened 6 years ago

xZero707 commented 6 years ago

In my case multi-screen support seems to be broken.

SafeEyes Version: 2.0.5

Laptop: Dell XPS-13 9360 Developer Edition

OS Info:

xzero@DELL-XPS-13-9360-DEV:~/dev$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:   xenial

SafeEyes Version:

xzero@DELL-XPS-13-9360-DEV:~/dev$ safeeyes --version
safeeyes 2.0.5

Here is debug log (excerpt):

xzero@DELL-XPS-13-9360-DEV:~/dev$ safeeyes --debug
(...)
2018-05-04 16:46:12,494 [INFO]:[Thread-7] Wait for 10 seconds before the break
2018-05-04 16:46:22,496 [INFO]:[MainThread] Close pre-break notification
2018-05-04 16:46:22,497 [INFO]:[Thread-9] Lock the keyboard
2018-05-04 16:46:22,497 [INFO]:[MainThread] Show break screens in 2 display(s)
2018-05-04 16:46:22,540 [INFO]:[MainThread] Moved break screen to Display[0, 0]
2018-05-04 16:46:22,563 [INFO]:[MainThread] Moved break screen to Display[1920, 0]
2018-05-04 16:46:50,531 [INFO]:[MainThread] Break is terminated automatically
2018-05-04 16:46:50,532 [INFO]:[MainThread] Close the break screen(s)
2018-05-04 16:46:50,532 [INFO]:[MainThread] Unlock the keyboard
2018-05-04 16:46:50,534 [INFO]:[MainThread] Playing audible alert
(...)
slgobinath commented 6 years ago

Again... :-( I hope you are using Unity. I will have a look at this.

Thanks for reporting the bug :-)

xZero707 commented 6 years ago

Yup, it's Unity.

It doesn't really bother me, as keyboard seems to be locked, but It's not according to the claim for multi-screen setup.

Keep up doing a great work.

xZero707 commented 6 years ago

Update: Maybe relevant, it worked ONCE, completely randomly. I don't know why, and I have no debug log, unfortunately.

xZero707 commented 6 years ago

Update: This time I managed to capture debug when dual-screen lock out of sudden actually worked. Though it looks almost the same as when it's not working.

xzero@DELL-XPS-13-9360-DEV:~/dev$ safeeyes --debug
(...)
2018-06-12 14:32:48,957 [INFO]:[Thread-138] Stop the scheduler
2018-06-12 14:32:48,958 [INFO]:[Thread-137] Pre-break waiting is over
2018-06-12 14:32:49,960 [INFO]:[MainThread] Close pre-break notification
2018-06-12 14:32:49,963 [INFO]:[Thread-140] Lock the keyboard
2018-06-12 14:32:49,965 [INFO]:[MainThread] Show break screens in 2 display(s)
2018-06-12 14:32:49,980 [INFO]:[MainThread] Moved break screen to Display[0, 0]
2018-06-12 14:32:49,994 [INFO]:[MainThread] Moved break screen to Display[1920, 0]
2018-06-12 14:33:00,190 [INFO]:[MainThread] User skipped the break
2018-06-12 14:33:00,190 [INFO]:[MainThread] User skipped the break
2018-06-12 14:33:00,191 [INFO]:[MainThread] Close the break screen(s)
2018-06-12 14:33:00,191 [INFO]:[MainThread] Unlock the keyboard
2018-06-12 14:33:00,979 [INFO]:[Thread-141] Waiting for 25 minutes until next break
2018-06-12 14:33:00,979 [INFO]:[MainThread] Update next break information

It seems that it is related to whether status bar is in focus or not because it seems that in 90% cases it suddenly worked while I was looking at tray icon settings for SafeEyes

oxbee commented 6 years ago

Have similar issue on my Ubuntu 16.04 There are two external monitors has been connected to laptop. One via HDMI another via VGA port. It seems that SafeEye lock only native laptop screen and one that connected via HDMI. If i unplug HDMI screen - then SafeEye locks only native laptop screen.

Hope this helps...

Asalle commented 4 years ago

Same issue, Fedora 30 with GTK+ 3.24.8.

I have a laptop and 2 monitors with a dock station. Laptop monitor is the primary one. Sometimes, only the laptop monitor was blocked, while 2 monitors remained unblocked (most cases), othertimes only a bubble from GNOME came up to say "Window "safeeyes" is ready" and no monitors were blocked. When I clicked Alt+Tab, I could see 3 safeeyes windows, all on the primary screen.

Now that I've switched primary monitor to be one of the external monitors (i. e. not the one on the laptop), I can see the GNOME bubble, but the screen is never blocked.

Hope this helps with debugging.

madand commented 3 years ago

I have similar issue on Artix Linux (it's Arch Linux without systemd) with GTK 3.24.30. I use StumpWM as a window manager.

My setup is laptop screen + external monitor, with laptop screen being master. The SafeEyes popup window only gets displayed on whatever screen the mouse pointer currently is. Keyboard input is properly blocked.

argonarch commented 1 year ago

A solution for hyprland and others wayland compositors is assign manually in configuration the position of each window in a monitor

archisman-panigrahi commented 2 months ago

I only have one screen, so cannot verify. Is this issue still present?