I am looking at the copy/paste mechanism and I noticed that for some reason, on X11 (i.e. GNU/Linux), there is different code for getting the info to paste. There is this comment:
/* in X windows the selection already went to the clipboard when it was made; here we "copy" it to our own buffer as well, because, annoyingly, the clipboard will usually be destroyed by the time the user asks to "paste". */
On Win32 and Mac OS X, pd gets the text from Tcl/Tk using [clipboard get]. It would make things cleaner if everything used the same code. Is there any reason not to make X11 get the data from Tk, if possible?
.hc
----------------------------------------------------------------------------
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
Well, it didn't work for me when I tried it - if you select text in one object, hit "copy", then select text in another intending to paste over it -- bingo, X does a new "copy". ouch.
cheers Miller
On Fri, Jan 30, 2009 at 06:54:15PM -0500, Hans-Christoph Steiner wrote:
I am looking at the copy/paste mechanism and I noticed that for some reason, on X11 (i.e. GNU/Linux), there is different code for getting the info to paste. There is this comment:
/* in X windows the selection already went to the clipboard when it was made; here we "copy" it to our own
buffer as well, because, annoyingly, the clipboard will usually be destroyed by the time the user asks to "paste". */
On Win32 and Mac OS X, pd gets the text from Tcl/Tk using [clipboard get]. It would make things cleaner if everything used the same code. Is there any reason not to make X11 get the data from Tk, if possible?
.hc
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
On Fri, 30 Jan 2009, Hans-Christoph Steiner wrote:
On Win32 and Mac OS X, pd gets the text from Tcl/Tk using [clipboard get]. It would make things cleaner if everything used the same code. Is there any reason not to make X11 get the data from Tk, if possible?
Most likely Miller is confused because in X11 there are two paste mechanisms, which one could call select+paste and copy+paste. I just used [clipboard get] with Ctrl+C and Ctrl+V on Linux and I don't recall anything wrong with it.
The select+paste system instead uses Button-2 (middle-click or thumb-click or wheel-click depending on which mouse) to paste directly from the selection instead of from the clipboard, because then there's no real clipboard in that system.
Right?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
Yep, I'm clearly getting fooled by select-paste, if that's indeed what it's called. But at least when I tried it, pasting from the "clipboard" appeared to paste instead from the selection. Or maybe I was doing it wrong...?
cheers Miller
On Fri, Jan 30, 2009 at 07:10:31PM -0500, Mathieu Bouchard wrote:
On Fri, 30 Jan 2009, Hans-Christoph Steiner wrote:
On Win32 and Mac OS X, pd gets the text from Tcl/Tk using [clipboard get]. It would make things cleaner if everything used the same code. Is there any reason not to make X11 get the data from Tk, if possible?
Most likely Miller is confused because in X11 there are two paste mechanisms, which one could call select+paste and copy+paste. I just used [clipboard get] with Ctrl+C and Ctrl+V on Linux and I don't recall anything wrong with it.
The select+paste system instead uses Button-2 (middle-click or thumb-click or wheel-click depending on which mouse) to paste directly from the selection instead of from the clipboard, because then there's no real clipboard in that system.
Right?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t?l:+1.514.383.3801, Montr?al, Qu?bec
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
I think here's the explanation: "X distinguishes the PRIMARY selection (typically <ButtonPress-2>) from the CLIPBOARD selection (used for explicit "Cut", "Copy", and "Paste")."
.hc
On Jan 30, 2009, at 9:39 PM, Miller Puckette wrote:
Yep, I'm clearly getting fooled by select-paste, if that's indeed what it's called. But at least when I tried it, pasting from the "clipboard" appeared to paste instead from the selection. Or maybe I was doing it wrong...?
cheers Miller
On Fri, Jan 30, 2009 at 07:10:31PM -0500, Mathieu Bouchard wrote:
On Fri, 30 Jan 2009, Hans-Christoph Steiner wrote:
On Win32 and Mac OS X, pd gets the text from Tcl/Tk using [clipboard get]. It would make things cleaner if everything used the same code. Is there any reason not to make X11 get the data from Tk, if possible?
Most likely Miller is confused because in X11 there are two paste mechanisms, which one could call select+paste and copy+paste. I just used [clipboard get] with Ctrl+C and Ctrl+V on Linux and I don't recall anything wrong with it.
The select+paste system instead uses Button-2 (middle-click or thumb-click or wheel-click depending on which mouse) to paste directly from the selection instead of from the clipboard, because then there's no real clipboard in that system.
Right?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t?l:+1.514.383.3801, Montr?al, Qu?bec
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
----------------------------------------------------------------------------
¡El pueblo unido jamás será vencido!