Re: gtk4.0

142 views
Skip to first unread message

Vadim Zeitlin

unread,
Aug 18, 2026, 6:19:52 PM (9 days ago) Aug 18
to wx-u...@googlegroups.com, wx-...@googlegroups.com
On Tue, 18 Aug 2026 07:29:27 +0200 'Gunter Königsmann' via wx-users wrote:

GK> In a news entry it was proposed that someone could ask an AI to port
GK> wxWidgets to GTK4.
GK>
GK> Don't know if that was meant seriously - but if yes:
GK> https://github.com/gunterkoenigsmann/wxWidgets/tree/claude/gtk4-wxwidgets-port-plan-pwo52u

I'm not actually sure who proposed this and where but, in principle, if a
LLM can do what we have failed to do since quite a few years, I'm not going
to refuse it. However the problem is that someone would still need to
maintain the resulting code base and if this someone is to be me, I'd need
to understand how it works.

GK> Still no guarantee if the result will ever be usable, but wanted to
GK> inform you that this try was started.

AFAICS from this repository it didn't tackle any of real issues yet, or
did it? Notably I see

> Window/child structure — this is the real hard problem

and I agree, and would like to know how is it going to be solved. Normally
I'd say "let's discuss this on wx-dev" but I'm not sure how to collaborate
with LLMs... Let me at least cc this to wx-dev (sorry in advance to people
who will have seen it twice) and let's continue this discussion there.

BTW, if we believe what it generated, painting might not be a problem at
all, which would be great news. But I didn't check it.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Gunter Königsmann

unread,
Aug 19, 2026, 6:44:36 AM (8 days ago) Aug 19
to wx-dev


On 8/19/26 00:19, Vadim Zeitlin wrote:
On Tue, 18 Aug 2026 07:29:27 +0200 'Gunter Königsmann' via wx-users wrote: GK> In a news entry it was proposed that someone could ask an AI to port GK> wxWidgets to GTK4. GK> GK> Don't know if that was meant seriously - but if yes: GK> https://github.com/gunterkoenigsmann/wxWidgets/tree/claude/gtk4-wxwidgets-port-plan-pwo52u I'm not actually sure who proposed this and where but, in principle, if a LLM can do what we have failed to do since quite a few years, I'm not going to refuse it. However the problem is that someone would still need to maintain the resulting code base and if this someone is to be me, I'd need to understand how it works.
It was the "Planning ahead" news post from December 15, 2025 and I read it when looking if there is anything in wxWidgets that wxMaxima still doesn't use but perhaps should. As I said I didn't know if I understood it right.
GK> Still no guarantee if the result will ever be usable, but wanted to GK> inform you that this try was started. AFAICS from this repository it didn't tackle any of real issues yet, or did it? Notably I see
Window/child structure — this is the real hard problem
and I agree, and would like to know how is it going to be solved. Normally I'd say "let's discuss this on wx-dev" but I'm not sure how to collaborate with LLMs... Let me at least cc this to wx-dev (sorry in advance to people who will have seen it twice) and let's continue this discussion there.

I tried to join that list but it did tell me that I still have no rights to post there.

The rest might be simpler than it looks:

  • One can discuss with a LLM like one can discuss with a person - except that the LLM tends to never be sure if asking it if something is possible is a polite instruction to do so. Actually porting wxWidgets was one of those misunderstandings: When I found out with the AI I get a virtual build system that is kinda fast I asked the AI if wxWidgets can be ported to GTK4 and went on holiday. The next time I looked it it had made the port ASAN-safe, cross-checked the GIR if it misunderstood an object ownership, made screenshots of the wxWidgets samples... ...if you send me questions I will forward them to the LLM and send you the answers. The only problem is that for this week I nearly have run out of AI credits => The answer might come only on Monday.
  • My plan is to test all the wxWidgets samples by hand and file issues against my repository for everything that port didn't get right. The LLM can work on github issues and loves documentation and structured approaches (if there is no structure it easily gets lost). Therefore it seems to like formal issue reports. 
  • I told the LLM to document all non-self-explaining code. Hope it actually did do so. But normally it does.
  • I will try to compile and test wxMaxima with that port: It is a big application that extensively uses wxDC.
  • And if I have spare LLM credits I will ask it to review the work again.
