Recent

Author Topic: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu  (Read 1489 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2669
    • UVviewsoft
Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« on: October 02, 2025, 03:40:42 pm »
GNOME Clipboard Indicator by Tudmotu ('app'), used with 3 versions of simple SynEdit-demo (it is attached).

- gtk2, qt5: 'app' CAN insert the text.
- qt6: 'app' CANNOT insert the text, only Insert/Overwrite keyboard mode (ie caret shape) is toggled instead.

Reported by user on
- Ubuntu 24.04.3 LTS GNOME 46 X11, Linux 6.8.0-84-generic
- GNOME Clipboard Indicator by Tudmotu v 46
« Last Edit: December 05, 2025, 11:28:22 am by AlexTP »

dbannon

  • Hero Member
  • *****
  • Posts: 3647
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Qt6: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #1 on: October 04, 2025, 01:43:42 am »
Yes, to m surprise I an reproduce this.

On my Debian Bookworm, Mate desktop and Diodon clipboard manager, pasting from the clipboard manager does not work for Qt6 apps, does work fine for Qt5.

Don't understand why I have not noticed this earlier ....

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

AlexTP

  • Hero Member
  • *****
  • Posts: 2669
    • UVviewsoft
Re: Qt6: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #2 on: December 03, 2025, 09:14:30 pm »
Zeljko, can you reproduce this? X11 session.

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #3 on: December 04, 2025, 07:48:00 am »
Please try the modification from the attachment - it's adapted to the latest trunk version. I think the problem is related to the topic: https://forum.lazarus.freepascal.org/index.php/topic,68624.0.html

Edit: Attached patch
« Last Edit: December 04, 2025, 07:50:32 am by paweld »
Best regards / Pozdrawiam
paweld

AlexTP

  • Hero Member
  • *****
  • Posts: 2669
    • UVviewsoft
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #4 on: December 04, 2025, 03:11:45 pm »
Patch 'clipboard utf8 patch.diff' did not help: Clipboard Indicator still cannot paste to cudatext, it only toggles the Insert/Overwrite mode in cudatext.

zeljko

  • Hero Member
  • *****
  • Posts: 1823
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #5 on: December 04, 2025, 04:18:33 pm »
You should take a look into qtobjects.pas , TQtClipboard implementation and writeln() mimetypes when paste is called, I don't have spare time now to debug cuda app.

AlexTP

  • Hero Member
  • *****
  • Posts: 2669
    • UVviewsoft
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #6 on: December 05, 2025, 11:11:08 am »
Pls don't mess with cudatext app, issue is OK repeatable with SynEdit-based demo, it is now attached to the 1st post!

zeljko

  • Hero Member
  • *****
  • Posts: 1823
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #7 on: December 05, 2025, 12:56:02 pm »
I don't use Gnome at all, patches are welcome.

AlexTP

  • Hero Member
  • *****
  • Posts: 2669
    • UVviewsoft
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #8 on: December 07, 2025, 12:51:13 pm »
Maybe David Bannon can debug this case?
 I cannot: I use old Ubuntu (22.x, to compile my apps for older LIBC), in which that Clipboard Indicator works differently (I don't see UI how to insert the text into my focused app; I only see the clipboard-icon on the top panel and it doesn't insert into my app).
« Last Edit: December 07, 2025, 02:30:28 pm by AlexTP »

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #9 on: December 07, 2025, 02:44:07 pm »
I'm not good enough in QT to fix this at the moment, but below is a workaround for the test application:
Code: Pascal  [Select][+][-]
  1. uses
  2.   LCLType;
  3.  
  4. var
  5.   ShiftDown, InsertMode: Boolean;
  6.  
  7. procedure TForm1.FormCreate(Sender: TObject);
  8. begin
  9.   ShiftDown := False;
  10.   InsertMode := SynEdit1.InsertMode;
  11. end;
  12.  
  13. procedure TForm1.SynEdit1KeyDown(Sender: TObject; var Key: Word;
  14.   Shift: TShiftState);
  15. begin
  16.   case Key of
  17.     VK_SHIFT: ShiftDown := True;
  18.     VK_INSERT:
  19.       begin
  20.         if ShiftDown then
  21.         begin
  22.           SynEdit1.PasteFromClipboard();
  23.           SynEdit1.InsertMode := InsertMode;
  24.         end;
  25.       end;
  26.   end;
  27. end;
  28.  
  29. procedure TForm1.SynEdit1KeyUp(Sender: TObject; var Key: Word;
  30.   Shift: TShiftState);
  31. begin
  32.   if Key = VK_SHIFT then
  33.   begin
  34.     ShiftDown := False;
  35.     InsertMode := SynEdit1.InsertMode;
  36.   end;
  37. end;

And from what I've noticed, if we replace TSymEdit with TMemo in the example, the problem does not occur.
Best regards / Pozdrawiam
paweld

dbannon

  • Hero Member
  • *****
  • Posts: 3647
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #10 on: December 15, 2025, 10:32:59 am »
Alex, this Tudmotu app, apparently a clipboard manager. Its not in the Ubuntu repos - is that because its been abandoned or just not approved by Gnome ?

Looks like it can be installed as a Gnone Shell Plugin, horrible process, don't want to waste the time if there is an easier way.

(every time I use Gnome for anything, I shake my head and wonder why it even exists ...)

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

AlexTP

  • Hero Member
  • *****
  • Posts: 2669
    • UVviewsoft
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #11 on: December 15, 2025, 10:43:14 am »
AI. That is all I know about the topic. :)

Q: how to install Gnome extension on Ubuntu 22.4: Clipboard Indicator by Tudmotu?
A:
Quote
Here’s a concise, step-by-step guide to installing the Clipboard Indicator GNOME extension by Tudmotu on Ubuntu 22.04 LTS:

1. Install GNOME Extensions Browser Connector

Open Firefox or Chrome and install the GNOME Shell integration browser extension.
Install the native connector:


sudo apt install chrome-gnome-shell


2. Enable GNOME Extensions

Restart your browser and visit extensions.gnome.org.
Make sure the browser extension is active (check your browser’s extensions).
3. Install Clipboard Indicator

Go to the Clipboard Indicator extension page. https://extensions.gnome.org/extension/779/clipboard-indicator/ .
Toggle the switch to ON to install it.
4. Enable the Extension

Open Extensions app (or run gnome-extensions-app in terminal).
Find Clipboard Indicator and enable it.
5. Restart GNOME Shell

Press Alt+F2, type r, and press Enter to restart GNOME Shell.

Tip: If you don’t see the extension, ensure you’re using GNOME Shell (not Unity or another desktop environment).

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #12 on: December 15, 2025, 11:14:43 am »
I spent some time working on this problem, and I managed to determine that the application (Clipboard Indicator by Tudmotu) sends Shift (#16) + Insert (#45) and application compiled in QT6 registers it. However, after sending #16, the ssShift flag is not set in ShiftState in LCL. Therefore, the contents of the clipboard are not pasted, and the editor behaves as if Insert had been pressed. For now, this has led me to the DeliverMessage function in the QTWidgets unit, and this is where I stopped. I don't have the time or knowledge to solve the problem at the moment. I will try to delve into the subject, but in some time. For now, you can use the workaround I mentioned above.

Edit: in QT5 and GTK2 targets, the ssShift flag is set.
« Last Edit: December 15, 2025, 11:22:32 am by paweld »
Best regards / Pozdrawiam
paweld

dbannon

  • Hero Member
  • *****
  • Posts: 3647
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Qt6 / X11: problem with GNOME Clipboard Indicator by Tudmotu
« Reply #13 on: December 16, 2025, 10:51:56 am »
OK, well, I have established that the same problem shows up on Linux Mate using the Diodon clipboard manager, again only when using Qt6 and SynEdit. 

So, its not a Gnome or Wayland or Tudmotu thing.

You have to be using the clipboard manager, selecting an item in it's list and expecting to see it pop up in the control with focus.

But this is a very busy time of the year and life will be even busier for me after XMas. So, cannot promise to put the time in.

Davo
Lazarus 3, 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