Recent

Author Topic: IDE Windows Centered  (Read 895 times)

sfeinst

  • Sr. Member
  • ****
  • Posts: 259
IDE Windows Centered
« on: January 29, 2026, 10:26:57 pm »
I don't know if this is specific to QT, but since I was trying this with QT, posting here.

I am running Debian Trixie using Gnome as desktop

I downloaded fpcupdeluxe and installed v4.0 of lazarus with fpc 3.2.2.  I loaded Lazarus, and chose to rebuild the IDE but with QT6 widgetset.  I also tried downloading fpcupdeluxe qt version and installed the same (but fpcupdeluxe builds as qt instead of gtk when I use the qt version of fpcupdeluxe).

In both cases, when I startup the IDE, all windows are centered on the screen.  I moved them to their correct locations for me (main ide on top, object inspector on left, messages on bottom and editor in middle).  Closed the IDE and reopened, same thing.  All windows centered.

Am I missing a setting somewhere?  Does qt6 have issues with gnome and wayland?  Not sure what is going on.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6398
  • Compiler Developer
Re: IDE Windows Centered
« Reply #1 on: January 29, 2026, 10:32:22 pm »
Am I missing a setting somewhere?  Does qt6 have issues with gnome and wayland?  Not sure what is going on.

Very likely Wayland issues, cause Wayland does not support setting window positions (and while there's a feature request for a suitable protocol, the maintainer of the Gnome compositor already said that they're not interested in supporting it).
You can try to run Lazarus using X11 backend (I don't know which parameter you need to pass to Lazarus so that Qt picks the X11 backend) cause Xwayland has some additional functionality here to do window positioning nevertheless.

sfeinst

  • Sr. Member
  • ****
  • Posts: 259
Re: IDE Windows Centered
« Reply #2 on: January 30, 2026, 12:56:11 am »
Very likely Wayland issues, cause Wayland does not support setting window positions (and while there's a feature request for a suitable protocol, the maintainer of the Gnome compositor already said that they're not interested in supporting it).
You can try to run Lazarus using X11 backend (I don't know which parameter you need to pass to Lazarus so that Qt picks the X11 backend) cause Xwayland has some additional functionality here to do window positioning nevertheless.
Thanks,

Thought it might be Wayland.  Interesting gtk2 works ok.  I did try to rebuild Lazarus using gtk3 and had the same issue (actually a bunch of other issues too - but that would be a different thread).

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: IDE Windows Centered
« Reply #3 on: January 30, 2026, 03:07:53 am »
Very likely Wayland issues, cause Wayland does not support setting window positions (and while there's a feature request for a suitable protocol, the maintainer of the Gnome compositor already said that they're not interested in supporting it).
You can try to run Lazarus using X11 backend (I don't know which parameter you need to pass to Lazarus so that Qt picks the X11 backend) cause Xwayland has some additional functionality here to do window positioning nevertheless.
Thanks,

Thought it might be Wayland.  Interesting gtk2 works ok.  I did try to rebuild Lazarus [4.0] using gtk3 and had the same issue (actually a bunch of other issues too - but that would be a different thread).
Since you are already using fpcupdeluxe, can you test with Lazarus 4.4 + gtk3 and Lazarus Trunk + gtk3?

sfeinst

  • Sr. Member
  • ****
  • Posts: 259
Re: IDE Windows Centered
« Reply #4 on: January 30, 2026, 04:15:17 am »
I did try Lazarus trunk with gtk3.  A few issues (with centering being one).  My next thing to try is still using qt6, but I installed anchordocking for ide.  At least that way the Windows will be in their correct places.  I don't normally use the one window thing, but it is a compromise worth doing if qt6 works for the rest.  I'll be playing around with it.

tetrastes

  • Hero Member
  • *****
  • Posts: 768
Re: IDE Windows Centered
« Reply #5 on: January 30, 2026, 10:48:50 am »
Thought it might be Wayland.  Interesting gtk2 works ok.

Naturally, gtk2 doesn't have wayland backend.

tkramer3

  • New Member
  • *
  • Posts: 17
Re: IDE Windows Centered
« Reply #6 on: May 20, 2026, 01:18:18 pm »
This worked for me on Kubuntu 26.04 (KDE) with QT6:

on the command line:
export QT_QPA_PLATFORM=xcb;lazarus-ide

The environment variable QT_QPA_PLATFORM=xcb tells lazarus to use xwayland, the windows don't appear centered with that. xwayland has to be installed.

You can also use 'edit applications' and change this in the lazarus program field

Fred vS

  • Hero Member
  • *****
  • Posts: 3947
    • StrumPract is the musicians best friend
Re: IDE Windows Centered
« Reply #7 on: May 20, 2026, 01:24:48 pm »
This worked for me on Kubuntu 26.04 (KDE) with QT6:

on the command line:
export QT_QPA_PLATFORM=xcb;lazarus-ide

The environment variable QT_QPA_PLATFORM=xcb tells lazarus to use xwayland, the windows don't appear centered with that. xwayland has to be installed.

 :)

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

zeljko

  • Hero Member
  • *****
  • Posts: 1959
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: IDE Windows Centered
« Reply #8 on: May 20, 2026, 01:51:37 pm »
gtk2 and qt4 don't know anything about wayland. When an gtk2 or qt4 (our qt widgetset) starts wayland imediatelly redirects it to the xwayland. That's why it works for you. Also, if you set GDK_BACKEND=x11 for gtk3 or QT_QPA_PLATFORM=xcb for qt5 and qt6 widgetsets you'll get positioned windows because they use x11/xcb - XWayland in that case. gtk3,qt5 and qt6 under Wayland (so no backend env override) cannot position windows because of Wayland design.
« Last Edit: May 20, 2026, 02:00:37 pm by zeljko »

 

TinyPortal © 2005-2018