About Pen Support on Wayland

19 views
Skip to first unread message

Gonzalo Garramuño

unread,
May 28, 2026, 8:44:35 AM (4 days ago) May 28
to fltkc...@googlegroups.com
One of my users who is working on a feature, is really keen on getting
Pen/Tablet support on Wayland, and I just found out "mpv" (one of my
competitors :) already supports tablets.   Therefore, I decided to give
it a go with ClaudeAI to see if it could port the Cocoa code to Wayland.

The code it created was really nice, based on you guys excellent API. 
However it pinpointed to some issues in the current driver.  I can fix
the stuff and submit a PR if it would be accepted.  I don't have a
tablet myself yet, so I would need Greg, Matthias and my artist beta
tester to give it a thorough run.

Does that sound reasonable?

--
ggar...@gmail.com

melcher....@googlemail.com

unread,
May 28, 2026, 8:49:31 AM (4 days ago) May 28
to fltk.coredev
I am happy to take a PR for this. I do have the tablet, and I assume it'll work with the UTM emulator running Ubuntu un my Mac. So, yeah, I should be able to test the code.

If you have API improvement, please absolutely posy them here or in an issue report. We will release 1.5.0 in a few months, which will limit future changes to the API - or in other words, whatever we can change now is easy. It will be hard to change the API later. ;-)

Thanks for looking into this.

 - Matthias

Gonzalo Garramuño

unread,
May 28, 2026, 11:03:23 AM (4 days ago) May 28
to 'melcher....@googlemail.com' via fltk.coredev


El 28/5/26 a las 09:49, 'melcher....@googlemail.com' via fltk.coredev escribió:
I am happy to take a PR for this. I do have the tablet, and I assume it'll work with the UTM emulator running Ubuntu un my Mac. So, yeah, I should be able to test the code.

If you have API improvement, please absolutely posy them here or in an issue report. We will release 1.5.0 in a few months, which will limit future changes to the API - or in other words, whatever we can change now is easy. It will be hard to change the API later. ;-)

Added PR as #1451.  Actually, it was not an API improvement, just a code issue.

Let me know if you cannot get it compiled.

-- 
--
Gonzalo Garramuño
ggar...@gmail.com

Albrecht Schlosser

unread,
May 28, 2026, 11:26:33 AM (4 days ago) May 28
to fltkc...@googlegroups.com
Note that we did not yet decide if we allow AI generated code at all in FLTK. There are certainly some important reasons NOT to allow AI generated code, and I read in PR #1451 "Code by ClaudeAI untested". This woule preclude accepting this PR, if we didn't allow AI generated code.

My opinion on AI generated code (in a nutshell, not yet finally thought about):

CONTRA:

1. Copyright: we don't know where the code comes from, and whose copyright might be on that code (maybe several places with different copyrights/licenses). We can't claim our own copyright (as given in the code).

2. Maintainability: AI generated code can be complex (especially if events and third party libraries, e.g. Wayland core/protocol, come into play). Humans can't test and debug code they don't understand, etc. etc.

3. Coding Style: how do we ensure that the AI generated code follows our coding style?

4. Code quality: who can evaluate this before we would include it in the library?

5. Very likely much more ...

PRO:

1. Maybe easy to create, but: would this justify its usage, given the CON's above?


In this particular case: maybe Matthias can evaluate the code quality, but I'm not sure if this is enough. Another important point would IMHO be to document the question (task) that was given to the AI to generate this particular code.

More opinions would be appreciated, but we must definitely make a qualified decision about this topic before we begin to include AI generated code at all.

melcher....@googlemail.com

unread,
May 28, 2026, 1:05:06 PM (4 days ago) May 28
to fltk.coredev
Albrecht-S schrieb am Donnerstag, 28. Mai 2026 um 17:26:33 UTC+2:
maybe Matthias can evaluate the code quality, but I'm not sure if this is enough. Another important point would IMHO be to document the question (task) that was given to the AI to generate this particular code.

None of the code posted will go into master unread, untested, and unfixed. Even with human written patches, I tend to rewrite large parts to match style and make them maintainable (to the best of my abilities). I have no way of checking if contributed code is free of copyrights, neither with AI nor with human contributed code.

