figuro icon indicating copy to clipboard operation
figuro copied to clipboard

Wayland support

Open xTrayambak opened this issue 8 months ago • 10 comments

Hi there, I was wondering if you're open to me adding siwin as a windowing backend to your project.

Currently, you're using a forked version of Windy and it does not have proper Wayland support. As such, it defaults to X11. Siwin, on the other hand, has proper Wayland support along a bunch of extra protocols that a modern Linux desktop application can utilize. (Layer Shell, Idle Inhibit, etc.)

xTrayambak avatar Apr 01 '25 15:04 xTrayambak

That’d be awesome! I’m not familiar with siwin. Is it cross platform or Wayland specific?

If it’s Wayland specific it might be better to add it to my windy fork as another backend. More apis could be added too.

I’ve been feeling the limitations of the windy implementation lately on macOS as well. I was considering looking into other cross platform windowing libs.

I’d be happy to switch or have optional backends. But it’d be nice to keep the windowing in a separate library.

elcritch avatar Apr 01 '25 18:04 elcritch

I just looked at the siwin link. Definitely could work as a windowing backend to swap out windy/windex.

It's missing macos, but I could port over macos if it works alright.

elcritch avatar Apr 01 '25 23:04 elcritch

Upon further inspection, it seems like the backend you inherited from Fidget is quite intertwined with windy/windex. It's quite the hassle to abstract away.

xTrayambak avatar Apr 19 '25 09:04 xTrayambak

Upon further inspection, it seems like the backend you inherited from Fidget is quite intertwined with windy/windex. It's quite the hassle to abstract away.

Hmmm, yeah that makes sense. I was thinking it might be possible to use when blocks and to just directly swap out the windowing types. Abstracting it out seems like it'd be a pain.

elcritch avatar Apr 22 '25 06:04 elcritch

I tried refactoring it so the windowing library was a bit more self contained. Got it all compiling, but the window just didn't want to show up. Everything should've been setup right, but nada.

I'll have to do it again but in smaller increments and to test each change.

elcritch avatar Apr 25 '25 16:04 elcritch

https://github.com/elcritch/figuro/issues/124

elcritch avatar May 01 '25 18:05 elcritch

@xTrayambak there's a new v0.15.0 branch where I'm working on adding a skeleton siwin windowing module. I'm not going to be able to implement it all, but figured I'd get a draft in place. I'll merge it soon, probably tomorrow.

The windowing stuff has been cleaned up and most of the windowing stuff is in a single moduel openglWindex.nim which I copied to openglSiwin.nim. However, siwin doesn't work on macs I think so I'm just going to get the most basic stuff done.

I refactored Figuro's mouse and keyboard events to be more similar to Siwin's design as well. But there's still some differences in how mouse events are handled, but nothing too crazy looking.

elcritch avatar May 08 '25 07:05 elcritch

@xTrayambak all that to say if you wanna try getting siwin running on wayland it should be much easier now.

Unsupported things can probably just be a null-op. Items like setting window style / decorations for example that might just be a windy/windex thing.

elcritch avatar May 08 '25 07:05 elcritch

I'm excited. 😸 I've been thinking of maybe working toward something similar to https://github.com/linkfrg/ignis but utilizing nim/figuro.

derek-v-s avatar May 09 '25 05:05 derek-v-s

I've gotten a very basic Siwin backend working, but it'll take a while to implement everything. I'll just try to finish it and send a MR by tomorrow.

xTrayambak avatar May 09 '25 05:05 xTrayambak