GTK2 revival

For discussions about side projects, potential future projects or helper applications for Pale Moon.
User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

GTK2 revival

Post by Daemonratte » 2026-04-22, 07:34

Hey guys!
I'm probably not the only one who hates forced deprecation. Be it with python2, gtk2 or XUL. For python2 and XUL there's still development going on (tauthon and of UXP), but not for gtk2.
So I just decided that I'm going to do it, even if I'm not really a good or experienced coder.

repo: https://git.devuan.org/Daemonratte/gtk2-ng

I still managed to get rid of all the compilation errors when compiling with gcc14 and clang 21 (didn't test never versions yet) and I applied these three patches:
https://gist.github.com/Dudemanguy/d70734d5bdf82e79cbfb22894fac8a1b
https://aur.archlinux.org/cgit/aur.git/tree/0001-Lower-severity-of-XID-collision-warnings.patch?h=gtk2
https://aur.archlinux.org/cgit/aur.git/tree/0002-Stop-looking-for-modules-in-cwd.patch?h=gtk2

I also backported some fixes from Ardour's ytk (their gtk2 fork) and stefan11111's gtk2 fork

Current status:
  • Making it Y2K38-safe
  • Getting rid of all deprecation warnings
  • Patching it for NetBSD and backporting NetBSD-specific patches
  • Testing it on all kinds of hardware
  • Further modernisation without breaking ABI
Future plans:
  • Implement touch support and smooth scrolling from Ardour's ytk without breaking ABI, so Ardour can be compiled against gtk2 again
  • Heavily lobby for it's adoption in the BSD and systemdfree Linux world
  • Reimplement GtkMozEmbed for UXP, so this wonderful engine can be used in gtk2 projects

Here's how you can build it:
Instructions for installing it on the system

Code: Select all

touch README
autoreconf -fvi
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-xinput=yes
make -j"$(nproc)"
sudo make install
if you only want to test it, only use

Code: Select all

./configure --prefix=/TESTDIR --with-xinput=yes
make -j"$(nproc)"
make install
and change TESTDIR to another location

Then just test an application with (in this case leafpad)

Code: Select all

env \
LD_LIBRARY_PATH=/TESTDIR/lib \
GTK_PATH=/TESTDIR/lib/gtk-2.0 \
GTK_EXE_PREFIX=/TESTDIR \
/usr/bin/leafpad
Please try and report any bugs to me :)
Last edited by Daemonratte on 2026-04-22, 12:00, edited 1 time in total.

User avatar
ownedbywuigi
Fanatic
Fanatic
Posts: 247
Joined: 2026-03-09, 21:48
Location: United Kingdom

Re: GTK2 revival

Post by ownedbywuigi » 2026-04-22, 10:05

Stupid question, but is there like a vision for this fork? (as in do you have any plans for this fork aside from simply maintaining GTK2) Any new features or such?
Lead Dactyloidae developer.
Feedback needed! https://forum.palemoon.org/viewtopic.ph ... 30#p272630

User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

Re: GTK2 revival

Post by Daemonratte » 2026-04-22, 11:46

As I described above :D
Yes, I want to add the features the Ardour team added to ytk (their gtk2 fork). Right now those are smooth scrolling and touch support. Unfortunately the way they implemented it broke ABI. It's possible to implement those features while keeping compatibility.
I then want to make it possible to compile Ardour for gtk2 again (my fork specifically).

I actually said that here:
Current status:
  • Making it Y2K38-safe
  • Getting rid of all deprecation warnings
  • Patching it for NetBSD and backporting NetBSD-specific patches
  • Testing it on all kinds of hardware
  • Further modernisation without breaking ABI
Future plans:
  • Implement touch support and smooth scrolling from Ardour's ytk without breaking ABI, so Ardour can be compiled against gtk2 again
  • Heavily lobby for it's adoption in the BSD and systemdfree Linux world
  • Reimplement GtkMozEmbed for UXP, so this wonderful engine can be used in gtk2 projects
The ultimate vision of this fork is to keep gtk2 alive for software using it right now and to revive gtk2 versions of Gimp, Abiword, Gnumeric, Inkscape, Gnome2 and XFCE. Yes, I don't have to do this alone and no, Mate is not an option, because they use gtk3 now

User avatar
sofrosune
Hobby Astronomer
Hobby Astronomer
Posts: 18
Joined: 2023-11-04, 02:56
Location: Chile

Re: GTK2 revival

Post by sofrosune » 2026-04-22, 18:03

Please excuse my ignorance, but isn't gtk3 in the way Mate uses it very similar to gtk2, at least visually? If so, what will be the advantages of gtk2 and of gtk2 versions of programs? Thanks.

User avatar
Mæstro
Board Warrior
Board Warrior
Posts: 1140
Joined: 2019-08-13, 00:30
Location: Casumia

Re: GTK2 revival

Post by Mæstro » 2026-04-23, 02:22

As the original post says, many people, myself among them, dislike forced deprecation. We are interested not only in things looking old, but in keeping up methods and technologies which have proven their ability over the years. Why should anybody, in general, be forced to use the later version when the earlier has always worked for him?
Life is a fever dream Mæstro would enjoy.
All posts 100% organic. Ash is the best letter.
What is being nice online?
Debian 10 ELTS / Official PM build

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2560
Joined: 2018-05-05, 13:29

Re: GTK2 revival

Post by vannilla » 2026-04-23, 02:32

Can you change the file picker to bring it to 1995 standards? I mean having a thumbnail mode like, well, Windows 95.

User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

Re: GTK2 revival

Post by Daemonratte » 2026-04-23, 06:29

sofrosune wrote:
2026-04-22, 18:03
Please excuse my ignorance, but isn't gtk3 in the way Mate uses it very similar to gtk2, at least visually? If so, what will be the advantages of gtk2 and of gtk2 versions of programs? Thanks.
Exactly what Maestro said. Many people (including myself) absolutely hate gtk3. Plus, gtk3 runs much worse on basically any system I try (modern or old).
I never understood the appeal of forcing people to upgrade to a toolkit that consumes more RAM and runs worse. It also breaks some themes that you can still download and install from gnome-look.org.
Also, I'm not sure if it's related to gtk3, but since Gimp switched to that toolkit it likes to freeze my computer. Not only the program, but my entire computer. No matter how new the hardware is. That's why I want to fork Gimp too, because it's literally unusable for me rn.
vannilla wrote:
2026-04-23, 02:32
Can you change the file picker to bring it to 1995 standards? I mean having a thumbnail mode like, well, Windows 95.
Well, that's what themes are for :D
Keep in mind this should be a drop-in-replacement for people. They shouldn't notice any differences aside from encountering less bugs.
Besides, to my knowledge the file picker never really changed in gtk2

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2560
Joined: 2018-05-05, 13:29

Re: GTK2 revival

Post by vannilla » 2026-04-23, 10:58

Daemonratte wrote:
2026-04-23, 06:29
Well, that's what themes are for :D
Keep in mind this should be a drop-in-replacement for people. They shouldn't notice any differences aside from encountering less bugs.
Besides, to my knowledge the file picker never really changed in gtk2
Themes cannot add functional features that I know of.
I don't mean a visual change, I mean that if I use the scroll wheel or a menu entry, I can enlarge media thumbnails (like pictures and video stills) and maybe change the display from a list to a grid.
Ever used the Windows file picker? Its appearance changed but this feature existed since 1995 if not earlier. GTK itself had a feature request to implement this opened for something like 20 years for version 2 and implemented it around 2021 in GTK4.
And if you don't want to change the existing file picker because of backwards compatibility, can you add a new class, maybe called GtkFilePicker1995 just to be on the nose, that implements this old(!!!) behaviour? That way existing applications would not see any change but applications still in development like UXP can migrate from a useless picker to a proper one.

User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

Re: GTK2 revival

Post by Daemonratte » 2026-04-23, 11:11

vannilla wrote:
2026-04-23, 10:58
Themes cannot add functional features that I know of.
I don't mean a visual change, I mean that if I use the scroll wheel or a menu entry, I can enlarge media thumbnails (like pictures and video stills) and maybe change the display from a list to a grid.
Ever used the Windows file picker? Its appearance changed but this feature existed since 1995 if not earlier. GTK itself had a feature request to implement this opened for something like 20 years for version 2 and implemented it around 2021 in GTK4.
And if you don't want to change the existing file picker because of backwards compatibility, can you add a new class, maybe called GtkFilePicker1995 just to be on the nose, that implements this old(!!!) behaviour? That way existing applications would not see any change but applications still in development like UXP can migrate from a useless picker to a proper one.
Ah, my bad.
Yeah, I can do that :) I'll get back to you once I fixed all the compiler warnings and implemented Ardour's features.
I also want to eventually revive GtkMozEmbed so gtk2 software can embed Pale Moon's engine

User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

Re: GTK2 revival

Post by Daemonratte » 2026-04-24, 09:53

vannilla wrote:
2026-04-23, 10:58
Themes cannot add functional features that I know of.
I don't mean a visual change, I mean that if I use the scroll wheel or a menu entry, I can enlarge media thumbnails (like pictures and video stills) and maybe change the display from a list to a grid.
Ever used the Windows file picker? Its appearance changed but this feature existed since 1995 if not earlier. GTK itself had a feature request to implement this opened for something like 20 years for version 2 and implemented it around 2021 in GTK4.
And if you don't want to change the existing file picker because of backwards compatibility, can you add a new class, maybe called GtkFilePicker1995 just to be on the nose, that implements this old(!!!) behaviour? That way existing applications would not see any change but applications still in development like UXP can migrate from a useless picker to a proper one.
Btw, I already added the option to display from a list to a grid :) But I have to fix some bugs there

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2560
Joined: 2018-05-05, 13:29

Re: GTK2 revival

Post by vannilla » 2026-04-24, 11:19

Daemonratte wrote:
2026-04-24, 09:53
Btw, I already added the option to display from a list to a grid :) But I have to fix some bugs there
When I'll have some time I'll give it a go and see if it improves usability. Many thanks.

BenFenner
Keeps coming back
Keeps coming back
Posts: 909
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: GTK2 revival

Post by BenFenner » 2026-04-24, 14:15

vannilla wrote:
2026-04-23, 10:58
this feature existed since 1995 if not earlier [in MS Windows]
I distinctly recall this not being a thing in Windows 95. I don't think it was native to the OS until maybe WIndows XP. I'm quite sure Win95, Win98, Win98SE, and Win2000 lacked this abomination of a resource hog and security nightmare (responsible for one of the most famous Linux exploits back when people thought Linux was particularly secure).

But now I've looked it up and it seems Windows 98 introduced this feature (not surprised my memory was bad on this since I never enabled it, or disabled it immediately after any installs if enabled).
https://en.wikipedia.org/wiki/Windows_9 ... d_features

User avatar
Basilisk-Dev
Astronaut
Astronaut
Posts: 636
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: GTK2 revival

Post by Basilisk-Dev » 2026-04-25, 15:24

Daemonratte wrote:
2026-04-23, 06:29
Exactly what Maestro said. Many people (including myself) absolutely hate gtk3. Plus, gtk3 runs much worse on basically any system I try (modern or old).
Although I too prefer GTK2, I found that Basilisk compiled with GTK3 actually performed better on my primary desktop than Basilisk compiled with GTK2. Just an anecdote, but figured I'd mention it regardless. It did use very slightly more RAM (like maybe 25 MB) but it performed noticeably better.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

Re: GTK2 revival

Post by Daemonratte » 2026-04-25, 17:18

vannilla wrote:
2026-04-24, 11:19
When I'll have some time I'll give it a go and see if it improves usability. Many thanks.
With pleasure :D It's somewhat broken at the moment though. I'll fix it once I got rid of all the deprecation warnings.
Basilisk-Dev wrote:
2026-04-25, 15:24
Although I too prefer GTK2, I found that Basilisk compiled with GTK3 actually performed better on my primary desktop than Basilisk compiled with GTK2. Just an anecdote, but figured I'd mention it regardless. It did use very slightly more RAM (like maybe 25 MB) but it performed noticeably better.
I noticed the same in Pale Moon, actually, but maybe this can be improved. It would be interesting to retest Basilisk after modernizing the GLib, Pango, GdkPixbuf, and Cairo integration in gtk2-ng.

Lucio Chiappetti
Keeps coming back
Keeps coming back
Posts: 919
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: GTK2 revival

Post by Lucio Chiappetti » 2026-04-25, 19:42

Personally I'm quite ready to suffer an unpleasant look and feel in something i use seldom. But for Pale Moon, which is always there on my desktop, after a firstr try with GTK3 I wnet back to use consistently the GTK2 version ... at least from 29.4.1 according to my notes. The reason is that I like a minimalistic look and fell like this
mypm.png
To achieve this something was done inside Pale Moon (like text-only buttons), but something had to be done outside (the font and gray colour) ... in the old X11-compliant time this would have been done with a a few .Xdefaults resources ... but with GTK2 it was a matter of I guess three lines in an 8-line .gtkrc-2.0
.
Definitely learning to program a theme would have been overshoot,
You do not have the required permissions to view the files attached to this post.
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1755
Joined: 2018-10-28, 19:56
Location: Georgia

Re: GTK2 revival

Post by athenian200 » 2026-04-25, 20:27

I mean, I don't want to say GTK2 doesn't have any historical value, but it should be noted that most of that value comes from the fact that so many projects used it and were designed around its quirks. It's not because GTK2 itself was great, or was the best toolkit ever. That would be like saying Chrome is a great browser because so many websites work well in it, while ignoring the fact that those websites were designed around its quirks. Or saying the same of IE6 back in the day for the same reason. I feel like it's mostly "good by comparison" in the sense that a lot of people are really unhappy with GTK3 and GTK4, but we really shouldn't let that distort our perception of how good GTK2 actually was, or how far it needs to be extended. My opinion? I would prefer a GTK2 revival to focus mostly on security updates and keeping existing software working as much as possible, I wouldn't want to try and extend it much or use it as the foundation of new projects.

I feel like this is one of those times where you had to be there before GTK2 and not have rose-tinted glasses. Back in the day, and I'm really showing my age here... I really did not like GTK1 or GTK2. My favorite toolkits on Linux were things like Motif and the FOX toolkit because they just worked and were very lightweight. GTK2 applications, by contrast... seemed to me to be fairly bloated and always annoyed me by pulling in GNOME components I didn't want. Yes, even back then, though it has gotten worse. The weakness of GTK2, IMO, was always how it was tied to the fate of GNOME 2 and wasn't really designed as an independent toolkit, which led to distros treating it as something for legacy GNOME environments rather than just something applications were written in. Because a lot of the GTK2 applications that died first? Those were the ones that needed tighter integration with GNOME 2, stuff like glib and all that. Those mostly died or transitioned to newer GTK early on, and people don't mourn them. All that's left are the simpler, tighter applications that needed only the toolkit by itself. There's definitely a bit of survivorship bias going on here.

So yes, on one hand, I'd like to see GTK2 kept alive enough for the applications that depended on it. But I'm somewhat doubting that it's a great idea to put a lot of energy into extending GTK2 or basing new projects on it. That would be giving it too much credit, nothing they really did with it made it that much better than other X11 toolkits (that said, I really agree with everyone's sentiments about Wayland and indeed see it as worse). So yeah, I'm in the weird place of being somewhat on board with not liking Wayland, but also thinking people view GTK2 way too positively because they haven't tried other X11 toolkits that weren't GTK3, and seen for themselves that it wasn't special.

From my perspective, GTK2 winds up being "the best" only in the sense that GNOME was dominant on Linux historically because of Red Hat, and thus it was once the biggest foundation a lot of people were building on and thus remembered by many. So it's only best that came out of the GNOME project, not truly better overall. The very fast that it's seen as the best toolkit Linux ever had just speaks to Red Hat's power and the fact that most have never seen anything that wasn't derived from GNOME, other than maybe KDE, and most users can't figure out KDE or find it overwhelming. A lot of good stuff was overlooked because of GNOME in the past. That allowed their developers to get complacent and arrogant later, because they knew they had no real competition, everyone had standardized on them, and users would have to take whatever they were given. That's how we got to GNOME 3 and 4 being the way they are with us having few good options besides forks of GNOME 2 like MATE. But what I'd honestly like? Something that's built from the ground up to be a solid, traditional desktop metaphor without any GNOME baggage or ties to a specific desktop environment. Maybe something that tries to go for a consistent, conservative appearance across Wayland and X11, treating them as different "platform targets" that have to be accommodated much like Windows and Mac are treated by cross-platform toolkits.

Anyway, I just thought I'd put my two cents in... carry on with the discussion, don't let me ruin the energy too much. I just thought I'd provide a different perspective.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Basilisk-Dev
Astronaut
Astronaut
Posts: 636
Joined: 2022-03-23, 16:41
Location: Chamber of Secrets

Re: GTK2 revival

Post by Basilisk-Dev » 2026-04-26, 19:02

