Clipboard on GTK

28 views
Skip to first unread message

Fred

unread,
Aug 13, 2012, 3:43:08 AM8/13/12
to scintilla...@googlegroups.com
Hi,

On GTK, when the scintilla component is destroyed the copied clipboard text is discarded, which isn't the excpected behaviour. To solve this, just add:

gtk_clipboard_store(clipBoard);

after

gtk_clipboard_set_can_store(clipBoard, clipboardCopyTargets, nClipboardCopyTargets);

in ScintillaGTK.cxx

Fred

Neil Hodgson

unread,
Aug 13, 2012, 7:59:49 AM8/13/12
to scintilla...@googlegroups.com
Fred:

> On GTK, when the scintilla component is destroyed the copied clipboard text is discarded, which isn't the excpected behaviour.

On current Mint, SciTE's clipboard survives exit OK so I don't think gtk_clipboard_store should be needed.

Neil

Fred

unread,
Aug 13, 2012, 8:01:44 AM8/13/12
to scintilla...@googlegroups.com, nyama...@me.com
Well, it fails on Ubuntu, may be you want to give it a try :)

Fred

Enrico Tröger

unread,
Aug 13, 2012, 1:04:41 PM8/13/12
to scintilla...@googlegroups.com
Neil, do you have a clipboard manager running? If so, this clipboard
manager saves the content. Without any clipboard manager, the clipboard
content is actually lost.

Regards,
Enrico

--
Get my GPG key from http://www.uvena.de/pub.asc

signature.asc

Neil Hodgson

unread,
Aug 13, 2012, 7:17:11 PM8/13/12
to scintilla...@googlegroups.com
Enrico Tröger:

> Neil, do you have a clipboard manager running?

Not that I'm aware of since I use mostly stock distributions with some compilers and libraries added. Plus CompizConfig or similar app so that settings can be tweaked.

Just checked again and on Fedora 17 and Ubuntu 12.04 inside VirtualBox, downloading and building ('make' in both gtk directories) current SciTE 3.2.1, then running that. Then
Check version in Help | About SciTE -> shows 3.2.1.
Open Global Options : Options | Open Global Options File
Select a word such as 'Global'
Context menu | Copy
File | Exit to close SciTE
Open gedit
Edit | Paste

Neil

Fred

unread,
Aug 14, 2012, 4:58:28 AM8/14/12
to scintilla...@googlegroups.com, nyama...@me.com
Hi Neil,

I just recompiled/ran scite and you are right, it does work correctly. I probably don't shutdown GTK correctly in my code as the gtk_clipboard_set_can_store()  doc states it should push the clipboard content in the store location when exiting:

'Hints that the clipboard data should be stored somewhere when the application exits or when gtk_clipboard_store() is called. "

Sorry for the hassle,
Reply all
Reply to author
Forward
0 new messages