Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard functions for x11new #65

Closed
Bill-Gray opened this issue May 26, 2019 · 2 comments
Closed

Clipboard functions for x11new #65

Bill-Gray opened this issue May 26, 2019 · 2 comments

Comments

@Bill-Gray
Copy link
Contributor

x11new currently lacks working clipboard functions. If I copy xclip.c from

https://github.com/Bill-Gray/junk

to the x11new directory, and rename it to pdcclip.c, and add -lpthreads to the libraries in the Makefile, it compiles and the testcurs tests work (after setting HAVE_CLIPBOARD to 1).

I originally wrote this to add clipboard functions for the VT platform. This code will work for both. It also has the nice feature (in my opinion) of allowing one to use the PDC_*clipboard functions in any program, including those not linked to the PDCurses library, including those that are linked to ncurses.

Note that by changing a couple of strings from CLIPBOARD to PRIMARY, you can switch from setting/getting the clipboard to setting/getting the current selection. I've not made it possible yet to make that switch programmatically, but am strongly tempted to do so.

A question : I see you're still making improvements to the "original" fork()-using x11 platform. Do you expect that to fade away now that we've got x11new to play with? Is there still a use for the "original" platform?

@wmcbrine
Copy link
Owner

wmcbrine commented May 26, 2019

A question : I see you're still making improvements to the "original" fork()-using x11 platform. Do you expect that to fade away now that we've got x11new to play with? Is there still a use for the "original" platform?

x11new isn't quite ready to take over yet. For one (more) thing, the problem you described in 9496141 is still present. (I found a simple fix that made the composed input work -- except that it then came in doubled.) But even once I'm satisfied with it, I'll want at least one broad release with both ports, to get x11new tested more widely before fully committing to it.

@wmcbrine
Copy link
Owner

So... it's pretty much ready now. I fixed the composed input ( 985e843 ), I redid the clipboard functions for x11new (without threads), and I wrote a "universal" (all platforms) cut-and-paste mechanism, on the curses side, to handle mouse select and paste, as well as keyboard (shift-ctrl-c and shift-ctrl-v). There are still some improvements to make, but it's at the level where the old x11 was before (plus keyboard paste, plus sdl2 has cut-and-paste support for the first time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants