GTK2 revival

For discussions about side projects, potential future projects or helper applications for Pale Moon.
User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-01, 13:49

Hi there. Just for the sake of it I tried to build this Gtk2 project of yours. Apart from a few deprecations I got a warning about an implicit declaration, and then later on an error upon linking related to that declaration. Dunno how to fix this. :oops:
Running Linux Mint 19.2 (Ubuntu 18.04) with some backports, build tools GCC 9.5. Configuration log:
Gtk2-NG_configuration_log.zip
EDIT: Ah, it's probably due to Glib 2.72.4 missing g_sort_array. It's only available starting with 2.82. :( Can't install a newer glib unfortunately. Any workaround?

Code: Select all

gtkfilesystemmodel.c: In function ‘gtk_file_system_model_sort’:
gtkfilesystemmodel.c:804:7: warning: implicit declaration of function ‘g_sort_array’ [-Wimplicit-function-declaration]
  804 |       g_sort_array (get_node (model, 1), /* start at index 1; don't sort the editable row */
      |       ^~~~~~~~~~~~

[...]

./.libs/libgtk-x11-2.0.so: undefined reference to `g_sort_array'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:2962: gtk-query-immodules-2.0] Error 1

[...]

./.libs/libgtk-x11-2.0.so: undefined reference to `g_sort_array'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['/bin/bash', '../libtool', '--mode=link', '--tag=CC', 'gcc', '-o', '<project path>/Gtk2-NG/gtk/tmp-introspectfivxap7y/Gtk-2.0', '-export-dynamic', '-DG_DISABLE_SINGLE_INCLUDES', '-DATK_DISABLE_SINGLE_INCLUDES', '-DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES', '-DGTK_DISABLE_SINGLE_INCLUDES', '-g', '-O2', '-Wall', '<project path>/Gtk2-NG/gtk/tmp-introspectfivxap7y/Gtk-2.0.o', '-L.', 'libgtk-x11-2.0.la', '-lgio-2.0', '-lgobject-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lglib-2.0', '-lglib-2.0']' returned non-zero exit status 1.
make[4]: *** [/usr/share/gobject-introspection-1.0/Makefile.introspection:156: Gtk-2.0.gir] Error 1
You do not have the required permissions to view the files attached to this post.

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-02, 06:33

Basilisk-Dev wrote:
2026-04-30, 18:56
I got it working and am responding to you from a Basilisk build that is using gtk2-ng right now. The performance is definitely closer to a GTK3 build. All I had to do is set LD_LIBRARY_PATH to the folder where I installed gtk2-ng and it just worked. I didn't modify the build system, it just linked against my system GTK2. So your goal of maintaining ABI compatibility definitely works.

I ran into the issue that gtk2-ng did not include all of the GTK2 theme engines so my OS theme did not work. I'm not sure what the original GTK2 behavior was in this regard. I had to add the directory where my OS package manager has the GTK2 theme engines installed for my theme to the LD_LIBRARY_PATH as well for the theme to work. I did verify that it was still using gtk2-ng after that path to the LD_LIBRARY_PATH to verify that adding that directory didn't break gtk2-ng or cause the build to revert to system GTK2.
That's amazing! Thanks for testing! I'm going to make it even faster very soon :D

Regarding the theming engines:
I'm not at home right now, but this will be the next thing I'm going to take care of.
Drugwash wrote:
2026-05-01, 13:49
Hi there. Just for the sake of it I tried to build this Gtk2 project of yours. Apart from a few deprecations I got a warning about an implicit declaration, and then later on an error upon linking related to that declaration. Dunno how to fix this. :oops:
Running Linux Mint 19.2 (Ubuntu 18.04) with some backports, build tools GCC 9.5. Configuration log:
Gtk2-NG_configuration_log.zip
EDIT: Ah, it's probably due to Glib 2.72.4 missing g_sort_array. It's only available starting with 2.82. :( Can't install a newer glib unfortunately. Any workaround?

Code: Select all

gtkfilesystemmodel.c: In function ‘gtk_file_system_model_sort’:
gtkfilesystemmodel.c:804:7: warning: implicit declaration of function ‘g_sort_array’ [-Wimplicit-function-declaration]
  804 |       g_sort_array (get_node (model, 1), /* start at index 1; don't sort the editable row */
      |       ^~~~~~~~~~~~

[...]

./.libs/libgtk-x11-2.0.so: undefined reference to `g_sort_array'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:2962: gtk-query-immodules-2.0] Error 1

[...]

./.libs/libgtk-x11-2.0.so: undefined reference to `g_sort_array'
collect2: error: ld returned 1 exit status
linking of temporary binary failed: Command '['/bin/bash', '../libtool', '--mode=link', '--tag=CC', 'gcc', '-o', '<project path>/Gtk2-NG/gtk/tmp-introspectfivxap7y/Gtk-2.0', '-export-dynamic', '-DG_DISABLE_SINGLE_INCLUDES', '-DATK_DISABLE_SINGLE_INCLUDES', '-DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES', '-DGTK_DISABLE_SINGLE_INCLUDES', '-g', '-O2', '-Wall', '<project path>/Gtk2-NG/gtk/tmp-introspectfivxap7y/Gtk-2.0.o', '-L.', 'libgtk-x11-2.0.la', '-lgio-2.0', '-lgobject-2.0', '-Wl,--export-dynamic', '-lgmodule-2.0', '-pthread', '-lglib-2.0', '-lglib-2.0']' returned non-zero exit status 1.
make[4]: *** [/usr/share/gobject-introspection-1.0/Makefile.introspection:156: Gtk-2.0.gir] Error 1
Hey there! Yeah, I didn't expect people to use thus fork on older systems, because gtk2 is still available on basically any distro from the last 5 years.
This should be an easy fix though.

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-02, 06:59

Daemonratte wrote:
2026-05-02, 06:33
This should be an easy fix though.
Well, I'm no programmer by any means, just a nosy user, but according to the short chat I had with Duck AI it seems the only way to fix it for older Glib is to add a shim that implements g_sort_array by using other available functions. It did provide example code but it seems kinda... complicated. There's no direct replacement.

And that's not to say there wouldn't be some other show-stopper further on if that one would somehow get fixed. One never knows.

Anyway, that was just out of curiosity and nothing more since as you say older systems do provide Gtk2 natively, however your fixes/additions might come in handy even to users of such systems. It's not anything urgent though. :)

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-02, 07:10

I can add an if case where the compiler uses g_sort_array or g_qsort_with_data (which is what was originally used) depending on the glib version. Probably there are going to be more issues with glib versions (or rather, depending on if the function is available) though as I already replaced MANY deprecated functions.
I'll have to evaluate what's the oldest glib versions that I'm going to support.

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-02, 07:36

Daemonratte wrote:
2026-05-02, 07:10
Probably there are going to be more issues with glib versions though as I already replaced MANY deprecated functions.
You're probably right.
Daemonratte wrote:
2026-05-02, 07:10
I'll have to evaluate what's the oldest glib versions that I'm going to support.
Not trying to persuade you or anything but I can say I know someone who builds and provides backports for systems starting with Ubuntu Xenial which is earlier than Bionic (which my Mint 19 is based on). He owns 5 or 6 of such machines. At first I was baffled but then I realized that just as myself clinging on this 16 year-old notebook with its "obsolete" OS there may be many others around the world that do the same for their very own reasons. It would've been great if Linux didn't push this urge to upgrade to the "newest and shiniest" whatever, and instead would've focused on backward compatibility; by now it could've raised dramatically its user share, in my humble opinion, just as M$ did by allowing very old applications to run on [almost?] all newer versions of Windows. But I guess it's still about the money, whether it's Linux or Windows or Mac. :(

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-02, 08:44

May I ask what's keeping him on this old version? Because we're also going to revive gtk2 versions of LXDE, XFCE, GNOME2, Gimp and Inkscape :D
So you can run classic software with a modern kernel. Compatibility with NetBSD, OpenBSD and FreeBSD is also a huge priority. So that would also be an option

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-02, 09:01

Daemonratte wrote:
2026-05-02, 08:44
May I ask what's keeping him on this old version?
I think he said something about greater stability than newer versions. I suppose he knows what he's doing. Didn't get into much detail, I know very well how it is when people keep asking you «but why stick with that obosolete [insert hardware/software name] when there's newer and better [whatever]?». People usually have their strong valid reasons regardless of how those reasons may seem to others.

If you wanna check out his releases see here. (remove the Bionic filter in order to see all releases)

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-02, 10:29

I fully understand that, but the reason why l asked is: if it's just one thing holding him back then I might be able to patch that.
Imagine using up-to-date software, but without any performance penalty and more security and features
Last edited by Daemonratte on 2026-05-02, 12:16, edited 1 time in total.

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-02, 11:11

Daemonratte wrote:
2026-05-02, 10:29
I fully understand that, but the reason why I shared l asked is: if it's just one thing holding him back then I might be able to patch that.
Imagine using up-to-date software, but without any performance penalty and more security and features
Oh I'm sure he could fix issues himself. He's been backporting a lot of software for quite some time; I got many new versions from him on my system that otherwise wouldn't have been available for Mint 19/Bionic (Qt6, GCC 8+, a bunch of applications...). But as I said there may be many others that may need help, people that for some reason are forced to stick with old hardware/software, and who have no programming knowledge. It would be great if we knew at least the rough number of them but I guess it might be very difficult if not impossible. It's your choice how to deal with this. Personally I wouldn't want to force your hand in any way, just thought I'd mention what I know for sure.

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-03, 08:01

Drugwash wrote:
2026-05-02, 11:11
Oh I'm sure he could fix issues himself. He's been backporting a lot of software for quite some time; I got many new versions from him on my system that otherwise wouldn't have been available for Mint 19/Bionic (Qt6, GCC 8+, a bunch of applications...). But as I said there may be many others that may need help, people that for some reason are forced to stick with old hardware/software, and who have no programming knowledge. It would be great if we knew at least the rough number of them but I guess it might be very difficult if not impossible. It's your choice how to deal with this. Personally I wouldn't want to force your hand in any way, just thought I'd mention what I know for sure.
I fixed the issue you had with g_sort_array :)
Please try compiling again

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-03, 08:27

Daemonratte wrote:
2026-05-03, 08:01
I fixed the issue you had with g_sort_array :)
Please try compiling again
It worked. :) Thank you!

Now I should find a Gtk2 application to test it with. Hm, just built Pale Moon GTK2 yesterday, should be a good fit.
But first a couple questions:
1. Would it be OK to strip all newly built executables and libraries (while keeping their respective debug symbols)?
2. What exactly should I look for during testing; any particular function or behavior? (I don't have touch devices or anything so can't test that)

Oh and I've been getting a few deprecation warnings:
warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
Not sure whether it's in your code or not.

I see the compiler still uses headers from /usr/include/* - is that normal or should any build parameters/flags be changed? :?

EDIT: Actually here's the entire build process starting with updating repo code:
entire_build_process.zip
EDIT2: I knew it wouldn't be that easy... :( Another error popped up at runtime (although the application did start and is running):
Gtk-Message: 11:59:11.367: Failed to load module "atk-bridge": 'gtk_module_display_init': <destination>/gtk2ng-test/lib/gtk-2.0/modules/libgail.so: undefined symbol: gtk_module_display_init
Will try to test further, see what pops up ahead.
You do not have the required permissions to view the files attached to this post.

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-03, 09:54

Drugwash wrote:
2026-05-03, 08:27
It worked. :) Thank you!
Yee, awesome!
Drugwash wrote:
2026-05-03, 08:27
Now I should find a Gtk2 application to test it with. Hm, just built Pale Moon GTK2 yesterday, should be a good fit.
But first a couple questions:
1. Would it be OK to strip all newly built executables and libraries (while keeping their respective debug symbols)?
2. What exactly should I look for during testing; any particular function or behavior? (I don't have touch devices or anything so can't test that)
1. Yes, of course
2. Yeah, mainly behavior and if there's something "nice-to-have" you'd want to have
Drugwash wrote:
2026-05-03, 08:27
Oh and I've been getting a few deprecation warnings:
warning: ‘GTimeVal’ is deprecated: Use 'GDateTime' instead
Not sure whether it's in your code or not.
Yeah, I still need to get rid of all deprecation warnings. This is still going to take a while as the list is still really long.
Drugwash wrote:
2026-05-03, 08:27
I see the compiler still uses headers from /usr/include/* - is that normal or should any build parameters/flags be changed? :?
No worries, that's normal. GTK2-ng is using your system libraries for pango, glib, cairo, atk, etc
Drugwash wrote:
2026-05-03, 08:27
EDIT2: I knew it wouldn't be that easy... :( Another error popped up at runtime (although the application did start and is running):
Gtk-Message: 11:59:11.367: Failed to load module "atk-bridge": 'gtk_module_display_init': <destination>/gtk2ng-test/lib/gtk-2.0/modules/libgail.so: undefined symbol: gtk_module_display_init
Will try to test further, see what pops up ahead.
That's most likely caused by a mixed GTK module environment.
Try this:

Code: Select all

GTK2NG_PREFIX=/path/to/gtk2ng-test

env \
NO_AT_BRIDGE=1 \
GTK_MODULES='' \
LD_LIBRARY_PATH="$GTK2NG_PREFIX/lib:$GTK2NG_PREFIX/lib/x86_64-linux-gnu" \
GTK_EXE_PREFIX="$GTK2NG_PREFIX" \
GTK_DATA_PREFIX="$GTK2NG_PREFIX" \
GTK_PATH="$GTK2NG_PREFIX/lib/gtk-2.0:$GTK2NG_PREFIX/lib/x86_64-linux-gnu/gtk-2.0" \
/path/to/application

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-03, 10:16

OK, acknowledged everything above. :thumbup:

New app starting code works fine and clean, no more ATK Bridge error. I assume, if this version of Gtk2 would be installed system-wide such error would not pop up anymore for any Gtk2-dependent application. But for now I'll keep it separate in the test dir.
Daemonratte wrote:
2026-05-03, 09:54
if there's something "nice-to-have" you'd want to have
Yeah, about 40 years less. :lol:
Just [half] kiddin'. :D
Got no feature request for now, but I'll keep that in mind and chime in if/when I find something worthy of requesting. ;)

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-03, 10:20

Drugwash wrote:
2026-05-03, 10:16
New app starting code works fine and clean, no more ATK Bridge error. I assume, if this version of Gtk2 would be installed system-wide such error would not pop up anymore for any Gtk2-dependent application. But for now I'll keep it separate in the test dir.
Correct. Using it system-wide should not give you any errors :)
Drugwash wrote:
2026-05-03, 10:16
Yeah, about 40 years less. :lol:
Just [half] kiddin'. :D
Got no feature request for now, but I'll keep that in mind and chime in if/when I find something worthy of requesting. ;)
Noted xD

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-05-04, 03:12

Daemonratte wrote:
2026-05-02, 06:33
Regarding the theming engines:
I'm not at home right now, but this will be the next thing I'm going to take care of.
While we are on this topic, gtk2-engines has a theme (Redmond) I've been using for 10-15 years and it's had an insane bug this whole time where disabled checkboxes always show as checked.
After reporting it a few times throughout the years, I finally just tried to tackle it myself and managed to fix the bug. I also finally found the best place to report the bug (with patch code now!) which got rebuffed since gtk2 is apparently too old for the maintainers to give a crap about even though I served them up the fix on a platter.

So, if you're going to work on theme engines, do please give this a look and fix the Redmond theme for everyone.

https://bugs.debian.org/cgi-bin/bugrepo ... ug=1135360

Source file to modify:
/gtk2-engines-2.20.2/engines/redmond/src/redmond_gtk2_drawing.c



Existing code comment:

Code: Select all

/***********************************************
 * redmond_draw_check -
 *
 *   the Function used to draw all check boxes.
 *
 *   Redmond Check box has essentially 3 looks -
 *
 *   Normal/Prelight -
 *     base[NORMAL] fill, fg[NORMAL] check
 *
 *   Selected/Active -
 *     bg[NORMAL] fill, fg[NORMAL] check
 *
 *   Insensitive -
 *     bg[NORMAL] fill, fg[INSENSITIVE] check
 *
 *   The Shadow Always draws with a state NORMAL.
 ***********************************************/


Proposed replacement code comment:

Code: Select all

/***********************************************
 * redmond_draw_check -
 *
 *   the Function used to draw all check boxes.
 *
 *   Redmond Check box has 6 states represented with 5 visual combinations -
 *
 *   Enabled, Unchecked         – base[NORMAL] fill,              no check mark
 *   Enabled, Checked           – base[NORMAL] fill,      fg[NORMAL] check mark
 *   Enabled, Active, Unchecked –   bg[NORMAL] fill,              no check mark
 *   Enabled, Active, Checked   –   bg[NORMAL] fill,      fg[NORMAL] check mark
 *   Disabled, Unchecked        –   bg[NORMAL] fill,              no check mark
 *   Disabled, Checked          –   bg[NORMAL] fill, fg[INSENSITIVE] check mark
 *
 *   The Shadow always draws with a state NORMAL.
 ***********************************************/


Existing code:

Code: Select all

      if ((shadow == GTK_SHADOW_ETCHED_IN) || (state == GTK_STATE_INSENSITIVE))
        {
          /* force insensitive color for inconsistent checkboxes */
          do_redmond_draw_check (cr,
&redmond_style->color_cube.fg[GTK_STATE_INSENSITIVE],
                                 x + 2, y + 2, width - 4, height - 4);
        }
      else if (shadow == GTK_SHADOW_IN)
        {
          do_redmond_draw_check (cr,
&redmond_style->color_cube.fg[GTK_STATE_NORMAL],
                                 x + 2, y + 2, width - 4, height - 4);
        }


Proposed replacement code:

Code: Select all

      if (shadow == GTK_SHADOW_ETCHED_IN)
        {
          /* inconsistent – always show check */
          do_redmond_draw_check (cr,
&redmond_style->color_cube.fg[GTK_STATE_INSENSITIVE],
                                 x + 2, y + 2, width - 4, height - 4);
        }
      else if (shadow == GTK_SHADOW_IN)
        {
          /* checked – draw check */
          if (state != GTK_STATE_INSENSITIVE)
            do_redmond_draw_check (cr,
&redmond_style->color_cube.fg[GTK_STATE_NORMAL],
                                   x + 2, y + 2, width - 4, height - 4);
          else
            do_redmond_draw_check (cr,
&redmond_style->color_cube.fg[GTK_STATE_INSENSITIVE],
                                   x + 2, y + 2, width - 4, height - 4);
        }
      /* unchecked (shadow == GTK_SHADOW_OUT) – nothing to do */

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-04, 05:13

BenFenner wrote:
2026-05-04, 03:12
While we are on this topic, gtk2-engines has a theme (Redmond) I've been using for 10-15 years and it's had an insane bug this whole time where disabled checkboxes always show as checked.
After reporting it a few times throughout the years, I finally just tried to tackle it myself and managed to fix the bug. I also finally found the best place to report the bug (with patch code now!) which got rebuffed since gtk2 is apparently too old for the maintainers to give a crap about even though I served them up the fix on a platter.

So, if you're going to work on theme engines, do please give this a look and fix the Redmond theme for everyone.

https://bugs.debian.org/cgi-bin/bugrepo ... ug=1135360
You're awesome! I'll gladly accept it and I'm happy for any contributions :)
I'll first have to decide if I'm just going to include all theming engines into the repo or if I should keep them separate. In any case I'll definitely apply your patch!

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-05, 10:07

Talking about themes, it's funny but I have no idea how to install and change the theme for the testing build of Gtk2 - the one installed locally not system-wide.
Yesterday the whole day (and night) I fought with removing whatever deprecations I could, and also tried to apply Ben Fenner's patch to the Redmond engine/theme, but I have no idea how to install that - and other engines/themes I downloaded and built - so that they'd load when running application with that local Gtk2. :oops:

EDIT: Found out how to specify the theme at runtime.
Additionally to all other environment variables add GTK2_RC_FILES="<full/path/to/desired/theme/rc-file>".
Example: GTK2_RC_FILES="<gtk2-ng path>/share/themes/Redmond/gtk-2.0/gtkrc"
/EDIT

Oh and I also couldn't find any information online as to how to get GCC to ignore whatever it may see wrong in comment blocks, as there are too many warnings about that and it's difficult to sort through all those warnings. I did manage to make it silent, and only display warnings and errors but still there's much to sift through.

What I'm having trouble with are the remaining ATK calls that have no direct replacement - those related to focus_tracker and tracker_notify - and those related to get_text_before/at/after_offset which all seem to have been replaced with atk_text_get_string_at_offset but I suspect some of the parameters would have to be recalculated. There are also a few related to pango, gdk_pixbuf, and others but they may have to stay as they are.

Missing annotations are also a pest. :crazy:

Here's where I've gotten so far in terms of remaining issues:
Gtk2NG_remaining_build_issues.zip
You do not have the required permissions to view the files attached to this post.

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

Re: GTK2 revival

Post by Daemonratte » 2026-05-06, 19:02

BenFenner wrote:
2026-05-04, 03:12
While we are on this topic, gtk2-engines has a theme (Redmond) I've been using for 10-15 years and it's had an insane bug this whole time where disabled checkboxes always show as checked.
After reporting it a few times throughout the years, I finally just tried to tackle it myself and managed to fix the bug. I also finally found the best place to report the bug (with patch code now!) which got rebuffed since gtk2 is apparently too old for the maintainers to give a crap about even though I served them up the fix on a platter.

So, if you're going to work on theme engines, do please give this a look and fix the Redmond theme for everyone.

https://bugs.debian.org/cgi-bin/bugrepo ... ug=1135360
Hey Ben!
I finally included your patch! :D
Thank you so much again! Is this alright by you? I also applied the same fix to the radio buttons.
https://git.devuan.org/Daemonratte/gtk2 ... tk-engines

Here is the exact commit:
https://git.devuan.org/Daemonratte/gtk2 ... 9cc4ebe7f1
Drugwash wrote:
2026-05-05, 10:07
Talking about themes, it's funny but I have no idea how to install and change the theme for the testing build of Gtk2 - the one installed locally not system-wide.
Yesterday the whole day (and night) I fought with removing whatever deprecations I could, and also tried to apply Ben Fenner's patch to the Redmond engine/theme, but I have no idea how to install that - and other engines/themes I downloaded and built - so that they'd load when running application with that local Gtk2. :oops:

EDIT: Found out how to specify the theme at runtime.
Additionally to all other environment variables add GTK2_RC_FILES="<full/path/to/desired/theme/rc-file>".
Example: GTK2_RC_FILES="<gtk2-ng path>/share/themes/Redmond/gtk-2.0/gtkrc"
/EDIT
Hey Drugwash!
That's how I tested it too. But I'm pretty sure that analysing the AUR package will clarify how to install the engines.

Drugwash wrote:
2026-05-05, 10:07
Oh and I also couldn't find any information online as to how to get GCC to ignore whatever it may see wrong in comment blocks, as there are too many warnings about that and it's difficult to sort through all those warnings. I did manage to make it silent, and only display warnings and errors but still there's much to sift through.

What I'm having trouble with are the remaining ATK calls that have no direct replacement - those related to focus_tracker and tracker_notify - and those related to get_text_before/at/after_offset which all seem to have been replaced with atk_text_get_string_at_offset but I suspect some of the parameters would have to be recalculated. There are also a few related to pango, gdk_pixbuf, and others but they may have to stay as they are.

Missing annotations are also a pest. :crazy:
That's my focus too. There were countless deprecation errors when using autoreconf or configure as well, but I got rid of all of them yesterday :D
Also, you're going to like this: I added enough fallbacks in the code so that you can now compile gtk2-ng on everything from Debian Jessie (Debian 8) to modern Arch Linux ;)

Btw, do you have an online repo with your fixes? Or could you do a pull request on out repo maybe? :)
Be aware though that there are two important things to consider when getting rid of deprecation warnings:
Having fallbacks for older versions of glib, pango, pixbuf, etc
No extra ram usage, cpu cycles or bigger binaries, when possible. I want this to run well on old and new hardware.

User avatar
Drugwash
Lunatic
Lunatic
Posts: 384
Joined: 2016-01-28, 12:08
Location: Ploieşti, Romania

Re: GTK2 revival

Post by Drugwash » 2026-05-06, 20:44

Daemonratte wrote:
2026-05-06, 19:02
I'm pretty sure that analysing the AUR package will clarify how to install the engines.
Yeah, I think I got it. Downloaded a few from Ubuntu, and got them to build and install in Gtk2-NG. But I don't have themes to test all the engines.
Here they are:

Code: Select all

libcleanice.so
libclearlooks.so
libcrux-engine.so
libglide.so
libhcengine.so
libindustrial.so
libmist.so
libmoblin-netbook-engine.so
libmurrine.so
libpixmap.so
libredmond95.so
libsugar.so
libthinice.so
Daemonratte wrote:
2026-05-06, 19:02
There were countless deprecation errors [...] but I got rid of all of them yesterday
I'm curious what solutions you found for those that I left out (and the others that I allegedly fixed). Will clone your repo again in another folder and compare the files.
Daemonratte wrote:
2026-05-06, 19:02
Btw, do you have an online repo with your fixes? Or could you do a pull request on our repo maybe?
No repo for this one, I worked completely offline. I've always been a loner although at times I might've briefly hovered around certain individuals or groups. Slow Internet connection and old machines wouldn't help either. Besides, as much as I tried I could never understand how git works other than cloning some repo locally. I have a couple online repos (in my signature below) but I always used the browser interface to upload files, and it's a major PITA. Guess it's my brains' limitation.
Daemonratte wrote:
2026-05-06, 19:02
Having fallbacks for older versions of glib, pango, pixbuf, etc
No extra ram usage, cpu cycles or bigger binaries, when possible.
That's for professionals (like you, probably). I'm just happy to play around, see what I can tinker with, but serious stuff I leave to those who actually know what they're doing. :)

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-05-09, 22:47

Daemonratte wrote:
2026-05-06, 19:02
Hey Ben!
I finally included your patch! :D
Thank you so much again! Is this alright by you? I also applied the same fix to the radio buttons.
https://git.devuan.org/Daemonratte/gtk2 ... tk-engines

Here is the exact commit:
https://git.devuan.org/Daemonratte/gtk2 ... 9cc4ebe7f1
Thanks!

It looks good from here (although some odd whitespace in there).

I knew I should have looked harder at the radio buttons stuff below to see if it needed work. Thank you for confirming.