phuhl / linux_notification_center

A notification daemon/center for linux
BSD 3-Clause "New" or "Revised" License
1.01k stars 40 forks source link

[Request] Wayland/Wlroots support? #26

Open A-Cloud-Ninja opened 4 years ago

A-Cloud-Ninja commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

git@ph-uhl.com would be best, thx

A-Cloud-Ninja commented 4 years ago

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

Garionion commented 4 years ago

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 commented 4 years ago

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

phuhl commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 ^^'

https://github.com/wmww/gtk-layer-shell/issues/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 commented 2 years ago

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 commented 2 years ago

for those who use sway: https://github.com/ErikReider/SwayNotificationCenter

phuhl commented 1 year ago

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

godalming123 commented 1 year ago

for those who use sway: https://github.com/ErikReider/SwayNotificationCenter

This actually supports more than just sway, it supports everything that has wlr_layer_shell (so most things that are wlroots based like hyprland)

wineee commented 1 year ago

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 commented 1 year ago

@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 commented 11 months ago

Would love to see support for wlroots! :)