BTW, if we believe what it generated, painting might not be a problem at all, which would be great news. But I didn't check it. Regards, VZ
We will see: Normally if you tell Claude it didn't solve a problem and can provide it with enough symptoms of how the failure looks like it won't stop until the problem is solved. A year ago that approach would instead have caused most LLMs to halucinate and perform seemingly random changes at the codebase.

Kind regards,
    Gunter.

Vadim Zeitlin

unread,
Aug 19, 2026, 7:30:20 AM (8 days ago) Aug 19
to wx-...@googlegroups.com
On Tue, 18 Aug 2026 23:02:11 -0700 (PDT) Gunter Königsmann wrote:

GK> It was the "Planning ahead" news post from December 15, 2025 and I read it
GK> when looking if there is anything in wxWidgets that wxMaxima still doesn't
GK> use but perhaps should. As I said I didn't know if I understood it right.

Sorry, I completely forgot about writing this! It was mostly a joke but
any joke contains a kernel of truth and, as I said, if an LLM can do
something that we've been demonstrably unable to do, we should use it.

GK> I tried to join that list but it did tell me that I still have no rights to
GK> post there.

I've approved posts from you, hopefully there should be no more problems.

GK> - My plan is to test all the wxWidgets samples by hand and file issues
GK> against my repository for everything that port didn't get right.

I'd really like to understand what it did with wxWindow before moving
further. Could all the issues except for wxNativeContainerWindow be fixed?

Regards,
VZ

Gunter K�nigsmann

unread,
Aug 19, 2026, 4:33:47 PM (8 days ago) Aug 19
to wx-...@googlegroups.com


On 19 August 2026 13:30:16 CEST, Vadim Zeitlin <va...@wxwidgets.org> wrote:
>On Tue, 18 Aug 2026 23:02:11 -0700 (PDT) Gunter Königsmann wrote:
>
>GK> It was the "Planning ahead" news post from December 15, 2025 and I read it
>GK> when looking if there is anything in wxWidgets that wxMaxima still doesn't
>GK> use but perhaps should. As I said I didn't know if I understood it right.
>
> Sorry, I completely forgot about writing this! It was mostly a joke but
>any joke contains a kernel of truth and, as I said, if an LLM can do
>something that we've been demonstrably unable to do, we should use it.
>

Then I was right when I wasn't sure if it was a joke, but still looked if it can be done.

>GK> I tried to join that list but it did tell me that I still have no rights to
>GK> post there.
>
> I've approved posts from you, hopefully there should be no more problems.
>
>GK> - My plan is to test all the wxWidgets samples by hand and file issues
>GK> against my repository for everything that port didn't get right.
>
> I'd really like to understand what it did with wxWindow before moving
>further. Could all the issues except for wxNativeContainerWindow be fixed?
>

There is no glx for Gtk4, but we still have egl. Wayland seems not to allow us to grab the mouse pointer and to veto key presses. If you have ideas how to work around this we can tell it to the AI and it will make that happen; I told it if there are only x11 workarounds for it, but not for Wayland it is more honest to document that it doesn't work than an ugly workadound.

For the rest there seem to be no showstoppers. The AI checked after each change that gtk3 was unaffected and seems to make good decisions where a #ifdef saves from code duplication, where a compatibility wrapper is the best choice and where a separate file for GTK4 is better. Also I looked at the documentation and it seems nice and readable.

On the other hand we now have an initial port that requires testing: It was made by someone who has no eyes, no real mouse, excellent knowledge about programming, gtk3, Gtk4 and wxWidgets, who can summon someone who describes a screenshot and use xdotool for emulating clicks at coordinates that match that description but cannot generate "mouse enter" events. I therefore was impressed that all samples I tested so far had only few bugs that all for triggering required real mouse interaction. Most of the times resolving one of them resolves others I found along with it or allows to write a test that resolves whole classes of bugs => will have to try to trigger bugs and do visual testing in the following weeks so Claude gets to know what still is broken.
One thing that seems to work completely is the whole aui sample....will report back when I know more.

Kind regards,

Gunter.

Gunter Königsmann

unread,
Aug 19, 2026, 7:31:04 PM (8 days ago) Aug 19
to wx-...@googlegroups.com, Vadim Zeitlin

Hmmm... ...my response didn't appear on the list. But I have new news:

wxMaxima (which is a big application whose worksheet is entirely created by wxPaintDC) works fine with the port except of a few asserts that might or might not indicate a bug in wxMaxima.

../src/aui/framemanager.cpp(538): assert "Assert failure" failed in IsValid(): Center pane must have d
ock layer, row and pos set to 0
../src/aui/framemanager.cpp(538): assert "Assert failure" failed in IsValid(): Center pane must have d
ock layer, row and pos set to 0

Kind regards, 

       Gunter.

Vadim Zeitlin

unread,
Aug 19, 2026, 7:41:09 PM (8 days ago) Aug 19
to wx-...@googlegroups.com
On Thu, 20 Aug 2026 01:30:57 +0200 Gunter Königsmann wrote:

GK> Hmmm... ...my response didn't appear on the list.

I did get all of your replies seen on https://groups.google.com/g/wx-dev/c/7zNFe1TzY0I
Did you send anything else?

GK> But I have new news:
GK>
GK> wxMaxima (which is a big application whose worksheet is entirely created
GK> by wxPaintDC) works fine with the port

This is impressive. So is the GTK4 port actually already finished? I was
still at "let's discuss how to do it" stage...

GK> except of a few asserts that might or might not indicate a bug in
GK> wxMaxima.
GK>
GK> ../src/aui/framemanager.cpp(538): assert "Assert failure" failed in
GK> IsValid(): Center pane must have dock layer, row and pos set to 0

Yes, this assert was recently added because using anything else than 0 for
the center AUI pane doesn't make sense and probably doesn't behave as you
expect (whatever you expect).

Regards,
VZ

Gunter K�nigsmann

unread,
Aug 19, 2026, 8:10:11 PM (8 days ago) Aug 19
to wx-...@googlegroups.com
All responses arrived, I just seem to be learning how to use something basic like Google groups.

And the Gtk4 port definitely needs testing, but obviously is already in grade of running a big application. And the wxPaintDC stuff is extremely fast even on my very slow and old computer.

Kind regards,

  Gunter.

Gunter Königsmann

unread,
Aug 24, 2026, 2:00:47 PM (3 days ago) Aug 24
to wx-dev
I promised to report back. In the meantime Martin Kraus has not only donated computing and AI power but also real money for AI tokens. Now we have two AIs that fix the last few bugs,  review each other's work. The result feels quite stable by now. All samples work.
Additionally wxUSE_ACCESSIBILITY is no more windows only, but also runs on GTK4.

claude has found a few small bugs outside the gtk4 code. Will send them as separate patches so they can be reviewed individually. 

Kind regards ,
   Gunter.

Gunter Königsmann

unread,
1:01 AM (13 hours ago) 1:01 AM
to wx-dev
Martin has thrown in a 3rd AI that does review work. Meanwhile the number of bugs that I found has reduced to 3 => if https://github.com/gunterkoenigsmann/wxWidgets doesn't get human testers out of thin air we will soon run out of work and file a PR.

Kind regards,  
    Gunter

Vadim Zeitlin

unread,
10:08 AM (4 hours ago) 10:08 AM
to wx-...@googlegroups.com
On Wed, 26 Aug 2026 22:01:01 -0700 (PDT) Gunter Königsmann wrote:

GK> Martin has thrown in a 3rd AI that does review work. Meanwhile the number
GK> of bugs that I found has reduced to 3 => if
GK> https://github.com/gunterkoenigsmann/wxWidgets doesn't get human testers
GK> out of thin air we will soon run out of work and file a PR.

Hi,

I don't have any experience with this, but could you please ask your LLM
to create a series of PRs, with each one being of reasonable size? Maybe
also ask it to rewrite Git history in case there were any later corrections
that it would make sense to fold in earlier commits.

Personally I'm not ready to merge a 50000 line patch without review but
neither am I capable of actually reviewing it. Reviewing 10 5000 line PRs
might be doable, however.

Thanks,
VZ
Reply all
Reply to author
Forward
0 new messages