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

Wayland support #97

Closed
eliihen opened this issue Jan 6, 2017 · 29 comments
Closed

Wayland support #97

eliihen opened this issue Jan 6, 2017 · 29 comments

Comments

@eliihen
Copy link

eliihen commented Jan 6, 2017

As you say in the README, wayland is not supported as of now. However, I would still like to file a tracking issue for this so that people interested (like me) can be notified when this is built. Right now alacritty panics because I am using a wayland wm.

Alacritty is currently on a fork of glutin that needs some updates to work with Wayland

Care to comment on what remains to be done? Maybe someone can pitch in

EDIT:
It is possible to run alacritty on a Wayland desktop today if you have XWayland and run alacritty like this:
env WAYLAND_DISPLAY= alacritty

@Timidger
Copy link

Timidger commented Jan 6, 2017

Agreed, would love to get this working with my window manager. I hate having to specify weston-terminal as the default fallback option.

@jwilm
Copy link
Contributor

jwilm commented Jan 6, 2017

Thank you so much for filing the tracking issue. This is very helpful for me!

@johalun
Copy link
Contributor

johalun commented Jan 13, 2017

I would love to run alacritty on Wayland. What changes have you to made to glutin that requires a separate branch? Would it be easy to merge those changes into a newer version of glutin that supports Wayland?

@jwilm jwilm mentioned this issue Feb 10, 2017
@moosingin3space
Copy link

@jwilm Is all that is necessary to make native Wayland work to merge the changes of your branch with a newer version of glutin? (I'm aware that there may have been breakage in glutin since, and this may not be as easy as I made it sound.)

@auscompgeek
Copy link

With #554 rebased onto master and using upstream winit master, I can confirm alacritty runs natively on Wayland. There still seems to be a couple of regressions that need to be fixed though.

@Timidger
Copy link

Awesome! Once there's a stable release, I'll add it as an option on the way-cooler download page. I'll probably make it the default option, since using our current default (weston-terminal) requires having weston as a dependency.

@jwilm
Copy link
Contributor

jwilm commented Jul 20, 2017

We've just updated to the latest Glutin/winit. Anyone want to take it for a spin on Wayland?

@eliihen
Copy link
Author

eliihen commented Jul 20, 2017

Yep, I just tried it. Turns out sway doesn't have a new enough version of the wl_seat global, whatever that is. Assume that's not on you, probably on the wlc library, just reporting my findings.

$ env RUST_BACKTRACE=1 ./alacritty 
thread 'main' panicked at 'Winit requires at least version 5 of the wl_seat global.', /home/espen/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.7.5/src/platform/linux/wayland/context.rs:65:20
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:71
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:380
   2: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:396
             at /checkout/src/libstd/panicking.rs:611
   3: std::panicking::begin_panic_new
             at /checkout/src/libstd/panicking.rs:553
   4: winit::platform::platform::wayland::context::WaylandEnv::get_seat
             at /home/espen/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.7.5/src/platform/linux/wayland/context.rs:65
   5: alacritty::window::Window::new
             at /home/espen/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.7.5/src/platform/linux/wayland/context.rs:206
   6: alacritty::display::Display::new
             at src/display.rs:140
   7: alacritty::run
             at src/main.rs:92
   8: alacritty::main
             at src/main.rs:45
   9: main
  10: __libc_start_main
  11: _start

@flowftw
Copy link

flowftw commented Jul 20, 2017

Just tried it out and the workaround presented earlier in this thread is no longer needed. However there are some things that are not working as expected:

  • The window doesn't seem to use the gtk theme (I'm running Gnome under Wayland). There are no window borders or control buttons (like minimize, maximize, close).
  • Key repetition is not working.
  • Gnome doesn't show any icon when alacritty is running.
    screenshot from 2017-07-20 21-07-07

@jwilm jwilm removed the A - deps label Jul 20, 2017
@jwilm
Copy link
Contributor

jwilm commented Jul 20, 2017

I believe the only way to get GTK decorations is to use their APIs to create the window. This is a general issue when using Wayland.

key repitition not working

Sounds like a winit bug

Gnome doesn't show any icon when alacritty is running

Where should an icon be shown? Which icon should be shown? I'm not familiar with Gnome 3 to understand the issue here.

@lord-re
Copy link

lord-re commented Jul 20, 2017

I have the same issues too :

  • sway can't open alacritty with the same error as @esphen
  • weston : no key repetition, can't resize the window but can move it.

But i have another funny one. Alacritty doesn't render inside it's window
westoncritty
(sorry for the phone screenshot)

@flowftw
Copy link

flowftw commented Jul 20, 2017

Gnome shows an icon for each running application when switching applications. When running alacritty under X11, Gnome shows the default icon used for terminal emulators. I think which icon needs to be shown is determined by the application category specified in the .desktop file. Under wayland only a placeholder is shown.
Just a minor issue...
In the following screenshot, "Unknown" is alacritty.
appswitcher

@Timidger
Copy link

Timidger commented Jul 20, 2017

Sway and Way Cooler will not support this, not until they move to wlroots, because it only supports seat version 5. This is also why I can't use glutin to make my guis for Way Cooler. Expect this situation to improve over the coming months.

Alternatively, someone can update the seat interface used in wlc.

@auscompgeek
Copy link

This is the output of xprop for alacritty under X11:

WM_LOCALE_NAME(STRING) = "C"
WM_CLIENT_MACHINE(STRING) = "laptop"
_NET_WM_PID(CARDINAL) = 28772
_NET_WM_STATE(ATOM) = _NET_WM_STATE_FOCUSED
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 37, 0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW
_NET_WM_NAME(UTF8_STRING) = "~/code/alacritty"
WM_NAME(STRING) = "~/code/alacritty"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified size: 1024 by 768
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW
WM_CLASS(STRING) = "Alacritty", "Alacritty"

Looks like Alacritty is reporting a name via WM_CLASS on X11. Is there a similar thing on Wayland? No clue, but I'd guess that Alacritty isn't reporting an application name to the Wayland compositor.

@Timidger
Copy link

@auscompgeek The equivalent in Wayland is wl_shell_surface::set_class, though I thought this should be handled by glutin.

@nixpulvis
Copy link
Contributor

I think I'm having trouble with getting an alacritty window to be my scratchpad.

# Works with URXVT.
exec --no-startup-id urxvt -name visor
# Doens't work with Alacritty.
exec --no-startup-id alacritty --name visor

for_window [instance="visor"] move scratchpad

@jwilm
Copy link
Contributor

jwilm commented Sep 15, 2017

@nixpulvis

Alacritty doesn't have the --name flag, but you can use --title which will also set WM_CLASS. I think this should work:

exec --no-startup-id alacritty --title visor
for_window [class="visor"] move scratchpad

@nixpulvis
Copy link
Contributor

@jwilm I meant to type --title and it is setting the class but i3 doesn't pick it up. Maybe this is an issue with i3's class.

@jwilm
Copy link
Contributor

jwilm commented Sep 15, 2017

@nixpulvis ohhhhh, gotcha. That might be an issue with winit not setting the title until after the window has been mapped; this would mean that when i3 first sees the window, the class isn't the expected value. There might be some more info in the i3 log about what it sees when the window is created.

@refi64
Copy link

refi64 commented Nov 13, 2017

@esphen Did you ever find a workaround for Sway not supporting a new enough wl_seat?

@Timidger
Copy link

@kirbyfan64 sway will use a new one when it switches to wlroots, which will happen soon (tm)

@hajdamak
Copy link

Setting window title with -t also does not seem to work on Wayland with latest 0.2.5. While it works on X.

@yaymukund
Copy link

Wayland startup time is still quite slow. The fix in #782 (bumping winit to a version that uses XRRGetScreenResourcesCurrent) seems to be X11 specific. And indeed, when I bump to winit 0.19 locally, it's just as slow.

I'm on swaywm 1.0 (sway-git) on Arch.

@chrisduerr
Copy link
Member

Since Alacritty's Wayland support is now quite usable thanks to the work done by winit, this issue does not appear to be relevant anymore. Specific problems should be handled in separate issues.

@ghost
Copy link

ghost commented Oct 9, 2022

How's it now ? Is it stable for everyone on wayland ? Or do you see any noticable difference between x session & wayland ?

@chrisduerr
Copy link
Member

Try it.

@ghost
Copy link

ghost commented Oct 10, 2022

Try it.

Tq will do. I'm currently on gnome & alacritty works flawlessly except those white borders (Idc anyways. It actually looks cool).
I saw foot's wiki (as it has native wayland support) showcasing the differences between foot & alacritty.
Even though it works on cpu, it's performance is near to on-par because of damage tracking. Does alacritty do that ?

@kchibisov
Copy link
Member

We just do damage tracking, but not partial redraws, since on GPU it's a bit more tricky. But we'll do that eventually.

@ghost
Copy link

ghost commented Oct 10, 2022

That would be amazing if pulled off btw. Caz alacritty break it's own performance records.

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

No branches or pull requests