athenian200 wrote:
2026-04-25, 20:27
My favorite toolkits on Linux were things like Motif and the FOX toolkit because they just worked and were very lightweight
FOX and Motif (and QT3/TQT3) are my favorite toolkits still. I also quite like FLTK. I experimented briefly with a FOX frontend for UXP, I was able to get some things like the file open dialog to fully work under FOX but ended up moving onto other things after a few weeks of tinkering with it.
Basilisk Project Owner

viewtopic.php?f=61&p=230756

gabrgv
Fanatic
Fanatic
Posts: 101
Joined: 2023-10-28, 18:59

Re: GTK2 revival

Post by gabrgv » 2026-04-28, 02:16

athenian200 wrote:
2026-04-25, 20:27
I would prefer a GTK2 revival to focus mostly on security updates and keeping existing software working as much as possible, I wouldn't want to try and extend it much or use it as the foundation of new projects.
Agreed. Even touchscreen and smooth scrolling support I can't see how could be desirable.
Off-topic:
Basilisk-Dev wrote:
2026-04-26, 19:02
FOX and Motif (and QT3/TQT3) are my favorite toolkits still. I also quite like FLTK. I experimented briefly with a FOX frontend for UXP
X Toolkit, Athena, Motif, Tk are mine. Yeah, port Basilisk to Motif or Tk and make it XDG-compliant. That is an order.

By the way, ever heard of Osiris, a fork of Qt2?

User avatar
Daemonratte
Hobby Astronomer
Hobby Astronomer
Posts: 27
Joined: 2026-03-12, 19:59

Re: GTK2 revival

Post by Daemonratte » 2026-04-28, 11:29

vannilla wrote:
2026-04-24, 11:19
When I'll have some time I'll give it a go and see if it improves usability. Many thanks.
Alright, just for you I fixed each and every bug I could find and heavily optimised the icon view to be MUCH more responsive. You can also change the size by holding ctrl and using the mousewheel now. The only thing that's missing is translations for the new ui elements
Please try :)
athenian200 wrote:
2026-04-25, 20:27
I mean, I don't want to say GTK2 doesn't have any historical value,....
Interesting how Gnome did "Gnome-things" even back then, lol. Well, when I entered the Linux world Gnome 2 was the default desktop of Ubuntu, so that's kind of what I grew up with and feel nostalgic for. That being said: I do plan to heavily optimise gtk2. Today I heavily worked on optimising the filechooser for example. In the end I want there to be a DE that's to Gnome2 what TDE is to KDE3.
gabrgv wrote:
2026-04-28, 02:16
Agreed. Even touchscreen and smooth scrolling support I can't see how could be desirable.
Because Ardour implemented it, so I have to implement it too. I want Ardour to use my fork in the future. That's why. It will definitely be optional and only used in software that actively implements it.
And yes, I heard about Osiris, hehe

User avatar
mittorn
Apollo supporter
Apollo supporter
Posts: 32
Joined: 2026-01-13, 19:32

Re: GTK2 revival

Post by mittorn » 2026-04-28, 16:23

I think, UXP does not need system toolkit for widgets at all. Native theme support is mostly hacked and only actual on windows/mac (because on linux gtk2 theme is not native anymore). For me, gtk2 draws comboboxes incorrectly and i using Moonscape theme over gtk anyway.
gtk3 themes are not native too (for gnome, native it libadwaita, i think, for kde gtk3 apps looks very ugly). And using toolkit only to pre-render components to get some non-native look is just extra overhead. Maybe it still needs system integration for native filepicker, but this might be done with kdialog/zenity or xdg-desktop-portal, not linking some toolkit directly. And without it there is XUL filepicker.
As experiment, i ported it to SDL2 and everything (except of some SDL2 limitations) works. I inherited windows look&feel and it looks same as windows classic theme (much better, than semi-broken gtk2 themes)
https://forum.palemoon.org/viewtopic.php?f=62&t=33066
I even implemented touchscreen support with full APZ (which does not seems to be fully async on all supported platforms now), so content might be scrolled while browser UI is busy
Only things that not supported in SDL2 is drag and drop (it's only supports receiving drags), rich clipboard and child widgets for NPAPI. Everything might be implemented bypassing SDL2 and using X11 widgets directly, or implemented widgets directly over X11.
If you want keep gtk2 alive only to support NPAPI, is not it better to implement native X11 support without extra gtk thing?