manateelazycat / holo-layer

HoloLayer is a multimedia layer plugin designed specifically for Emacs
GNU General Public License v3.0
123 stars 18 forks source link

overlay window behavior in hyprland #27

Closed PlaneTraveller closed 10 months ago

PlaneTraveller commented 11 months ago

I'm using hyprland in Arch linux. The overlay window is fullscreen, and does not lay over the emacs window.

manateelazycat commented 11 months ago

I don't use hyprland, any PR are welcome. ;)

tickscn commented 10 months ago

try adding this to you hyprland.conf.

windowrulev2 = float,title:(holo_layer.py)
windowrulev2 = nofocus,title:(holo_layer.py)
windowrulev2 = noblur,title:(holo_layer.py)

图片

manateelazycat commented 10 months ago

Thanks for help, I have commit https://github.com/manateelazycat/holo-layer/commit/a7e7dd65dfafba916ff1c29fa7068f59018f7e08

PlaneTraveller commented 10 months ago

try adding this to you hyprland.conf.

windowrulev2 = float,title:(holo_layer.py)
windowrulev2 = nofocus,title:(holo_layer.py)
windowrulev2 = noblur,title:(holo_layer.py)

图片

Does it still work for you on wayland? For me, hololayer returns the following error:

Process *holo-layer* exited abnormally with code 1
Traceback (most recent call last):
  File "/home/planetraveller/Literacy/Descent/lisp/holo-layer/holo_layer.py", line 33, in <module>
    from pynput.keyboard import Listener as kbListener
  File "/usr/lib/python3.11/site-packages/pynput/__init__.py", line 40, in <module>
    from . import keyboard
  File "/usr/lib/python3.11/site-packages/pynput/keyboard/__init__.py", line 31, in <module>
    backend = backend(__name__)
              ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pynput/_util/__init__.py", line 76, in backend
    raise ImportError('this platform is not supported: {}'.format(
ImportError: this platform is not supported: ('failed to acquire X connection: Bad display name ""', DisplayNameError(''))

Try one of the following resolutions:

 * Please make sure that you have an X server running, and that the DISPLAY environment variable is set correctly

It seems that pynput is not supported in wayland. It used to work tho. I'm not sure what happened.

manateelazycat commented 10 months ago

You need xwayland

PlaneTraveller commented 10 months ago

Could you please be more specific? I've tried setting env = QT_QPA_PLATFORM,xcb in my hyprland config but it still reports the same error. I have other apps using XWayland as well. @tickscn Did you have any other special config for it to work?

mumu-lhl commented 10 months ago

Your emacs must be X

PlaneTraveller commented 10 months ago

okay.. Is there any way that this could be adapted for emacs-pgtk? If you guys could give me some pointers, I want to try porting it to wayland.

tickscn commented 9 months ago

Could you please be more specific? I've tried setting env = QT_QPA_PLATFORM,xcb in my hyprland config but it still reports the same error. I have other apps using XWayland as well. @tickscn Did you have any other special config for it to work?

it still work for me. I set these env variables in .zshenv.

export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=hyprland
export XDG_SESSION_DESKTOP=hyprland
export MOZ_ENABLE_WAYLAND=1
export SDL_VIDEODRIVER=wayland,x11
tickscn commented 9 months ago

I don't know if these variables have an effect, as this was set when the system was installed

manateelazycat commented 9 months ago

okay.. Is there any way that this could be adapted for emacs-pgtk? If you guys could give me some pointers, I want to try porting it to wayland.

Wayland has work when Gnome 23, but broken in Gnome 24.

Wayland not allow application reparent EAF window to Emacs that different process with EAF process.

So if we need support Wayland, we need make Emacs floatting on Emacs window like macOS porting does https://github.com/emacs-eaf/emacs-application-framework/blob/41106ca591e33e69ecc9bbde31137ddd90de4cc4/eaf.el#L1064

Then write code to get active window and emacs window coordinate like https://github.com/emacs-eaf/emacs-application-framework/blob/41106ca591e33e69ecc9bbde31137ddd90de4cc4/gnome-shell/eaf-wayland@emacs-eaf.org/extension.js#L1

It's not easy mission, and my Company is so busy recently, I haven't time port EAF to Wayland.

Anyway, welecome to ask any question.

AllTheLife commented 8 months ago

try adding this to you hyprland.conf.

windowrulev2 = float,title:(holo_layer.py)
windowrulev2 = nofocus,title:(holo_layer.py)
windowrulev2 = noblur,title:(holo_layer.py)

图片

@tickscn 你好👋兄弟,请问你现在还在用hyprland和holo-layer吗?我尝试在hyprland下使用holo-layer却发生了这样的问题:

在我按照readme更改了 hyprland.conf 后,启用 holo-layer,虽然holo-layer的窗口全屏了,但是它显示的是桌面的背景图片而非emacs,使得看不见emacs窗口了,且 holo-layer 无响应

*holo-layer*不断重复:(**** 为递增的数字)

[New Thread 0x7fffabfff6c0 (LWP ****)]
[Thread 0x7fffabfff6c0 (LWP ****) exited]

*holo-layer-epc con 35* 无错误输出

开启前 image

开启后 image

tickscn commented 8 months ago

try adding this to you hyprland.conf.

windowrulev2 = float,title:(holo_layer.py)
windowrulev2 = nofocus,title:(holo_layer.py)
windowrulev2 = noblur,title:(holo_layer.py)

图片

@tickscn 你好👋兄弟,请问你现在还在用hyprland和holo-layer吗?我尝试在hyprland下使用holo-layer却发生了这样的问题:

在我按照readme更改了 hyprland.conf 后,启用 holo-layer,虽然holo-layer的窗口全屏了,但是它显示的是桌面的背景图片而非emacs,使得看不见emacs窗口了,且 holo-layer 无响应

*holo-layer*不断重复:(**** 为递增的数字)

[New Thread 0x7fffabfff6c0 (LWP ****)]
[Thread 0x7fffabfff6c0 (LWP ****) exited]

*holo-layer-epc con 35* 无错误输出

  • hyprland version: v0.33.1
  • Emacs version: GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8)

开启前 image

开启后 image

最近没有在 hyprland 上用过了,不过直接显示了桌面的图片,会不会是因为 emacs 和 holo-layer 的窗口不在同一个 workspace