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

[Request] Wayland/Wlroots support? #26

Open
A-Cloud-Ninja opened this issue Mar 2, 2020 · 22 comments
Open

[Request] Wayland/Wlroots support? #26

A-Cloud-Ninja opened this issue Mar 2, 2020 · 22 comments

Comments

@A-Cloud-Ninja
Copy link

I love the look of this notification daemon, and notice it has GTK3 in the dependencies. However, I'm on sway full time right now, and there's no good way for this to work on sway without implementing a layer-shell surface with wlroots.

@phuhl
Copy link
Owner

phuhl commented Mar 2, 2020

Hi @HolyStephano,

What exactly would have to be done for making it run on wayland? GTK3 seems to be supported by wayland. Sadly, I am not yet familiar with writing wayland applications.

@A-Cloud-Ninja
Copy link
Author

I personally don't, but my friend has experience (he's the developer of Wofi) with wlroots, I'm sure he could help you out. He doesn't use github, is there any IRC channels or something to reach you in regularly?

@phuhl
Copy link
Owner

phuhl commented Mar 2, 2020

[email protected] would be best, thx

@A-Cloud-Ninja
Copy link
Author

Awesome! he should be emailing you soon, make sure to check your spam folder if it runs through gmail at all.

@Garionion
Copy link

I'm also on sway, and it basically works, the notifications are just not positionable. they are right in the center of the screen. started from shell, there is just this message:
Gdk-Message: 16:46:41.010: Window 0x428ce10 is a temporary window without parent, application will not be able to position it on screen.

and also I can't get rid of the notifications reliable by hand (they disapear after some time and some notifications I can dismiss by clicking on them, but not all notifications react like that)

@travankor
Copy link

travankor commented Mar 24, 2020

You will need to use gtk-layer-shell to have positionable notifications on sway/wlroots,.

@phuhl
Copy link
Owner

phuhl commented Nov 1, 2020

Hey @HolyStephano, in #99 someone uses the DNC on Sway, does it work like that for you, too? Then we could document the process and close this issue

@A-Cloud-Ninja
Copy link
Author

The way they're using it is by setting GDK_BACKEND=x11 which forces it to use xwayland. While this would work, it isn't "correct" for wlroots compositors, and just tends to either look bad, break, or not function at all. Actual wlroots support would be great. There's a gtk-layer-shell project that you could look into, or the actual wlroots protocol itself

@phuhl
Copy link
Owner

phuhl commented Nov 1, 2020

Sadly I lack in capacity to do this, currently. Also I have little to no experience with wayland, so I won't implement this for now. But if someone gets it to work and opens a working PR, I will merge it.

@elkowar
Copy link

elkowar commented Feb 8, 2021

Quick note on this: If you're planning to migrate to gtk4 (#136), you're effectively giving up on this (and vice versa). Gtk4 doesn't do layer-shell at all, not even with the gtk-layer-shell "hack", so,.... good luck ^^'

@phuhl
Copy link
Owner

phuhl commented Feb 9, 2021

I thought, GTK4 was design with wayland in mind? Anyways, I doubt, there will be a merge of #136 soon as GTK4 has no way to move windows, which is absolutely something we need. Actually, the GTK4 reasoning behind this is, a) moving windows should be done by the window manager, b) they can't move windows across platforms, because it's not possible in wayland (like, wtf). I noticed that after I was nearly done with the transition. There probably are ways to get arround it, but it is not clear if the benefits justify the effort.

@elkowar
Copy link

elkowar commented Feb 9, 2021

Doing window movement in X manually is mostly trivial (i'm working on something very simmilar, and am in the process of migrating to gtk4 currently), although still anoying.
On Wayland they completely removed the code required for things like gtk-layer-shell to work. This means that gtk windows can only render to application surfaces, which, under wayland, have no support for client-controlled window position - that's what layershell is there for, which isn't supported.

you could position windows on wayland before (gtk-layer-shell was the thing to use) but gtk4 removed that possibility, pretty much without a chance of bringing it back.

@phuhl
Copy link
Owner

phuhl commented Feb 10, 2021

i'm working on something very simmilar, and am in the process of migrating to gtk4 currently

I assume, you are talking about EWW?

How did you solve the issue? No wayland support?

Could you point me at where the code for moving windows on X is in your project? I'd add a reference to #136 in case I come arround and finish the migration.

@elkowar
Copy link

elkowar commented Feb 10, 2021

Yea, talking about eww.
My wayland """solution""" for now is to not support the window-positioning side of things in wayland, but to instead just do nothing there. Then, I'll try to write some documentation about how to configure window position via rules in some of the more popular wayland compositors - doing that should be possible in most compositors.
As the rendering still works, wayland is still """supported""", just missing some key things that will need to be replicated on the compositor side.

The relevant code I wrote to replace the removed GTK calls is pretty much all in https://github.com/elkowar/eww/blob/gtk4/src/display_backend/x11.rs, being used in https://github.com/elkowar/eww/blob/gtk4/src/app.rs
Still imperfect, but I've managed to replicate the old gtk functionality moooooostly, with a tiny bit of jankyness in some rare edgecases.

@0reoKing
Copy link

Quick note on this: If you're planning to migrate to gtk4 (#136), you're effectively giving up on this (and vice versa). Gtk4 doesn't do layer-shell at all, not even with the gtk-layer-shell "hack", so,.... good luck ^^'

wmww/gtk-layer-shell#37
I've started work on option 3 (porting without upstream changes). Looks like it's probably going to be possible. Initial proof-of-concept works. Code is messy, incomplete, and there's no popup support yet. WIP branch: gtk4.

Looks like layer shell support for gtk4 is in progress

@godalming123
Copy link

Wayland support would defiantly be a nice feature since there isn't any good notification managers on wayland with a notifications overview unless you want to make one from the ground up which doesn't sound fun.

@akhiljalagam

This comment was marked as off-topic.

@phuhl phuhl mentioned this issue Aug 5, 2023
@phuhl
Copy link
Owner

phuhl commented Aug 6, 2023

A first version of wayland support now exists in #242. Feel free to test it

@godalming123

This comment was marked as off-topic.

@wineee
Copy link

wineee commented Aug 11, 2023

Looks like layer shell support for gtk4 is in progress

https://github.com/wmww/gtk4-layer-shell gtk4 layer-shell support has been implemented

@phuhl
Copy link
Owner

phuhl commented Aug 11, 2023

@wineee Yes, I saw that, too. Now we need the Haskell bindings for GTK4 Layer Shell and also a solution for moving windows with GTK 4 on X Server as I don't want to brake compatibility.

@leon-erd
Copy link

Would love to see support for wlroots! :)

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

No branches or pull requests

10 participants