Author Topic: Gtk3 becomes default widgetset on Linux  (Read 7009 times)

zeljko

  • Hero Member
  • *****
  • Posts: 2004
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Gtk3 becomes default widgetset on Linux
« Reply #15 on: July 08, 2026, 08:02:08 pm »
It is mainly Wayland headache, not gtk3 or qt6.

dbannon

  • Hero Member
  • *****
  • Posts: 3889
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Gtk3 becomes default widgetset on Linux
« Reply #16 on: July 09, 2026, 02:48:36 am »
Q2: no. that requires a complete new architecture:
Although Lazarus goes a long way in making itself widget set agnostic, there are some problems to achieve that, because of the different signalling and messaging concepts between widget sets.
No, I disagree there Thaddy, the gtk2 components of FPC are really only there as an historical accident. There is no intrinsic or architectural reason why they reside in FPC. I think the debian people, who got very upset about that issue, demonstrated that pretty clearly. I think they also removed some Windows code too, but thats from memory and I sort of lost track of that whole process due to some private issue that have plagued me for the last 12 months.
Davo
« Last Edit: July 09, 2026, 03:24:09 am by dbannon »
Lazarus 4, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

PascalDragon

  • Hero Member
  • *****
  • Posts: 6430
  • Compiler Developer
Re: Gtk3 becomes default widgetset on Linux
« Reply #17 on: July 10, 2026, 09:59:25 pm »
Q2: no. that requires a complete new architecture:
Although Lazarus goes a long way in making itself widget set agnostic, there are some problems to achieve that, because of the different signalling and messaging concepts between widget sets.
No, I disagree there Thaddy, the gtk2 components of FPC are really only there as an historical accident. There is no intrinsic or architectural reason why they reside in FPC. I think the debian people, who got very upset about that issue, demonstrated that pretty clearly. I think they also removed some Windows code too, but thats from memory and I sort of lost track of that whole process due to some private issue that have plagued me for the last 12 months.

It does in principle make sense to have the units included with FPC, because this way one can simply use FPC to develop applications for those widgetsets without a third party download and without Lazarus involved. At least that was the idea back then. Nowadays I'd prefer to keep such units outside of the FPC distribution, so that they can also evolve independantly of FPC.

hamacker

  • Jr. Member
  • **
  • Posts: 61
Re: Gtk3 becomes default widgetset on Linux[Broadway?]
« Reply #18 on: August 07, 2026, 02:46:00 pm »
Hummm,

Starting with GTK 3, GTK introduced a new backend called Broadway. It allows GTK 3/4 applications to run inside a web browser without recompiling the application.

https://docs.gtk.org/gtk4/broadway.html

Now that GTK3 support is available in the Lazarus IDE, is it already possible to test Lazarus applications with the Broadway backend? Does it work, or are there still limitations?
« Last Edit: August 07, 2026, 02:53:02 pm by hamacker »

zeljko

  • Hero Member
  • *****
  • Posts: 2004
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Gtk3 becomes default widgetset on Linux
« Reply #19 on: August 07, 2026, 04:17:04 pm »
https://docs.gtk.org/gtk3/broadway.html is link for gtk3. I'm not so interested in broadway atm, so did not test it, but you can do that in a few minutes and write your experiment result here :)

Bart

  • Hero Member
  • *****
  • Posts: 5776
    • Bart en Mariska's Webstek
Re: Gtk3 becomes default widgetset on Linux
« Reply #20 on: August 07, 2026, 10:45:51 pm »
Just noticed that the items in dropdownlists in OI are almost unreadable (faint,  greyed).
Linux Mint 22.0 MATE, Lazarus main as of today.

Bart

hamacker

  • Jr. Member
  • **
  • Posts: 61
Re: Gtk3 becomes default widgetset on Linux
« Reply #21 on: August 10, 2026, 04:28:21 pm »
Probally I will try when in next version of Lazarus. But you can try if you have a linux desktop with any gtk app.

## Using GTK with the Broadway backend

Starting with GTK 3, GTK introduced a new backend called **Broadway**. With Broadway, GTK 3/4 applications can be displayed in a web browser within seconds, without recompiling the application.

See the official documentation:

https://docs.gtk.org/gtk4/broadway.html

### Using GTK with Broadway

The GTK Broadway backend allows GTK applications to be displayed in a web browser using **HTML5 and WebSockets**.

To run an application this way, you first need to start the Broadway server, `gtk-broadwayd`, which is included with GTK:

```bash
gtk4-broadwayd :5
```

Be careful with the display number. The default display is `:0`, which corresponds to port **8080**. Therefore:

* `:0` → port `8080`
* `:1` → port `8081`
* `:2` → port `8082`
* `:3` → port `8083`
* `:4` → port `8084`
* `:5` → port `8085`
* and so on.

In the example above, anything running on display `:5` will be available through port `8085`.

Open the following URL in your browser:

http://127.0.0.1:8085

The page will initially be empty because there is probably nothing running on display `:5`.

You can then start a GTK application on that display, for example:

```bash
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 nautilus
```

The application should now appear in the browser.

This is particularly interesting for testing GTK applications remotely or accessing GTK applications through a web browser without having to port or rewrite the application as a web application.


https://docs.gtk.org/gtk3/broadway.html is link for gtk3. I'm not so interested in broadway atm, so did not test it, but you can do that in a few minutes and write your experiment result here :)

PascalDragon

  • Hero Member
  • *****
  • Posts: 6430
  • Compiler Developer
Re: Gtk3 becomes default widgetset on Linux
« Reply #22 on: August 10, 2026, 07:44:48 pm »
Probally I will try when in next version of Lazarus. But you can try if you have a linux desktop with any gtk app.

Please use the forum's BBCodes instead of Markdown.

dbannon

  • Hero Member
  • *****
  • Posts: 3889
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Gtk3 becomes default widgetset on Linux
« Reply #23 on: August 11, 2026, 08:44:10 am »
Yep, it works with my gtk3 app, sizing of one window seems wrong with text overwriting. Some windows seem to be missing the title bar "decorations" like the close button.

But to me, surprisingly functional.  Not too sure what the use case is ....

Davo
Lazarus 4, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018