Gonzalo Garramuño

unread,
May 28, 2026, 2:26:58 PM (4 days ago) May 28
to fltkc...@googlegroups.com


El 28/5/26 a las 12:26, 'Albrecht Schlosser' via fltk.coredev escribió:
Note that we did not yet decide if we allow AI generated code at all in FLTK. There are certainly some important reasons NOT to allow AI generated code, and I read in PR #1451 "Code by ClaudeAI untested". This woule preclude accepting this PR, if we didn't allow AI generated code.
Sounds fair.

My opinion on AI generated code (in a nutshell, not yet finally thought about):

CONTRA:

1. Copyright: we don't know where the code comes from, and whose copyright might be on that code (maybe several places with different copyrights/licenses). We can't claim our own copyright (as given in the code).

This is indeed one issue that we agree on.  I do hold the belief that copyright cannot be completely thrown out the window just yet, as both artists and coders could be easily taken advantage of, specially by big corporations.  Someone that is creative (whether as artist, coder or both) should be allowed to benefit from his creation, specially if it brings joy to the world.  

When I started coding with the help of AI, I did ask in some occasions to the different chat bots whether they infringed on the copyright.  They denied it.  I could not verify it either way.  I could only catch Gemini infringing on the copyright when it came to YouTube.  But I also do give them credit for trying not to.  When I asked Gemini for the lyrics of "Los castillos se quedaron solos", they quickly showed a different (albeit similar) lyric.  However, when I asked them about a YouTube video that had uploaded it without permission and asked for the lyrics from it, the engine showed the real lyrics.  Gray area.

Nowadays my belief is that all chatbots are no longer infringing on copyright.

2. Maintainability: AI generated code can be complex (especially if events and third party libraries, e.g. Wayland core/protocol, come into play). Humans can't test and debug code they don't understand, etc. etc.

This I partially agree, but these days it highly depends on what Chatbot you are using (and whether you are *paying* for the generated code) and each chatbot keeps improving each day.  As of today, ClaudeAI is the best free coding choice for *me*.  It allows you to switch to different models (so you regulate yourself), it writes simple code to follow, generate explanations (both in the code and in the response), knows FLTK and python well enough (at least up to v1.4) and most people in the VFX circles I work on prefer it.  The catch with the free ClaudeAI is the context and time window they have.

ChatGPT excels at explanations and translations of .po files.  It is the one that knows literature the best and common answers to everyday affairs (legal and medical issues, etc).  When most people think of AI, they think of ChatGPT.  ChatGPT, in general, teaches you and does not give you code in general (at least for free).  The good thing about ChatGPT (at least outside the US) is that it has no time limit (at least for me).  It is my go AI for starting a project.

GrokAI is the fastest at giving you working code, unlike ClaudeAI which can take minutes to answer.  It also knows how to go to public repositories with the user's permission.  But with the transition to/from SpaceX, the quality of the code suffered and I do agree its code is now unmaintainable.  We'll see how they do from now on, as according to the AI news I get, they now rent their servers to ClaudeAI too.

Gemini also does not have a time limit (at least for me).  They excelled at FLTK knowledge, as they pinpointed ManoloFLTK's answer in the issue I posted about programmatically moving the windows.   They went further than ClaudeAI providing a working (partial) solution but I needed to know more about the innards of FLTK Windows API to tell. 

Perplexity: they were the first to put Google to shame in searches, by linking answers and ranking AI pages. 

Co-Pilot: never tried it as it does, afaik, have a web page.

Deepseek: again.  Never tried it.  Unfortunately, I do not speak Chinese and I am too old to learn it.


3. Coding Style: how do we ensure that the AI generated code follows our coding style?

This is a non-issue with ClaudeAI.  It generates code tailored in the style of FLTK or camel case when you feed a sample of it.


4. Code quality: who can evaluate this before we would include it in the library?
In this case, both I and Matt.  Manolo can also chime in, since he is the Wayland expert (actually, Manolo scares me as he knows every OS API and writes excellent code.  His emoji code was stellar :)

PRO:

1. Maybe easy to create, but: would this justify its usage, given the CON's above?

Except for the torn about copyright/legal issue, I would say yes.  Computers were created to simplify tasks (typing originally).  Programming *IS* hard.  Particularly in highend languages like C++, rust and assembler.  

Nowadays Chatbots can generate code that is better and simpler than most programmers (certainly they have surpassed me.  They have not surpassed Manolo, Linus, or yourself in CMake yet).

I want to live in a future where anyone creative can create a new software to solve a problem or a new piece of art to share with people.


In this particular case: maybe Matthias can evaluate the code quality, but I'm not sure if this is enough. Another important point would IMHO be to document the question (task) that was given to the AI to generate this particular code.

I can provide you with the prompt if you want.  I did not delete it yet.
More opinions would be appreciated, but we must definitely make a qualified decision about this topic before we begin to include AI generated code at all.

There's two things you forgot:

1) Job losses.  This is a true concern, too, specially on developed countries where the cost of living is higher than in others.  Everyone is looking for a solution but I think we are all trying to create and come up with new jobs and ideas, without actually scre** your fellow person.   Corporations, at least in the US, do screw other with new technology and people have a hard time to keep up.
We need guys like Steve Jobs (good pun on his name), Bill Gates (so he opens the doors to the money), etc.  or nowadays... the OpenClaw guy who was the first to have a great idea.   Just to name a few.

Let me tell you a story about coding or where I think coding is headed.  Back at DD, when I started, I learnt TCL in a day and improved one of the utilities of the facility.  After Titanic, I wanted to get access to a C compiler, as I already knew the language from learning it in Argentina.  C compilers were also expensive.  The head of the software department at the time (won't mention his name) was extremely opposed to it.  And, some of the arguments against it were similar to the ones you mention regarding AI.  My code would be unmaintainable, I would not know about the legal implications, etc.  All valid points (still to today), but.... my code worked and made artists happier for the time being.  Eventually something better would come along or I would move on.  In the US, where free competitio rules, this brings progress.  

2) Climate change.  This is to me, the most important CON against AI, more than copyright.  We just don't realize or know for sure how bad Earth is suffering and in what shape will the new generations receive it.  This is really the one issue that can lead to a third world war and/or the extinction of humanity as we know it. It can also lead to a "judgment day", where people like me who abused of AI will need to be accountable for it.

melcher....@googlemail.com

unread,
May 28, 2026, 7:48:58 PM (4 days ago) May 28
to fltk.coredev
OK, I looked at the code and it is really good. Some features are above C++11, but nothing that can't be downgraded. The remarks about missing API and a base class are absolutely correct and should be fixed. 

I have not tested any of the code yet, but I will have my tablet over the weekend. It would be a total waste of time to rewrite this from scratch.

All previous concerns are valid for a concerned individual. For AI, I had to suppress some of my issues, and I try to see it like this: AI is already a new industrial revolution. Just like mechanical vs manual labor, the invention of the steam engines, the automatic loom, assembly lines, and the internet itself, AI will cost a lot of jobs, and it will create other jobs. 

Yes, copyrights were violated for making LLMs, yes, AI is overused, yes, we are in the middle of the Hype Cycle, drifting from "Peak from Inflated Expectations" quickly into the "Trough of Disillusionment". But not taking part would give others the advantage. 

As for resources, mainly energy and water: the kind of AI that we are using here for coding can also surprisingly fast and in great quality locally on my laptop. The data centers that are currently being built are not for our few lines of FLTK code. They are built for mass surveillance by video analysis and for breaking the encryption of our chats and social media (/s). Rewriting FLTK from scratch using AI would probably use less resources than driving a week to work in a Tesla(*).

(*) I decide to calculate that: FLTK's source code is about 1'000'000 words in `FL` and `src` according to `wc`. Ollama with qwen 3 .6 runs at 50 tokens per second on my machine. Let's say 50 tokens are enough to write a single word of source code (it's probably less), then we need 277 hours to rewrite FLTK from scratch. My laptop runs at 96W maximum, 277*96 = 26 kWh, or 120km - a quarter charge - in a Tesla Model 3. For me, that's 3 days to work and back in my car.

Reply all
Reply to author
Forward
0 new messages