Bug 59 - GTK3 port
Summary: GTK3 port
Status: CONFIRMED
Alias: None
Product: Asunder
Classification: Unclassified
Component: All (show other bugs)
Version: 2.9.2
Hardware: PC Linux
: enhancement
Assignee: Andrew Smith
URL:
Depends on:
Blocks:
 
Reported: 2019-04-01 17:57 EDT by Salamandar
Modified: 2021-06-18 14:51 EDT (History)
5 users (show)

See Also:


Attachments

Description Salamandar 2019-04-01 17:57:01 EDT
tl;dr : https://github.com/salamandar/asunder
I ported Asunder to GTK3 tonight. Works fine. 
I tried to port to gtk4, but the documentation is not really complete.
Comment 1 Salamandar 2019-04-01 17:57:31 EDT
Oh, and I also removed Autotools on the way to use Meson.
Comment 2 Andrew Smith 2019-08-11 17:12:19 EDT
Hey

Sorry for taking so long to get to this.

I've no experience with the latest Gnome development stuff, last time I did a GTK3 port I was still using make.

All that to explain that perhaps you shouldn't be surprised that I was unable to build your port.

I installed meson and tried it, but got this output:

asunder-gtk3$ meson builddir
The Meson build system
Version: 0.45.1
Source dir: /home/andrew/data/prog/asunder-gtk3
Build dir: /home/andrew/data/prog/asunder-gtk3/builddir
Build type: native build
Project name: asunder
Native C compiler: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Native dependency gtk+-3.0 found: YES 3.22.30
Native dependency gthread-2.0 found: YES 2.56.4
Native dependency libcddb found: YES 1.3.2

meson.build:22:0: ERROR: Division works only with integers.

There's a / on line 22 but I don't know how to debug this.

I was hoping to see once I built it that the GTK3 problems I ran into previously were solved (in GTK3). The Gnome people were very dismissive of those bugs when I reported them.
Comment 3 Salamandar 2019-08-11 22:41:38 EDT
Hi,
No problem.
I was using a syntax introduced in meson 0.49, where you can concatenate paths with /. 
I removed them so that you can use your meson 0.45.
You can git pull and retry ;)
Comment 4 Andrew Smith 2019-08-12 22:24:34 EDT
Thanks

Oh boy. That's a lot of warnings :)

I guess they've deprecated gthread and everything that went with it? What are the chances that they'll actually remove it?

Are all the (void)varname; statements there just to shut up compiler warnings?

The UI seems to mostly work. I'm glad they sort-of-almost fixed the About dialog. I don't know why the underscores show up in the buttons, that's supposed to be handled by gettext. Just need to figure our the alignment and spacing in the main window. I guess the grid isn't exactly the same as a table?


Most of the changes don't look too scary, despite the size of the patch. They're going to take some effort to review and merge (especially with all those whitespace-only-change lines), but it's doable.

I'm not completely sold on GTK3, it's still not clear to me what the benefit is, other than a more modern theme. Though I guess eventually GTK2 will look about as good as Motif on a new installation :)

I wish it were possible to allow Asunder to build against either GTK2 or GTK3, but sadly the Gnome people deprecated a few things in GTK3 just to be annoying, making that practically impossible.

What do you think? What inspired you to make the port in the first place?
Comment 5 Salamandar 2019-08-13 08:10:49 EDT
Yeah, they deprecated the "mutex-like" thing. 

Some explanations are available here : 
https://github.com/xournalpp/xournalpp/issues/93
"The recommendation appears to be that we use gdk_threads_add_idle() on all secondary threads."

That will be somehow simple to implement when the code is only modifications of the interface. But for any "return calls" to the interface (getters and confirmation popups), I don't really know how it's supposed to be done.

Letting the choice between gtk2 and gtk3 would be just really difficult to do. Using one or the other has implications on the structure of the code. And as gtk2 is deprecated for some time now, gtk3 is a more solid library, for instance for themes support (yeah, i know, that's not a great argument).

About those space-only diffs, I'm gonna rebase and add a commit with all those space-only changes.
Comment 6 Andreas Rönnquist 2020-08-20 18:34:28 EDT
This bug was reported on the Debian asunder package recently:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967259

("asunder: depends on deprecated GTK 2")
Comment 7 Andrew Smith 2020-08-22 02:14:00 EDT
Thanks for sharing the link Andreas.

I like the details in that report, despite the author's sentiment.

It only reinforces my decision to stick with GTK2 all this time. A perfectly working, perfectly stable library which works just as well today as it did 15 years ago.

If I had been chasing the latest - I'd have spent countless hours porting to an unstable and poorly documented GTK3, only to hear (as I'm sure we soon will) that GTK3 is deprecated too and I now need to do all that all over again to move to GTK4. For no useful reason. No thanks.

I suspect that by the time GTK2 is no longer available - Asunder will no longer be a relevant application, and it can be removed from distributions without anyone noticing.
Comment 8 Andreas Rönnquist 2020-08-22 10:42:32 EDT
Thanks, that makes things crystal clear. I feel sorry for Salamandar above, whose work is useless now, since you have no interest in gtk3.

My thoughts on the whole deal is that I believe that a gtk3 to 4 migration would be easier, because I assume that the GTK team learns from their mistakes with the 2 to 3 migration and would like to make it easier. I also believe that there would be help from several people if you really wanted to make the conversion.

I'll guess I'll orphan the Debian package, since it obviously has no future in Debian (it might take some time before it is removed, but as the bug says, gtk2 is abandoned). I might pick it up if you convert asunder to gtk3 and no one else has picked it up, but that seems likely not to be happening.

Thanks you for all the time! It's a great project, and has been a pleasure maintaining in Debian.
Comment 9 Andrew Smith 2020-08-25 20:19:12 EDT
Hi Andreas

Thank you for spending so much of your time maintaining the Debian package and for your other contributions to Asunder.

No matter how awesome Asunder might be, it would not matter if people couldn't get it easily for their distribution. Thanks to people like you - that was possible. I would have never had the time to do it myself.

Have fun with your other endeavours!

Andrew
Comment 10 Kevin "Eonfge" Degeling 2020-09-03 02:01:42 EDT
I hope I'm not hijacking the discussion, but as he package maintainer on Flathub can keep Asunder around for those that want to use it, but that rather not have to many Gtk2 libs on their machine.

That said, Flatpakking works better with Gtk3. Now it happens that Asunder is a rather simple and straightforward program, so it's managable. Still, if the application were to migrate to Gtk3 (and use the GtkFileChooserNative), then that is actually quite an improvement for user security, as it supports native file portals and sandboxing.

As a Flathub volunteer, I can support both positions. Gtk2? We'll make it work. Gtk3? Even better.

Also, I have no doubt that Gtk3 itself will also be supported for 10 years after Gtk4 (inevitably) arrives. Moving to Gtk3 now will have you covered until 2030.
Comment 11 Andrew Smith 2020-09-03 19:21:56 EDT
The thing is I spent literrally a decade fixing bugs related to threads. Locks and things like that cause really hard to reproduce problems, so fixing them usually requires many bug reports and a long time.

With help from Gregory Margo all those were finally fixed, I haven't received a freezing Asunder bug report for years.

To now replace half the threading code with soon-to-be-deprecated GTK3 versions is asking for those bugs back. If there were some clear benefit to couter that - it might be worth the trouble, but so far I haven't seen enough such benefit.
Comment 12 Kevin "Eonfge" Degeling 2020-09-09 16:44:48 EDT
Some of the more important things: 
- Support for High DPI screens
- Support for Wayland 
- Support Native File Chooser (Beneficial to Flatpak)

but let's not rush. There is supposed to be more info relating to Gtk4 this autumn, and at the moment asunder does what it does well, so those few people left on the planet ripping CD's will likely not mind.
Comment 13 Manuel Grießmayr 2021-06-18 05:10:15 EDT
Hey Andrew, thank you very much for Asunder. It did a nice job for me all these years. Unfortunately now that I have a 4K monitor Asunder looks super small with all these tiny widgets because Gtk 2 doesn't support window scaling. When you fear threads so much why not write Asunder in Rust. Like they say - Hack without fear! Of course this is some work but I think you then can be pretty confident that the multrithreading works fine. No hassle just fun. Also there are Rust Gtk Bindings and Gtk 4 is available now too. I think the HiDPI support is a strong argument to make a port to Gtk 4. And motivation is very important too. This is where Rust comes in due to much better multithreading support, no data races, avoiding whole classes of memory bugs and so on.
Comment 14 Andrew Smith 2021-06-18 13:46:04 EDT
Hi Manuel

"some work" is quite an understatement. It would involve rewriting the entire application from scratch :)

And given the bugs in the Asunder list that I don't have time to deal with - that's completely impossible for me.
Comment 15 Kevin "Eonfge" Degeling 2021-06-18 14:51:02 EDT
It's worth noting that there is an experimental Asunder GTK 3 port:

https://gitlab.gnome.org/Salamandar/asunder

Now, I've tried contributing to this version so that it can be release-ready, but Salamandar doesn't seem to be too bothered in ironing out the last metadata related bugs. 

For reference, all the CD ripping worked well and if he were to remove the last few UI bugs, I would gladly publish it on Flathub under a different name. Asunder is obviously taken, and I'll not be part of any hostile take-over, but with a bit of polish it could be a proper CD Ripper using GTK 3.

Demo release of Asunder using GTK 3, from earlier this year
https://gitlab.gnome.org/Salamandar/asunder

Note You need to log in before you can comment on or make changes to this bug.