Recent

Author Topic: TSynCompletion pop-up position under qt5/6  (Read 201 times)

c600g

  • New Member
  • *
  • Posts: 48
TSynCompletion pop-up position under qt5/6
« on: June 02, 2026, 08:37:20 pm »
I have an application which uses TSynEdit with auto-completion using TSynCompletion. When the pop-up is displayed (after pressing [CTRL]+[SPACE]), the pop-up window is displayed in the center of the monitor under Qt5/6 widget sets. The Gtk2 widget set renders the popup correctly under the cursor position in the TSynEdit component.

This behavior can also be demonstrated in the Lazarus IDE when compiled for Qt5/6 and using it's built-in code completion. I'm using Lazarus 4.6 (built from source, branch lazarus_4_6) and FPC 3.2.2. OS is Fedora Linux 44 on x86_64.

Is this a libqt5/6pas issue or something else that is known?


zeljko

  • Hero Member
  • *****
  • Posts: 1958
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TSynCompletion pop-up position under qt5/6
« Reply #1 on: June 02, 2026, 08:44:21 pm »
That's wayland issue. Qt5 and Qt6 runs under wayland, gtk2 runs under XWayland (x11). That happens automatically.
Try to run your app with QT_QPA_PLATFORM=xcb ./myapplication and see if that works.

c600g

  • New Member
  • *
  • Posts: 48
Re: TSynCompletion pop-up position under qt5/6
« Reply #2 on: June 02, 2026, 08:51:34 pm »
That's wayland issue. Qt5 and Qt6 runs under wayland, gtk2 runs under XWayland (x11). That happens automatically.
Try to run your app with QT_QPA_PLATFORM=xcb ./myapplication and see if that works.

That did the trick, zeljko. So, this is a Wayland bug which must be fixed by the WM?

I take it this is because the pop-up window is truly a new window and not simply a child component contained on the form and thus inherits all of Wayland's privacy and security concerns around form positioning?

Is there any way to simply use a TList component on a form instead of an entirely new window?

Thanks very much for your assistance!

zeljko

  • Hero Member
  • *****
  • Posts: 1958
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TSynCompletion pop-up position under qt5/6
« Reply #3 on: June 03, 2026, 07:34:13 am »
Lazarus autocompletion form have correct positioning under wayland (gtk3,qt5 and qt6), so maybe you should check that code a bit. Borderless form (popup form under wayland), or various menus - popups, can be positioned inside transient parent, but normal forms cannot because of wayland design.

Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: TSynCompletion pop-up position under qt5/6
« Reply #4 on: June 03, 2026, 07:57:15 am »
That did the trick, zeljko. So, this is a Wayland bug which must be fixed by the WM?
It is not a bug in Wayland: it is how Wayland is designed!
But there were so many complaints that an additional API is (being) designed so that the many people with false pretences how Wayland should work can be accommodated.
That means three things:
- The Wayland designers are not the best in communication (meaning they forgot to mention that it breaks existing application code on a huge scale)
- Lazarus should not, better, can not fix that, aside from tricks
- Some of the core Wayland design is now -soon- lost because the rest of the world wants the old ways. (a Windowed compositor with control over position)

In principle, Wayland is a much better design, but the world is not ready to accept that, so Wayland is going retro.

I have to admit it took me quite some time to grasp that. I was one of the complainers.

Doesn't mean there are no bugs in Wayland, but this is not one of them.
« Last Edit: June 03, 2026, 08:11:02 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

c600g

  • New Member
  • *
  • Posts: 48
Re: TSynCompletion pop-up position under qt5/6
« Reply #5 on: June 04, 2026, 12:11:15 am »
For those of you using a tiling window manager, the TSynCompletion pop-up window will not behave as you expect (e.g. as a floating pop-up window). Instead, it will spawn another top level window which will case a tiling change.

If you want to prevent this, you'll likely need to write a rule for you window manager to recognize the "Completion" window as a floating window.

For hyprland, that involves adding the following line to .config/hypr/hyprland.conf:
Code: [Select]
windowrule = float on, match:title ^(Completion)$

I also use the Niri tiling window manager and will post the rule for that when I figure it out!

 

TinyPortal © 2005-2018