-
Notifications
You must be signed in to change notification settings - Fork 63
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
Password copying #208
Comments
It may take a while to get a response from the main dev. Though out of curiousity. I ttied this on two different Linux Mint installations with 1.60 Beta 1. There was no issues. Try looking into some system settings on Ubuntu such as the rate of the clicks needed or if it's somehow delaying clicks. You can maybe use the tool Also another thing i just thought of is make sure you dont have an additional system cliptray running that is intercepting the first copy sequence? |
This is important:
The most common cause of issues like this has been systems starting clipboard managers by default in the background. Lots more details can be found in at least issues #41, #83, #108, #113 and #111. With that said, do you have "Use Gorilla auto-copy" turned on in the General tab of the preferences pane? If yes, try turning it off and see if that helps. If turning it off helps, then turn it back on and try adjusting the "Latency" value up or down to see if a different latency value helps. |
Hmm, it is possible that the cause here could be something with VirtualBox. Do you have VB's "clipboard integration" turned on? It could also be that VBox adds just enough latency that sometimes a double click is seen as two sequential single clicks by the time the events go from host os -> Virtual box -> virtual os -> X -> running gorilla process. Double clicks are detected (and this is true of every OS, on every platform, everywhere) by detecting two left clicks within a short time of each other (this is because all the mouse hardware reports is "click occurred"). Anything that adds additional latency in the processing of the "click occurred" events, if the two events are near the maximum length of time used, could result in the two events appearing to be "too far apart". The detection of double clicks on rows in the table is done using Tk's built in native method (i.e., not by any special code in Gorilla). So if the actual detection is being missed, that points to the possibility of some extra latency somewhere in the code outside of PWGorilla and Tcl/Tk itself. And if that is where the issue is happening (somewhere between host OS, VBox, and guest OS) there is not going to be anything I can do code wise in Gorilla to actually work around the issue. Do you have any way to check on Linux running natively (i.e., without VirtualBox in the middle) to see if you also see the same issue? Since you have Linux in the VM, you should have a native Tcl/Tk interpreter installed (if not, you can use the package manager to install it). You can use this little snippet of code to test with: ----cut---cut---cut--- set tv [ttk::treeview .tv] Copy everything inside the ---cut--- lines (but not the ---cut--- lines themselves) to a file with a name of your choosing. Then open a terminal (xterm, rxvt, gnome terminal, etc.) and change directory to wherever the file is stored. Then launch the file like so (assuming you named it 'test.tcl':
That will launch a minimal version of how Gorilla detects double clicks on rows in the view. You want to launch from a terminal because when this bit of code detects a double click, it prints a line to the terminal saying it detected one, so you want to see that output. Then try double clicking the "click me" line in various ways to see if you have the same result as you see with Gorilla. If you do see the same result (sometimes double clicks get lost) then that result means that whatever is happening is actually outside of the ability for the PWGorilla code to do anything about the issue. |
Hello, I'm currently on the native Ubuntu 19.10 machine, not within Virtual Box. I've tried your test with script, window with text "Click me" do appear, but when I double click it (or any number of times or combinations) no returning message in a shell. Installed Tcl version is 8.6.9+1 I can try to find some log file if this might help? Not sure where to look, syslog is returning a little:
[EDIT] - Here is "Use Gorilla auto-copy" disabled as well. |
There was a report of a copy-paste issue (but I'm unable to locate the specific issue, github's 'search' being as inadequate as it is) some time ago that indicated that in newer Gnome's that the Gnome file manager program was also performing clipboard management duties behind the scenes. Note, I do not know why a 'file manager' had clipboard management duties added to it, nor did I go try to find out why, since I'm not a Gnome user myself. But it is interesting that you see no output with the test program in the terminal window where you launched the script. If you want to try another test, add this line to the end of the test script: bind $tv {puts "Single Click Detected at [clock format [clock seconds]]"} and then retry the test. That line will add a binding to "single click" along with the existing double click binding. You should, at least, see single clicks being reported in the shell from where the script was started when clicking on the "click me" text. Note that if a double click does register, you'll first see it reported as a single, then see a report for a double. If you also see nothing, then that partially explains what is going wrong, something is blocking/preventing Tk from receiving mouse events in many cases. I have no idea what might be causing this, but if you don't see anything from clicking on the "click me" text, or only occasionally see a click reported, then this does mean the problem is occurring somewhere before any of the PWGorilla code. It just happens that PWGorilla revealed the issue, but is not the cause. |
Hi, BTW, I just upgraded on Ubuntu 20.04, but no difference. Very possible that something interferes before gorilla as you said, I don't have idea what it could be. Best, |
Argh. Github is swallowing the angle brackets (probably an improper attempt at preventing a cross-site scripting attack). I noticed now when you replied with the line you added, and the button to bind is missing. I'm going to try attaching the file instead (and hopefully github does not change the file contents). Sorry for the confusion, but because github altered what I pasted in (after submitting the comment at that) and I didn't look closely enough after submitting, the result was the test script would never have output anything. Note also that the file is named *.txt because github would not let me upload it with a name *.tcl. |
Hi,
BTW, I think that markdown shall allow you to put real code within a triple back tick, or choosing "code" from the menu:
|
Ok, that indicates that the single and double clicks are making their way into Tk normally. It does not yet explain the issue with copy on a double click. Explicitly marking code blocks preserves the special characters, so that's good to know. Next, the bottom line of the main gorilla window where the list of entries is shown is a status bar. When you have the instances of double click being missed, so you also see nothing in the status bar as well? Normally when a password or a login id is copied to the clipboard a message appears in this bar for a brief period of time indicating what happened. I'm presuming that when double click is missed, no message appears, but if you do see the message, but nothing pastes, then that indicates something else weird. Also, any chance your system is running Wayland? |
Additional pattern, when I copy password the first time after opening the program, it is copied regularly. Yes, every time doing the double click, there is a message on the bottom of Gorilla window "Copied password to clipboard" (or username if I choose right click and copy username) Wayland is not installed. |
What happens if after you first open PWGorilla, you copy a password, paste to somewhere to verify it copied, then exit PWgorilla and then try pasting again after exiting PWGorilla? Also, what happens if after you first open PWGorilla, you do a copy, but do not yet paste, then exit PWGorilla then try to do several pastes? Before both of the "first open" steps above, try pasting to verify that there is nothing, or something other than what you expect to see from PWGorilla being pasted. If need be, copy and paste something else from somewhere else first to make sure the clipboard starts out "clean" (as in nothing from PWGorilla in the clipboard). Also, which method are you using to paste: middle mouse button or keyboard/paste menu selection? |
Also, can you download a source bundle from Github for use for further testing? Go to the main Github page for PWGorilla (https://github.com/zdia/gorilla/tree/pre160), change the "Branch" drop-down button to say "pre160" (it will default to 'master') then click the green "clone or download" button. A menu will appear and at the bottom will be "download zip". Click "download zip" to download a zip file containing the Gorilla source. Then unpack the zip somewhere, the where really does not matter. Next, open the gorilla-pre160/sources/gorilla.tcl file from where you unpacked the zip in a text editor (joe, jed, nano, vi, emacs, etc.) and search for this line:
It should appear in a block of code that looks like this:
Insert this line just after the "set item" line:
Then, about 77 lines farther down in the file this line will appear:
Immediately before that line, add this line:
Then save the file, and try testing copy/paste with this version of the file by launching it from a Bash terminal so you can see the output lines printed to the terminal. You should see the "Copied '????' to clipboard" line output each time PWGorilla copies something to the clipobard, and the ???? will be replaced with the data that should have gone into the clipboard. You can compare this to what you actually get from a paste to see if what is being pasted matches what PWGorilla attempted to copy. You should also see the "Returning '????' for '????'" line any time you actually do a paste, and it should show the same contents as the "Copied" line (unless you select a different entry) and it should also match what you get for a paste. Do some more testing with pasting after a new launch and pasting after a paste, i.e., all the situations that seem to create the problem, and compare what the test copy is stating it places into the clipboard with what actually pastes elsewhere. If anything does not match up, then report back what did not match (obviously clear the actual password content values before reporting). |
Don't have details to hand but I've been seeing similar issues on Pop OS 20.04 & MacOS Mojave; I need to verify which versions I'm running in each environment. On OSX it's been going on for a while but I'm not using the Mac that much so its not it's not been a big problem for me. But now i'm in the middle of installing 20.04 & changing email providers so I'm seeing it much for frequently. Both environments are native, no vm's involved. Let me know if there's a diagnostic I can usefully run to help troubleshoot. |
@zaphod80013 if you can run the source files on either platform, then trying the edits I suggested in my prior response and launching from a terminal so you can see the output from the puts statements might help diagnose what is going on. Obviously remove any actual password data values (as those puts will output them to the terminal for you to see) before posting anything back here to github. |
Hi there, Now, every double click in Gorilla, shell gives output as: But only when I do 4 times click (twice double click) I get:
And then I can actually paste the If I can do more debug, let me know. Previous question, I'm using double click to copy password from Gorilla. Paste with ctr+v, but the same is with mouse right click and paste. [EDIT] |
First, a clarifying question as I am slightly uncertain as to your exact meaning:
Here you mean that the middle mouse button paste operation always works? If yes then that is helpful, because it means whatever is going on is related to the X11 CLIPBOARD selection and does not effect the X11 PRIMARY selection.
Actually, there are a few additional mods you can make that may help track down what is going on. Below I'm going to paste output from git diff. There are two ways you can apply this, 1) manually, 2) automatically. If you have the "patch" utility installed, you can start from an unmodified copy of gorilla.tcl from the tip of the pre160 branch (i.e., what should be in the zip file you downloaded last time). You can copy out the patch data below to a file (lets say you call it "p"). Then, you place the file "p" in the same directory with an unmodified (from the pre160 branch) "gorilla.tcl" and type this at the bash command line:
Which should give you this output:
The manual method will require you to go through this patch file and find the appropriate locations to change, and make the changes (much like you did last time). Here's how to interpret the output: Lines that begin with a space are 'context' (i.e., they allow you to find the right place to edit). Lines that begin with a minus character (-) are removed (or changed, as diff shows a change as a removal of the old and insertion of a new item). Lines that begin with a plus character (+) are added. Lines that start "diff", "---", "+++", or "@@" are metadata from git for the 'patch' program purposes, you can ignore them if you are making hand edits. Note that this below contains some of the changes you've already made, be sure to leave those in place. But in one spot, I made a subsequent edit to an already suggested debug edit, so do make a careful comparison if you choose to manually apply the patch by hand.
Then give this version a try again in the same way as before, recording what PWGorilla outputs to the terminal window. The big change here is to output an indication of PWGorilla loosing ownership of the X11 CLIPBOARD selection. I have a suspicion you may see something like this below when the issue occurs:
Now, for a tiny bit of both good and bad news. I've had your issue occur here, exactly once, and sadly before I made the additional debug tweaks to output the "Lost ownership" line above. And so far I have not been able to find any way to reproduce the glitch a second time. which is most irritating, because if I could reproduce it here reliably, that would help significantly with tracing down the problem. |
Hi,
Yes, that's correct, password is copied to the mouse middle button function. Sorry, I didn't understand your instructions. I do have a patch utility.
Or you want me to copy something else to so called |
Copy the portion from the prior issue item beginning with "diff --git" and ending with " return" into a file (I just called it p, you can call it whatever you want). Then, starting from an unmodified copy of gorilla.tcl (i.e., unzip the zip you downloaded from github again) use patch to apply the file that originated from the copy action above to gorilla.tcl. If you name the copy/paste file something other than "p" then substitute the other name for "p" in the "patch < p" command line statement. Whatever you do name the file, it needs to be placed in the sources/ directory where gorilla.tcl exists. The best order is 1) unzip an unmodified gorilla.tcl; 2) copy/paste the portion from the prior issue into a file in sources/ directory; 3) run "patch < p" [substituting the filename you used for "p"] the same way you did above. |
Ok, I did that, here are the results from the shell:
(password can't be pasted at this point, only with middle mouse click).
Now is password copied to clipboard and can be pasted with CTRL+v |
That second experience indicates that something else is messing with the clipboard protocol. Those two "lost ownership" entries means that PWGorilla is not supplying data for a clipboard paste. So the fact that you can paste, after PWGorilla lost ownership of both, means that some other program is what is returning the password data that PWGorilla originally did copy to the clipboard. The way the X11 clipboard protocol works is that at most one program has "ownership" of the CLIPBOARD selection, and when another program performs a paste, that other program asks the current selection owner to send over the contents of the clipboard. Those two "lost ownership" lines, without two "claiming ownership" lines to match, mean that after the second double click, PWGorilla was not the program that had ownership of the CLIPBOARD selection, so the fact that a paste works means some other program is the owner. Note also that you quoted no "Returning 'my_password' as contents" lines for the second paste. That line is output by the code edits anytime another program asks for the clipboard contents and PWGorilla is the owner of the selection and is returning the data. Without those lines appearing, the clipboard contents that were pasted did not come from PWGorilla, they came from something else. There was a report some time back about the gnome file manager performing "clipboard manager" tasks (why a file manager was modified to also be a 'clipboard' manager I do not know). If you do have gnome file manager running, try closing all of its windows, and if it keeps a copy of itself running in the background, try killing off that copy, and see if doing so makes any difference. |
Hi,
I hope this project is still alive?
I have some issue copying password or username from Gorilla.
It is set to copy password on double click. However, I have to do it twice, two times double click, and then the password is copied.
Right click -> copy username or copy password, also has to be done twice to be actually copied.
A bit strange.
I'm using it on Ubuntu 19.10, and on the 2 desktop machines, the same behavior.
Gorilla version: 1.6.0.beta 1
The text was updated successfully, but these errors were encountered: