[SOLVED] Clipboard emptied as soon as the original app is closed 27 June 2021, 11:44:48 I'm a glad user of Artix LXQt and I noticed a weird bug, the clipboard is emptied as soon as I close the window from which I copied or cut from. Does anyone have an idea on how to fix that?I have a temporary workaround, I use the CopyQ clipboard manager from the Arch repos, it stores my clipboard so that I can retrieve if I mistakenly close the window in between.Thanks for any tips Last Edit: 28 June 2021, 15:38:47 by taxol
Re: Clipboard emptied as soon as the original app is closed Reply #1 – 27 June 2021, 13:46:11 The app is probably using the QT QClipboard class, which is deleted at program end. 1 Likes
Re: Clipboard emptied as soon as the original app is closed Reply #2 – 27 June 2021, 14:55:09 Installing a clipboard manager is the de-facto solution. It is going to do it's job more consistently. 1 Likes
Re: Clipboard emptied as soon as the original app is closed Reply #3 – 27 June 2021, 15:11:42 https://www.jwz.org/doc/x-cut-and-paste.htmlhttps://en.wikipedia.org/wiki/X_Window_selection 1 Likes
Re: Clipboard emptied as soon as the original app is closed Reply #4 – 27 June 2021, 21:58:29 Quote from: dxrobertson – on 27 June 2021, 13:46:11The app is probably using the QT QClipboard class, which is deleted at program end.Quote from: strajder – on 27 June 2021, 15:11:42https://www.jwz.org/doc/x-cut-and-paste.htmlhttps://en.wikipedia.org/wiki/X_Window_selectionThanks for those answers that ask even more questions, I wouldn't have expected it worked like that behind the scene. "At the level of the core protocol, the PRIMARY and CLIPBOARD selections do not differ. But the xclipboard client makes them behave differently. In particular, when another client asserts the ownership of the CLIPBOARD selection, this program requests and displays it in a window. Any further request for this selection are handled by xclipboard. This way, the content of the selection survives the client having copied it."So xclipboard isn't the culprit but this qt class is?Does anyone know the reasoning behing making the clipboard only survive the program from which it was filled? What can I do apart from the clipboard manager workaround? It's kind of unconvenient still because I need to select the last element and put it again in my clipboard to get access to it, instead of just doing ctrl+v.Thanks for any help and sorry if it's newbie level, I never tinkered with such things.
Re: Clipboard emptied as soon as the original app is closed Reply #5 – 27 June 2021, 22:19:46 Quote from: taxol – on 27 June 2021, 21:58:29Does anyone know the reasoning behing making the clipboard only survive the program from which it was filled? History and X Window architecture. 1 Likes
Re: Clipboard emptied as soon as the original app is closed Reply #6 – 27 June 2021, 22:23:17 Quote from: taxol – on 27 June 2021, 21:58:29Does anyone know the reasoning behing making the clipboard only survive the program from which it was filled? This comes down to the QT development platform. The QClipboard (as well as any instantiated object) is part of the application. And once the application ends, all its objects are disposed of. If the QClipboard was left available, there is nothing running to manage it (dispose of it) and that would be a memory leak. QClipboard is not meant to be a system wide, always available to everyone clipboard; thats what the various clipboard managers that others have mentioned do. Its more for an individual application to access the clipboard. 1 Likes
Re: Clipboard emptied as soon as the original app is closed Reply #7 – 28 June 2021, 15:38:23 Quote and that would be a memory leak. Makes a lot of sense. Well that was an interesting dive into the how it works. And the clipboard manager gives the functionality I expect anyway, thanks guys