-
Notifications
You must be signed in to change notification settings - Fork 35
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
Port to GTK4 #105
Port to GTK4 #105
Conversation
This will probably take a while to be finished, but since there is now at least a compiling gtk4 codebase, hopefully it will be less daunting for other people to help. |
I figured out how to make it work (including a bug reproducer for gtk4-layer-shell), will push once it's cleaned up :) The current version runs, but doesn't correctly handle changes in output size or scale (since |
Fix for upstream gtk4-layer-shell issue: wmww/gtk4-layer-shell#49 With that fix it doesn't crash any more. I also changed the margin code so it is always updated when its inputs change, which is more reliable than relying on The main issue remaining is some "Channel Send error: sending into a closed channel" errors printed on stderr, I probably did something wrong while porting the |
- some icons are broken - clearing osd window doesn't work - gtk4_layer_shell crashes more often than not
we need to get the next sibling before we remove it from the box.
some icons (notably volume icons) don't seem to be detected by has_icon properly in all cases, but the icon is drawn correctly. Use gio::ThemedIcon directly and pass "missing-symbolic" as a fallback name through there to avoid checking explicitly.
This ensures the window margin is always correct. This also fixes an annoying issue where the monitor scale factor is not always correct (it never changes back to scale 1 if it was scale 2 at some point) by transforming the monitor height into window coordinates manually. Fixes ErikReider#101.
Channel issue is now fixed with the latest rebase. |
Should be mostly ready for review now. It looks slightly different than the GTK3 version (GTK4 has more default padding), but looks like it works quite well. I've switched to it as my daily driver. Still depends on the upstream gtk4-layer-shell fix PR |
awesome, thanks for your work ! |
excited for this! |
I've been running this branch as my daily driver for the last month and haven't seen any crashes, but it seems to hang sometimes, requiring a restart to get responsive again. I'll try to run a debug build for the next week or two to see if I can figure out the issue. |
This is working great -- I had to install some deps to compile it, but 10/10 would install/compile again |
The upstream gtk4-layer-shell fix for the crash issue has just been merged, but hasn't been released yet. |
The libinput dbus signal listener was hanging in I changed the code to spawn an async task on the MainContext and use an async UPDATE: I haven't seen the issue last week, so I've changed to running a release build instead of a debug build and if it still doesn't appear I consider this fixed. |
The issue hasn't reappeared, and I also haven't encountered any other obvious bugs in my usage. Also, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a ton for the PR! Sorry for the delay, Uni has me pretty busy 😅
This PR ports SwayOSD to GTK4. Applies on top of #104. Fixes #75. Fixes #101.
A lot of changes to prepare for this were already done, but GTK4 changes a lot more which had to be worked around. Note that this branch requires gtk4-layer-shell 1.0.4 or later due to an issue causing Wayland protocol errors.
Main changes:
clone!
macro has changed (#[strong]
instead of@strong
and,
instead of=>
).monitors()
ListModel, which is non-generic and has an ugly API. seems to work though.workarea()
, switched togeometry()
, hope that's the same.set_child()
instead ofadd()
append()
instead ofadd()
somehow removing Box children doesn't workyou need to be very careful when iterating to make remove work, since it seems to be a linked-list-like structure.size_allocate
signal, butrealize
is hopefully similarTODO