Recent

Author Topic: Lazarus Main and Gnome/Wayland  (Read 1441 times)

dbannon

  • Hero Member
  • *****
  • Posts: 3856
    • tomboy-ng, a rewrite of the classic Tomboy
Lazarus Main and Gnome/Wayland
« on: June 05, 2026, 10:35:09 am »

I started putting in a Lazarus bug report but realised what I am saying probably needs some confirmation from other users. Its pretty harsh I am afraid.

Lets face it folks, everyone here hates Wayland, we choose to use Desktops that do not use Wayland but that is not the real world.  Right now, my tests indicate that Lazarus Main is not usable with Gnome. But Gnome is the default offering on Fedora, Ubuntu, Debian and Suse. The big four distro. Gnome is the largest user group in Linux world (1)

The main, "Project window", the one with the main menu and tool bars, is either difficult to resize or impossible. Forget about where it pops up, it cannot be used !

Using gtk3, the Proj Window will pop up with neither the width or height set to show all necessary controls. Its not possible to stretch it either to the right or down. Tested on Debian bookworm and Trixie, Ubuntu U2604 and Fedora 44 all Gnome.

Using qt5, it is better on U2604, the Proj Windows pops up in the center of screen but can be move to where it should be. But if you try to adjust its width, its 'top' position changes, often off screen. But on Fedora 44 its as above.

I fully understand that this is wayland at work (its fine on my Mate Desktop) but users, especially new, inexperienced users are being directed to use Gnome/Wayland, we cannot ignore that fact. It will not go away.

Please, if you are a Gnome user, pull down main and test it. If you don't use Gnome (very sensible) please consider bringing up a VM to test it.

My system may be the problem, there is already a gtk3 bug that apparently no one else can replicate (?). But these tests, on standard installs on a VMs should be system independent. I think.

Please don't say "it works OK on Mate|XFC|Cinnamon\etc" - it must work on Gnome !

(1) eg https://commandlinux.com/statistics/linux-desktop-environments/

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

zeljko

  • Hero Member
  • *****
  • Posts: 1987
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus Main and Gnome/Wayland
« Reply #1 on: June 05, 2026, 11:00:56 am »
Probably because mainbar is actually NOT resizeable when using undocked ide because it caclulates it's height automatically, so try to disable "Automatically adjust IDE main window height" and then try, that should work under wayland. 2nd thing I've already asked here https://gitlab.com/freepascal.org/lazarus/lazarus/-/work_items/42346#note_3424843208 is to try start with  GTK_OVERLAY_SCROLLING=0 ./YourLazarusInstallation to see if there's some discrepancy when using overlay scrolling under gtk3 wayland. Also, GNOME wayland works here w/o problems using docked Lazarus IDE. There's no way to position windows programatically under wayland, not because of LCL failure but because of wayland design.

dbannon

  • Hero Member
  • *****
  • Posts: 3856
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Main and Gnome/Wayland
« Reply #2 on: June 05, 2026, 12:24:33 pm »
Probably because mainbar is actually NOT resizeable when using undocked ide because it caclulates it's height automatically, so try to disable "Automatically adjust IDE main window height" and then try, that should work under wayland.
Yep, that fixed the inability to resize the proj window issue on both gtk3 and qt5. However, on gtk3, it cause the Proj Wizard (the window that pops up when there is no project loaded), to appear half beyond the left boundary. Not a good look. Especially for a first time user. I wonder why ?  Wayland wants them in the middle of the screen ?  This on Fedora ....

As expected, the height and width of the Proj Windows is remembered between restarts but position is, as Wayland decrees, lost. Thats not great but is both explainable and usable.

So, can we turn off "auto adjust ... height" when Wayland is detected ?

I'll chase up other issue in its Github place.

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

zeljko

  • Hero Member
  • *****
  • Posts: 1987
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus Main and Gnome/Wayland
« Reply #3 on: June 05, 2026, 12:38:44 pm »
Not wayland, but specific wayland compositor implementation wants them at screen center. Afaik qt5 and qt6 implementations are doing that, but eg weston does not.

Jonax

  • Jr. Member
  • **
  • Posts: 55
    • Jonax stuff
Re: Lazarus Main and Gnome/Wayland
« Reply #4 on: June 05, 2026, 01:01:31 pm »
I usually avoid Gnome. But did spawn a VM with Debian 13 and Gnome Wayland. Installed standard Lazarus 4.6.

Made a Hello Gnome program which ran fine. Screenshot attached.

Can confirm that trying to adjust that top mainbar is a horrible experience.
« Last Edit: June 05, 2026, 01:04:03 pm by Jonax »

zeljko

  • Hero Member
  • *****
  • Posts: 1987
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus Main and Gnome/Wayland
« Reply #5 on: June 05, 2026, 01:07:33 pm »
Can you provide screenshoot of lazarus about dialog ? I guess it is gtk2 IDE which runs under xwayland.

dbannon

  • Hero Member
  • *****
  • Posts: 3856
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Main and Gnome/Wayland
« Reply #6 on: June 05, 2026, 01:28:09 pm »
Yes, debian 13 will have a gtk2 Lazarus.

Jonax, you might like to pull down Lazarus Main (no need for git, just grab a zip) and build that, it will build fine with the FPC you have there using, in the top of the Lazarus dir -

Code: Pascal  [Select][+][-]
  1. $> make clean LCL_PLATFORM=gtk3 bigide
.... // maybe 60 seconds ?

Important if you don't want the new install messing with your existing config, tell it to put its config somewhere else -

Code: Pascal  [Select][+][-]
  1. $> echo "--pcp=../lazarusmain" > lazarus.cfg

Then, start it all up.

Code: Pascal  [Select][+][-]
  1. $> ./lazarus

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

Jonax

  • Jr. Member
  • **
  • Posts: 55
    • Jonax stuff
Re: Lazarus Main and Gnome/Wayland
« Reply #7 on: June 05, 2026, 03:55:16 pm »
Can you provide screenshoot of lazarus about dialog ? I guess it is gtk2 IDE which runs under xwayland.

Here the screenshot. Indeed it does say gtk2..

I'll make an attempt later to do the dbannon Main pull.

JgQDev

  • New Member
  • *
  • Posts: 12
Re: Lazarus Main and Gnome/Wayland
« Reply #8 on: June 05, 2026, 06:16:31 pm »
When your using Wayland and you try to debug your program on Lazarus, It breaks Lazarus entirely while on GTK it is rarely the case

dbannon

  • Hero Member
  • *****
  • Posts: 3856
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Main and Gnome/Wayland
« Reply #9 on: June 06, 2026, 03:40:52 am »
When your using Wayland and you try to debug your program on Lazarus, It breaks Lazarus entirely while on GTK it is rarely the case

You mean "while on GTK2" ? I'm guessing ?  The "2" is important, we should be using gtk3 but we all need to help zeljko get it tested !

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

dbannon

  • Hero Member
  • *****
  • Posts: 3856
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus Main and Gnome/Wayland
« Reply #10 on: June 06, 2026, 04:42:05 am »
I'll make an attempt later to do the dbannon Main pull.

Jonax, my script should make it easy. Follow couple of simple commands below. This assumes you have wget installed, if it fails, please install wget (its small and quick). I guess you do not want to make 'main' your default lazarus, respond with 'n' when asked about making a desktop file and a script to start.
Code: Pascal  [Select][+][-]
  1. $> cd ~/Downloads
  2.  
  3. $> wget https://github.com/davidbannon/FPC_Laz_Install/raw/refs/heads/main/make-lazarus.bash
  4. $> bash ./make-lazarus.bash -d -r -w gtk3 -v main
  5. .... a minute or so
  6. To start lazarus use menu or do the following -
  7.     cd /home/dbannon/bin/Lazarus/lazarus-main; ./lazarus <enter>
  8. $>
Obviously, your home dir will not be dbannon, you get the idea ! The -d says download (a zip) lazarus source file, you can repeat the run reusing that file as many times as you like. The -r says resolve any dependencies, your package manager will ask for your root password.

This will NOT affect your existing install as long a you answer 'n' to questions about the desktop file and the script to start lazarus. Just delete the dir under ~/bash/Lazarus for a complete cleanup.

Davo 

EDIT : corrected the url to download script, "raw" !
« Last Edit: June 08, 2026, 04:46:31 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

Thaddy

  • Hero Member
  • *****
  • Posts: 19472
  • Glad to be alive.
Re: Lazarus Main and Gnome/Wayland
« Reply #11 on: June 06, 2026, 05:33:51 am »
When your using Wayland and you try to debug your program on Lazarus, It breaks Lazarus entirely while on GTK it is rarely the case

You mean "while on GTK2" ? I'm guessing ?  The "2" is important, we should be using gtk3 but we all need to help zeljko get it tested !

Davo
Hear, hear, totally agree. Others: drop gtk2 asap.
Any "programmer" that knows only one programming language is not a programmer

Jonax

  • Jr. Member
  • **
  • Posts: 55
    • Jonax stuff
Re: Lazarus Main and Gnome/Wayland
« Reply #12 on: June 06, 2026, 03:27:35 pm »
I'll make an attempt later to do the dbannon Main pull.

Jonax, my script should make it easy. Follow couple of simple commands below. This assumes you have wget installed, if it fails, please install wget (its small and quick). I guess you do not want to make 'main' your default lazarus, respond with 'n' when asked about making a desktop file and a script to start.
Code: Pascal  [Select][+][-]
  1. $> cd ~/Downloads
  2. $> wget https://github.com/davidbannon/FPC_Laz_Install/blob/main/make-lazarus.bash
  3. $> bash ./make-lazarus.bash -d -r -w gtk3 -v main
  4. .... a minute or so
  5. To start lazarus use menu or do the following -
  6.     cd /home/dbannon/bin/Lazarus/lazarus-main; ./lazarus <enter>
  7. $>
Obviously, your home dir will not be dbannon, you get the idea ! The -d says download (a zip) lazarus source file, you can repeat the run reusing that file as many times as you like. The -r says resolve any dependencies, your package manager will ask for your root password.

This will NOT affect your existing install as long a you answer 'n' to questions about the desktop file and the script to start lazarus. Just delete the dir under ~/bash/Lazarus for a complete cleanup.

Davo

Thanks for your efforts Dave. As ususal I probably messed something up. Fortunately no problem since I did the VM. I think at some point the make was done. I got low power hardware so I guess it took a bit longer than a minute to make on my machine. Gnome is very confusing for me who's not used to it. But Gnome seems to pop up in many cases so it might be good have tried it. Anyway it seems I mixed in the old lazarus despite your warning. I think though a GTK3 build started. But that top window disappered. Here a screenshot from what I got. Clearly this combination is not very useable. Here comes a screenshot of the mess.

zeljko

  • Hero Member
  • *****
  • Posts: 1987
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus Main and Gnome/Wayland
« Reply #13 on: June 06, 2026, 03:48:06 pm »
That's pretty old gtk3 source as I can see. It is not trunk, and in laz 4.xx gtk3 is unuseable (alpha status).

Jonax

  • Jr. Member
  • **
  • Posts: 55
    • Jonax stuff
Re: Lazarus Main and Gnome/Wayland
« Reply #14 on: June 06, 2026, 04:42:48 pm »
That's pretty old gtk3 source as I can see. It is not trunk, and in laz 4.xx gtk3 is unuseable (alpha status).

Yeah. I guess you can see my attempts as an example of how a Linux and Lazarus noob experience this transition.
A bit like Dbannon hinted at. The sitaution being challenging for any new pascal programmers without experience of building and making the Lazarus.

From my perspective the GTK2 Lazarus was great, but I realize the GTK2 is going away.
I totally agree the laz 4.xx gtk3 is unuseable (alpha status).

And thanks for your efforts in making this work. Much appreciated.  :)

 

TinyPortal © 2005-2018