akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 203 forks source link

Wayland colorpicking #619

Open madjesc opened 3 years ago

madjesc commented 3 years ago
## Summary / How this PR fixes the problem? Implementing colorpicking in Wayland using libportal ## Steps to Test ## Screenshots ![image](https://user-images.githubusercontent.com/68037616/123692469-75aeb580-d81c-11eb-9c83-82ee528d70b4.png) ![image](https://user-images.githubusercontent.com/68037616/123692526-865f2b80-d81c-11eb-9bcb-93dd7d6c23fc.png) ## Known Issues / Things To Do

This PR fixes/implements the following bugs/features:

- Fixes #598
madjesc commented 3 years ago

It not works with the master update, fixing

madjesc commented 3 years ago

Now it works, using libportal 4.0 And now the Utils.ColorPicker class is not a window, is a class that emmits a signal when the colorpicking is done.

Alecaddd commented 2 years ago

@Mkefs Hi, thank you so much for your contribution. This is great, but indeed it shouldn't break this feature for X11 users, which are our primary target for now. Any chance of making this work for both?

madjesc commented 2 years ago

@Mkefs Hi, thank you so much for your contribution. This is great, but indeed it shouldn't break this feature for X11 users, which are our primary target for now. Any chance of making this work for both?

Ok, I'll try

Alecaddd commented 2 years ago

Converting this to a Draft PR since it's not ready for a full review or to be merged.

madjesc commented 2 years ago

It works in Xorg. Tested on Gnome 3.38 on Debian bullseye imagen

Alecaddd commented 2 years ago

Awesome, I'll review this later today. Thanks!

Alecaddd commented 2 years ago

The build is busted.

Alecaddd commented 2 years ago

@Mkefs you wrote Handle screenshot exception in the list of things to do. What did you mean by that? Is that still an actionable item you want to tackle?

madjesc commented 2 years ago

@Mkefs you wrote Handle screenshot exception in the list of things to do. What did you mean by that? Is that still an actionable item you want to tackle?

libportal pick_color_finish throws a GLib.Error if something went wrong. In ColorPicker.vala I don't handle this exception thus it does nothing when something wrong in libportal happens. Although it's harmless it should popup something to the user saying that something went wrong, or just log it to the console

// Libportal color picking finish 
// try {
GLib.Variant v = portal.pick_color_finish (result);
// } catch (GLib.Error e) { ... /* <-- Do something */ }
Alecaddd commented 2 years ago

I can deal with that, thanks. Another question. Is libportal available anywhere as an installable package with apt? I know it's kind of a silly question as we're fully transitioning to a full faltpak based build, but for those who locally build this via meson I'd like to avoid forcing them to manually install libportal.

madjesc commented 2 years ago

I can deal with that, thanks. Another question. Is libportal available anywhere as an installable package with apt? I know it's kind of a silly question as we're fully transitioning to a full faltpak based build, but for those who locally build this via meson I'd like to avoid forcing them to manually install libportal.

Via apt in debian no, in other distros like Void Linux, Arch and I think Ubuntu too, yes. In debian it's in the unstable branch.

madjesc commented 2 years ago

Ok, I will try to do it using libportal

mbfraga commented 2 years ago

Awesome stuff! I use wayland on my dev machine that I use for Akira...so this is quite nice :P Will review.

mbfraga commented 2 years ago

Works on wayland (what I use now). So it definitely gets my upvote.