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.47k stars 164 forks source link

wlrctl / fullscreen detection doesn't work on kde wayland #568

Open markschultz opened 8 months ago

markschultz commented 8 months ago

Describe the bug I am currently running kde wayland. The do not disturb plugin does not seem to work. I looked in the code and the method used to detect fullscreen is the command wlrctl toplevel find state:fullscreen. When I run that on cli with a fullscreen app it gives the following output Foreign Toplevel Management interface not found!. Research shows that wlrctl only works with wlroots based DE such as sway. KDE wayland and Gnome wayland don't appear to be based on wlroots meaning the fullscreen detection will not work in either DE.

To Reproduce Steps to reproduce the behavior:

  1. enable DND plugin
  2. have window fullscreen
  3. break should be skipped
  4. break happens anyway

Expected behavior Fullscreen detection should work via the DND plugin

Desktop (please complete the following information):

Debug Log N/A

deltragon commented 8 months ago

I don't know of a way to do this currently, unfortunately. There are the ext-foreign-toplevel-list (merged) and ext-foreign-toplevel-state (in progress) protocols, which together would allow this - but there it is explicitly left to the compositor to set up a policy which clients may use the protocol. Unfortunately, there does not seem to be a KWin implementation for either of these protocols yet, so we'll have to see. (At least wlroots/sway have implemented ext-foreign-toplevel-list in a way that SafeEyes could use it, from what I can tell - so if KWin implements it, we can switch to using it long-term.)