You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copy and paste does not work correctly on Windows 10 #16459
When I copy a url or text in Windows and paste it into the omibar in Servo, it pastes an empty box character instead of the text. It does the same on any website I visit where I can paste text.
Just to try it out myself @CodeGradox could please paste your url/text
From what gather there seems to be strange handling of URL... I'll make a quick test.
But what about text?
I need to take a look at how servo set & paste to/from clipboard.
UPD:
If possible i would like to see errors that might be generated by warn! macro
UPD2
Looking at servo's way of clipboard usage, it seems there might be a problem due to the fact that in version 2.0 I had introduced Clipboard context.
clipboard library uses this context and therefore servo now(contrary to older clipboard) has it open during life of program.
But in most cases it might be better to actually open/close it only during operations.
To verify that I'll need to look around code.
But as work-around i would try to suggest to use set_clipboard_string and get_clipboard_string in rust-clipboard. This way you can retain original behavior. If it helps, then you might want to ask @aweinstock314 to create new version with these changes.
But I would like to find out for sure whether it is ok to leave clipboard opened for long on Windows
UPD3
My observations
Opened clipboard prevents other applications from accessing it (e.g. Firefox)
But powershell seems to be able to do it
Performing Clipboard operation from another application breaks your opened Clipboard
So it seems rather... unsafe to open Clipboard for long.
I'm not sure what could be a reason. I'll ponder about it later on, but for now I suppose we need to change way clipboard is used on windows.
Simplest way would be to change way rust-clipboard creates context for windows.
if @aweinstock314 is ok, with it, it would fix for now this issue.
clipboard library uses this context and therefore servo now(contrary to older clipboard) has it open during life of program.
But in most cases it might be better to actually open/close it only during operations.
Interesting, this might be in fact the cause. I'm not sure whether this behaviour is the right one on Linux/Mac, is there a cost in creating a clipboard context on those operating systems?
In Windows case you only need to call two WinAPI function corresponding to opening clipboard, and then closing it on dropping context.
In case of Mac you would need to initialize interface toward clipboard server each time.
I'm not aware of implementation details there, but most likely it is sorta process-communication establishment within a system.
A bit more costly than Windows, i guess, but I don't think it is critical
@DoumanAsh well it doesn't appear to be working now and I know that it did work in the past. I am assuming that #17067 started the problem but I have not verified that.
Edit: I may open a new issue regarding the Windows clipboard as it appears there are more problems than just copying and pasting.
@atouchet Well, I suppose stopping leaving clipboard open on windows will prevent any kind of conflicts so you should wait for that to be resolved first.
I've filed #17413 to fix all clipboard issues on windows. I couldn't test it. If any of you can build servo, could you test it? Replies please in the PR thread.
I tested this out and now I am able to copy and paste URLs into Servo again. However I am still getting that duplicate URL issue I mentioned in my original post. If I try to load the duplicate URL site Servo seems to still work regardless. I am not sure what is happening there.
Activity
CodeGradox commentedon Apr 15, 2017
Looks like pressing CTRL + almost any key on the keyboard inserts either that box, space or what seems to be a tab.
atouchet commentedon Jun 2, 2017
I tested this out today with #17067 being merged now and I seem to be getting some strange results. If I copy and paste a URL within Servo it pastes the URL twice (ex. copying https://duckduckgo.com/html pastes as https://duckduckgo.com/htmlhttps://duckduckgo.com/html). Also if I try to paste into another application other than Servo nothing shows up. Strangely I can paste into another application just fine but only after closing the Servo browser window. Servo appears to be doing something to interfere with the Windows clipboard. I can't even copy and paste from completely different applications with Servo running now. For example I can't copy text from Firefox to paste into Notepad unless Servo is not running.
est31 commentedon Jun 2, 2017
cc @DoumanAsh seems your crate is being used on windows?
cc @aweinstock314
DoumanAsh commentedon Jun 2, 2017
@est31 Yes.
Just to try it out myself @CodeGradox could please paste your
url/textFrom what gather there seems to be strange handling of URL... I'll make a quick test.
But what about text?
For now i made simple test DoumanAsh/clipboard-win@3dd2519 but it works as expected.
I need to take a look at how servo set & paste to/from clipboard.
UPD:
If possible i would like to see errors that might be generated by
warn!macroUPD2
Looking at servo's way of clipboard usage, it seems there might be a problem due to the fact that in version 2.0 I had introduced Clipboard context.
clipboard library uses this context and therefore servo now(contrary to older clipboard) has it open during life of program.
But in most cases it might be better to actually open/close it only during operations.
To verify that I'll need to look around code.
But as work-around i would try to suggest to use set_clipboard_string and get_clipboard_string in
rust-clipboard. This way you can retain original behavior. If it helps, then you might want to ask @aweinstock314 to create new version with these changes.But I would like to find out for sure whether it is ok to leave clipboard opened for long on Windows
UPD3
My observations
So it seems rather... unsafe to open Clipboard for long.
I'm not sure what could be a reason. I'll ponder about it later on, but for now I suppose we need to change way clipboard is used on windows.
Simplest way would be to change way
rust-clipboardcreates context for windows.if @aweinstock314 is ok, with it, it would fix for now this issue.
est31 commentedon Jun 3, 2017
Interesting, this might be in fact the cause. I'm not sure whether this behaviour is the right one on Linux/Mac, is there a cost in creating a clipboard context on those operating systems?
DoumanAsh commentedon Jun 3, 2017
In Windows case you only need to call two WinAPI function corresponding to opening clipboard, and then closing it on dropping context.
In case of Mac you would need to initialize interface toward clipboard server each time.
I'm not aware of implementation details there, but most likely it is sorta process-communication establishment within a system.
A bit more costly than Windows, i guess, but I don't think it is critical
But in case of X11 though you need to do some initialization with spawning thread https://github.com/quininer/x11-clipboard/blob/master/src/lib.rs#L109-L125
est31 commentedon Jun 5, 2017
Okay, I've filed an issue report against the
rust-clipboardcrate. Its better fixed there, as to not confuse other users.atouchet commentedon Jun 11, 2017
Just realized that this also impacts print screen which makes it so now I can't take screenshots of Servo.
DoumanAsh commentedon Jun 11, 2017
@atouchet Hmm... i think it should not. Servo uses only unicode text format when accessing clipboard so it should break only copying\pasting text
atouchet commentedon Jun 11, 2017
@DoumanAsh well it doesn't appear to be working now and I know that it did work in the past. I am assuming that #17067 started the problem but I have not verified that.
Edit: I may open a new issue regarding the Windows clipboard as it appears there are more problems than just copying and pasting.
DoumanAsh commentedon Jun 11, 2017
@atouchet Well, I suppose stopping leaving clipboard open on windows will prevent any kind of conflicts so you should wait for that to be resolved first.
Update clipboard to 0.4
est31 commentedon Jun 19, 2017
I've filed #17413 to fix all clipboard issues on windows. I couldn't test it. If any of you can build servo, could you test it? Replies please in the PR thread.
Auto merge of #17413 - est31:master, r=cbrewster
atouchet commentedon Jun 21, 2017
I tested this out and now I am able to copy and paste URLs into Servo again. However I am still getting that duplicate URL issue I mentioned in my original post. If I try to load the duplicate URL site Servo seems to still work regardless. I am not sure what is happening there.
I also tied copying text from https://www.rust-lang.org/en-US/ and pasting it into the Servo address bar which resulted in empty boxes.
DoumanAsh commentedon Jun 21, 2017
@atouchet Do you by any chance has logs from servo? It is rather strange i would say.
atouchet commentedon Jun 21, 2017
@DoumanAsh Sorry, I don't have any logs.
DoumanAsh commentedon Jun 21, 2017
np, I'll try to build servo myself and see if there is any issue with my clipboard library or something else.
[-]Copy and paste does not work correctly on WIndows 10[/-][+]Copy and paste does not work correctly on Windows 10[/+]