Re: Scintilla GTK 4 port

Colomban Wendling <[email protected]> Thu, 13 Nov 2025 11:24:50 +0100
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Hello Sergey,

Thanks a lot for this effort, it sounds very promising!  It also sounds 
like a lot of work, and trying to make it fit the GTK drawing model is a 
great news.

Kudos also for also trying to make it a more GTK-like widget, which can 
make Scintilla more welcoming for GTK developers.  Just in case it might 
be of interest, to you know of GtkSicntilla[1]?  It's quite old now, but 
it was an attempt at "GObjectizing" the API.

[1] https://github.com/codebrainz/GtkScintilla

Le 06/11/2025 à 10:31, Sergey Bugaev a écrit :
> […]
> 
> Another issue here is that Scintilla paints the background behind each
> piece of text individually as its own little rectangle; […]

Could these rander nodes be "compressed" on the widget's side?  It might 
be some work, but usually background is fairly uniform (but for a few 
specific pieces, like selection or specific ranges), so it might be 
worth trying to background nodes that share the same properties as a 
large drawing (or just paint the whole background with the most 
prominent value), and only keep specific nodes when that doesn't match. 
I don't know how hard/CPU intensive that would be, but it might help a 
bit, wouldn't it?
Of course that wouldn't necessarily solve everything, but it might be a 
first step.  And if then nodes could be snapped to pixels, that could 
fix the rendering issues of those specific areas -- without requiring 
more complex merge logic in the widget's side.

> […] I don't quite understand what is supposed to happen in
> this case on other platforms (a brief flash of black? a bunch of stale
> pixels from a previous frame?),

IIUC, while it depends on the platform, the idea is not to flip the 
double-buffer, and so leave the previous frame untouched.  Of course, 
depending on the implementation or the use of a double-buffer at all, 
this could indeed lead to a partially refreshed frame with stale 
portions, or an entirely blank frame -- the last being most problematic.

I don't know if there are case where the paint is abandoned but would 
result in *incorrect* drawing were it to continue, or if it's only an 
optimization not to waste time finishing a frame that will need updating 
anyway, though.  If it's just an optimization, possibly the abandonment 
could be inhibited in the GTK4 platform.

> […]
> * Accessibility, using GtkAccessible and GtkAccessibleText (when
> building with GTK 4.14 or later) interfaces. If you activate Orca the
> screen reader, it reads the text around cursor, the current selection
> etc

Thanks a lot for considering implementing a11y in this port!

> […]
> 
> ## Where Do We Go From Here?
> 
> I'm looking for people who are interested in Scintilla and GTK 4; if
> you are, please let me know! This port could use some more testing,
> and real-world usage beyond my own use cases. There is also still a
> lot to work on (accessibility, IME support, call tips,
> autocomplete...), let's hack on this together!

I am, and I guess the Geany community at large is :)  I however probably 
won't have time to properly dive in this just yet, but I'd be very 
curious to look at it whenever I get some time.  I might also be able to 
help more quickly on e.g. a11y -- not making promises.

Is there some code we can look at somewhere?

Also porting Geany to GTK4 won't be trivial even when Scintilla is 
entirely working, so it likely won't happen quickly, but giving it a try 
might be a interesting and educational, given it's a fairly 
comprehensive user (well, we don't use each and every feature, but still).

> […]
> 
> If you *don't* want this upstream, for one reason or another, are
> people nevertheless interested in this work, should I maintain a
> friendly downstream fork?

While I hope support would be upstreamed, yes, I would be interested 
either way.  Hopefully, and especially if you don't touch anything 
outside the platform layer itself, it would be easy to combine latest 
Scintilla with your platform layer even if they live separately.

Regards,
Colomban

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/c8d32087-4200-4d64-a894-5856c427c264%40herbesfolles.org.