Feature #1038

Implement copy/paste for Linux

Added by kervala about 8 years ago. Updated almost 8 years ago.

Status:Closed Start date:07/28/2010
Priority:High Due date:
Assignee:kervala % Done:

100%

Category:OS: GNU/Linux
Target version:Version 0.8.0

Description

Currently, Copy/paste is only supported under Windows.

To implement it under Linux, we need to catch/send X events in OpenGL driver, so copy/paste code should be moved to 3D drivers.

1038_merged_head.patch (16.9 kB) Magnifier Naush, 10/15/2010 09:41 pm

History

#1 Updated by Naush almost 8 years ago

Here is a broken by design copy/paste for Linux

Q&A
- Windows : Compile fine D3D and OGL driver, tested D3D on login page no problem (ATI gfx card = balck screen under OGL)
- Mac OSX: compile fine
- Linux : Tested IG with no special condition. No timeout for the momment.

It's broken by design because it's rely on prepareSelectionContent().
This function is subject to time out and can miss some information.

Another way to implement it, is to modify API and use a CPasteCallback. So paste operation prototype will be : pasteTextFromClipboard(ucstring &text, CPasteCallBack*)
And a mutli event emitter will trigger the CB, when information can be copied.

If you have a better way ? ... :)

#2 Updated by kervala almost 8 years ago

  • Status changed from New to Assigned
  • Assignee set to kervala

#3 Updated by kervala almost 8 years ago

  • % Done changed from 0 to 90

#4 Updated by kervala almost 8 years ago

Thanks a lot for your patch :)

First, I wanted to implement a system with callback as you suggested, but I tried something else.

I sent some CEventChar with selection text and it almost worked (only carriage returns were not recognized) and finally I implemented a CEventString NeL event.

So when you call pasteTextFromClipboard and it returns true, you can get the ucstring directly and if it returns false, it did the request but you will get it later if you listen for CEventString.

That seems to work fine under Linux and Windows :)

And for Mac OS, we'll be able to use both sync or async paste (I don't know how it's managed) :)

#5 Updated by kervala almost 8 years ago

  • Target version set to Version 0.8.0
  • % Done changed from 90 to 100

#6 Updated by kervala almost 8 years ago

  • Status changed from Assigned to Resolved

#7 Updated by kervala almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF