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

Does not work when using windowtolayer with ghostty #18

Closed
Anomalocaridid opened this issue Jan 24, 2025 · 3 comments
Closed

Does not work when using windowtolayer with ghostty #18

Anomalocaridid opened this issue Jan 24, 2025 · 3 comments

Comments

@Anomalocaridid
Copy link

Anomalocaridid commented Jan 24, 2025

I am trying to use windowtolayer to make a ghostty terminal window swaylock-plugin's background.

swaylock-plugin --command-each 'windowtolayer -- ghostty -e asciiquarium' does not work, resulting in only a solid light grey background.

Using alacritty instead, like in swaylock-plugin --command-each 'windowtolayer -- alacritty -e asciiquarium', works as expected, with the terminal window running asciiquarium visible in the background .

Also, just running windowtolayer -- ghostty -e asciiquarium without swaylock-plugin works as expected, running the terminal as a desktop background.

When running swaylock-plugin --command-each 'windowtolayer -- ghostty -e asciiquarium' in a terminal, I get the following output repeated over and over (but with different process numbers and timestamps, of course):

(process:97897): Gdk-WARNING **: 16:25:45.497: The Wayland compositor does not provide one or more of the required interfaces, not using Wayland display
Downstream hang up

(process:97897): Gtk-WARNING **: 16:25:45.497: Failed to open display
Forked background plugin (pid = 97904): windowtolayer -- ghostty -e asciiquarium
info: ghostty version=1.0.1
info: ghostty build optimize=ReleaseFast
info: runtime=apprt.Runtime.gtk
info: font_backend=font.main.Backend.fontconfig_freetype
info: dependency harfbuzz=10.1.0
info: dependency fontconfig=21500
info: renderer=renderer.OpenGL
info: libxev backend=main.Backend.io_uring
info(os): setlocale from env result=en_US.UTF-8
info(gtk): GTK version build=4.16.3 runtime=4.16.3
info: reading configuration file path=/home/anomalocaris/.config/ghostty/config
info(config): default shell source=env value=/run/current-system/sw/bin/fish
info(sentry): sentry envelope does not contain crash, discarding

The last repetition also includes the following line:

2025-01-24 16:25:51 - [main.c:1892] Client failed to redraw output 51 in time; falling back to a client-less mode

Edit: Also, I am currently using the latest commit of both swaylock-plugin and windowtolayer.

@mstoeckl
Copy link
Owner

The key error message is (process:97897): Gdk-WARNING **: 16:25:45.497: The Wayland compositor does not provide one or more of the required interfaces, not using Wayland display. This error comes from Gtk4, specifically from gdkdisplay-wayland.c; it looks like Gtk4 requires the Wayland interface wl_data_device_manager, which the nested Wayland compositor in swaylock-plugin does not provide. (It currently only implements wl_compositor, wl_shm, zwlr_layer_shell_v1, zxdg_output_manager_v1, zwp_linux_dmabuf_v1, wp_fractional_scale_manager_v1, wp_viewporter, and wl_output; interfaces which are useful for wallpaper programs. wl_data_device_manager is used for copy-paste operations, which wallpapers usually do not need. windowtolayer should pass through all interfaces except zwlr_layer_shell_v1/xdg_wm_base unmodified.)

Alacritty and most other terminals should work because they do not require wl_data_device_manager to run. (The only other terminal of which I am aware, which does not currently work with windowtolayer + swaylock-plugin, is foot, which requires wl_subcompositor to (if I recall correctly) more efficiently implement scrolling.)

I'll see if I can modify swaylock-plugin to provide wl_data_device_manager; until that is done, I'd recommend using a different terminal with swaylock-plugin.

@mstoeckl
Copy link
Owner

I've implemented wl_data_device_manager in 7df380e, which should make windowtolayer -- ghostty -e asciiquarium work.

@Anomalocaridid
Copy link
Author

Indeed, it does. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants