Обсуждение: Copy & paste key commands not working correctly
Hi, I sometimes experience the following strange behaviour with pgAdmin v1.22.0 under Arch using Gnome Shell 3.18.2: When I copy or cut out text, the following Ctrl+V doesn't insert the copied (or cut) text, but something I previously had copied in a different application (if any). The context menu actions and the command from the menu do work though. This happens like every other time I use these command in pgAdmin and appears to be quite annoying as you can imagine. Any clue what this behaviour is about? I have only seen this in pgAdmin so far. Best Johannes
It happens often to me in Ubuntu 14.04 as well. It sometimes also happens with the toolbar icons too. It seems to have to do with timing, because if I wait 5 seconds or so, it usually works. It seems to take longer to copy more text. The problem appears to worsen with long queries, and after using copy/paste a few times, but it does not always happen. Sometimes the keyboard begins to respond very slowly, such that if a second or so does not pass between keystrokes, many of them do not get written, and you can see the lag in the cursor.
The problem has existed for several versions of pgAdmin, including 1.20, which I am now using.
Hi,
I sometimes experience the following strange behaviour with pgAdmin
v1.22.0 under Arch using Gnome Shell 3.18.2:
When I copy or cut out text, the following Ctrl+V doesn't insert the
copied (or cut) text, but something I previously had copied in a
different application (if any). The context menu actions and the
command from the menu do work though. This happens like every other
time I use these command in pgAdmin and appears to be quite annoying
as you can imagine.
Any clue what this behaviour is about? I have only seen this in pgAdmin so far.
Best
Johannes
--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support
On Sun, Feb 7, 2016 at 8:00 PM, Gabriel Sánchez <gabrielesanchez@gmail.com> wrote: > It happens often to me in Ubuntu 14.04 as well. It sometimes also happens > with the toolbar icons too. It seems to have to do with timing, because if I > wait 5 seconds or so, it usually works. It seems to take longer to copy more > text. The problem appears to worsen with long queries, and after using > copy/paste a few times, but it does not always happen. Sometimes the > keyboard begins to respond very slowly, such that if a second or so does not > pass between keystrokes, many of them do not get written, and you can see > the lag in the cursor. I found that for copying multiple use of Ctrl+C usually works, while Ctrl+X cuts out text without storing it in the clipboard, i.e. a subsequent Ctrl+V has no effect. Undoing and redoing the cut operation usually works thought.
The same happens to me. Although copying and waiting usually works for me.
Have others experienced this behavior? It appears not to affect windows. Are the developers aware of this? Have they tried fixing it or do they plan to fix it? It could be that this is a bug in wxWidgets rather than pgAdmin, and if it has been fixed there it might be a matter of updating the library and recompiling.
On Sun, Feb 7, 2016 at 8:00 PM, Gabriel Sánchez
<gabrielesanchez@gmail.com> wrote:
> It happens often to me in Ubuntu 14.04 as well. It sometimes also happens
> with the toolbar icons too. It seems to have to do with timing, because if I
> wait 5 seconds or so, it usually works. It seems to take longer to copy more
> text. The problem appears to worsen with long queries, and after using
> copy/paste a few times, but it does not always happen. Sometimes the
> keyboard begins to respond very slowly, such that if a second or so does not
> pass between keystrokes, many of them do not get written, and you can see
> the lag in the cursor.
I found that for copying multiple use of Ctrl+C usually works, while
Ctrl+X cuts out text without storing it in the clipboard, i.e. a
subsequent Ctrl+V has no effect. Undoing and redoing the cut operation
usually works thought.
I am running openSUSE Leap 42.1 using Gnome with pgadmin 1.23 dev and I don't see this behaviour.The same happens to me. Although copying and waiting usually works for me.
Have others experienced this behavior? It appears not to affect windows. Are the developers aware of this? Have they tried fixing it or do they plan to fix it? It could be that this is a bug in wxWidgets rather than pgAdmin, and if it has been fixed there it might be a matter of updating the library and recompiling.
On Feb 9, 2016 5:10 AM, "johannes graën" <johannes@selfnet.de> wrote:On Sun, Feb 7, 2016 at 8:00 PM, Gabriel Sánchez
<gabrielesanchez@gmail.com> wrote:
> It happens often to me in Ubuntu 14.04 as well. It sometimes also happens
> with the toolbar icons too. It seems to have to do with timing, because if I
> wait 5 seconds or so, it usually works. It seems to take longer to copy more
> text. The problem appears to worsen with long queries, and after using
> copy/paste a few times, but it does not always happen. Sometimes the
> keyboard begins to respond very slowly, such that if a second or so does not
> pass between keystrokes, many of them do not get written, and you can see
> the lag in the cursor.
I found that for copying multiple use of Ctrl+C usually works, while
Ctrl+X cuts out text without storing it in the clipboard, i.e. a
subsequent Ctrl+V has no effect. Undoing and redoing the cut operation
usually works thought.
Are you guys running a clipboard manager? I use gpaste which cooperates with d-bus, and Gnome puts a nice little icon at top right of my screen alongside all the other status icons, so I can very quickly check the list of copied items to see if the copy was successful. I hardly ever do that though, pasting seems to give me what I need every time, and if I need something from the history list it is just a click or two away.
I use Kubuntu, which comes with Klipper, but I haven't been paying attention to it. I'll pay attention the next time I encounter bad behavior in pgAdmin.On 02/09/2016 08:55 AM, Gabriel Sánchez wrote:I am running openSUSE Leap 42.1 using Gnome with pgadmin 1.23 dev and I don't see this behaviour.The same happens to me. Although copying and waiting usually works for me.
Have others experienced this behavior? It appears not to affect windows. Are the developers aware of this? Have they tried fixing it or do they plan to fix it? It could be that this is a bug in wxWidgets rather than pgAdmin, and if it has been fixed there it might be a matter of updating the library and recompiling.
On Feb 9, 2016 5:10 AM, "johannes graën" <johannes@selfnet.de> wrote:On Sun, Feb 7, 2016 at 8:00 PM, Gabriel Sánchez
<gabrielesanchez@gmail.com> wrote:
> It happens often to me in Ubuntu 14.04 as well. It sometimes also happens
> with the toolbar icons too. It seems to have to do with timing, because if I
> wait 5 seconds or so, it usually works. It seems to take longer to copy more
> text. The problem appears to worsen with long queries, and after using
> copy/paste a few times, but it does not always happen. Sometimes the
> keyboard begins to respond very slowly, such that if a second or so does not
> pass between keystrokes, many of them do not get written, and you can see
> the lag in the cursor.
I found that for copying multiple use of Ctrl+C usually works, while
Ctrl+X cuts out text without storing it in the clipboard, i.e. a
subsequent Ctrl+V has no effect. Undoing and redoing the cut operation
usually works thought.
Are you guys running a clipboard manager? I use gpaste which cooperates with d-bus, and Gnome puts a nice little icon at top right of my screen alongside all the other status icons, so I can very quickly check the list of copied items to see if the copy was successful. I hardly ever do that though, pasting seems to give me what I need every time, and if I need something from the history list it is just a click or two away.
On Tue, Feb 9, 2016 at 2:55 PM, Gabriel Sánchez <gabrielesanchez@gmail.com> wrote: > The same happens to me. Although copying and waiting usually works for me. I've got a new clue. Although cut + paste inserts the wrong text, the cutted text is available to other programs afterwards. So my guess would be that pgadmin just uses the wrong clipboard to insert from.
On Tue, Feb 9, 2016 at 2:55 PM, Gabriel Sánchez
<gabrielesanchez@gmail.com> wrote:
> The same happens to me. Although copying and waiting usually works for me.
I've got a new clue. Although cut + paste inserts the wrong text, the
cutted text is available to other programs afterwards. So my guess
would be that pgadmin just uses the wrong clipboard to insert from.
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Tue, Feb 16, 2016 at 11:52 AM, Dave Page <dpage@pgadmin.org> wrote: > My best guess is that when you use Ctrl+V, some other control on the window > actually has focus and is "swallowing" the keypress before our code sees it. > Can you confirm that the SQL textbox is definitely the focussed control when > you hit Ctrl+V? Does it work properly then? I'm navigating inside the textbox with the cursor keys when I do cut & paste, so it definitely has the focus.
On Tue, Feb 16, 2016 at 11:52 AM, Dave Page <dpage@pgadmin.org> wrote:
> My best guess is that when you use Ctrl+V, some other control on the window
> actually has focus and is "swallowing" the keypress before our code sees it.
> Can you confirm that the SQL textbox is definitely the focussed control when
> you hit Ctrl+V? Does it work properly then?
I'm navigating inside the textbox with the cursor keys when I do cut &
paste, so it definitely has the focus.
Hmm. I just spent time here trying to reproduce this on RHEL 7 and it seems to work fine there.
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Tue, Feb 16, 2016 at 12:00 PM, Dave Page <dpage@pgadmin.org> wrote: > Where did your build come from? What version of wxWidgets is it using? It's an official Arch package: https://www.archlinux.org/packages/community/x86_64/pgadmin3/ The wxWidgets version is 2.8.12.1: https://www.archlinux.org/packages/extra/x86_64/wxgtk2.8/
On Tue, Feb 16, 2016 at 12:00 PM, Dave Page <dpage@pgadmin.org> wrote:
> Where did your build come from? What version of wxWidgets is it using?
It's an official Arch package:
https://www.archlinux.org/packages/community/x86_64/pgadmin3/
The wxWidgets version is 2.8.12.1:
https://www.archlinux.org/packages/extra/x86_64/wxgtk2.8/
That should be OK (some distros have started using wxWidgets 3, which we don't fully support).
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
<p dir="ltr"><br /> On Feb 16, 2016 7:04 AM, "Dave Page" <<a href="mailto:dpage@pgadmin.org">dpage@pgadmin.org</a>>wrote:<br /> ><br /> ><br /> ><br /> > On Tue, Feb 16,2016 at 11:06 AM, johannes graën <<a href="mailto:johannes@selfnet.de">johannes@selfnet.de</a>> wrote:<br /> >><br/> >> On Tue, Feb 16, 2016 at 12:00 PM, Dave Page <<a href="mailto:dpage@pgadmin.org">dpage@pgadmin.org</a>>wrote:<br /> >> > Where did your build come from? Whatversion of wxWidgets is it using?<br /> >><br /> >> It's an official Arch package:<br /> >> <a href="https://www.archlinux.org/packages/community/x86_64/pgadmin3/">https://www.archlinux.org/packages/community/x86_64/pgadmin3/</a><br />><br /> ><br /> > Huh, they have some weird dependencies listed there, that should not be needed. That's not aproblem though.<br /> > <br /> >><br /> >><br /> >><br /> >> The wxWidgets version is <a href="http://2.8.12.1">2.8.12.1</a>:<br/> >> <a href="https://www.archlinux.org/packages/extra/x86_64/wxgtk2.8/">https://www.archlinux.org/packages/extra/x86_64/wxgtk2.8/</a><br />><br /> ><br /> > That should be OK (some distros have started using wxWidgets 3, which we don't fully support).<br/> ><br /> > I've done some more testing on CentOS 6, and cannot reproduce a problem there either. I'mbeginning to wonder if it's something more distro-specific, perhaps related to the version of GTK in use, or the windowmanager. That makes it *far* more difficult to track down unfortunately.<br /> ><br /> > Are you in a positionto be able to install the EDB PostgreSQL installer? I'm curious to know if the build of pgAdmin that's included withthat works OK. It was built against a fairly old version of GTK for maximum compatibility with different distros.<br/> ><br /> > <a href="http://www.enterprisedb.com/products-services-training/pgdownload">http://www.enterprisedb.com/products-services-training/pgdownload</a><br />><br /> ><p dir="ltr">I have the problem in Kububtu with the version downloaded from edb. As far as I can tell, pgAdminis not copying text when I hit copy either by keyboard, shortcut, or menu. I checked my clipboard manager last timethis happened and the text was not there. Again, it doesn't happen always, but it persists in a pgAdmin window once itbegins to happen, and the copy does happen eventually. Other laggy behavior showing up when this happens (such as takinga full second to respond to a key press, and not registering all key presses when this happens and I nevertheless typefast) suggests to me that the problem is very slow cursor movement or text processing. <p dir="ltr">I have been tryingto notice a pattern of what triggers it, but have not seen any. It does happen often on windows with long queries andafter several copy paste ops within the window or between pgAdmin windows. But not always. However I use many other programsand only see this bug with pgAdmin. <p dir="ltr">Just want to add my thanks for this project, Dave. Great program,and I'm looking forward to v4! <p dir="ltr">> -- <br /> > Dave Page<br /> > Blog: <a href="http://pgsnake.blogspot.com">http://pgsnake.blogspot.com</a><br/> > Twitter: @pgsnake<br /> ><br /> > EnterpriseDBUK: <a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br /> > The Enterprise PostgreSQLCompany<br />
On Feb 16, 2016 7:04 AM, "Dave Page" <dpage@pgadmin.org> wrote:
>
>
>
> On Tue, Feb 16, 2016 at 11:06 AM, johannes graën <johannes@selfnet.de> wrote:
>>
>> On Tue, Feb 16, 2016 at 12:00 PM, Dave Page <dpage@pgadmin.org> wrote:
>> > Where did your build come from? What version of wxWidgets is it using?
>>
>> It's an official Arch package:
>> https://www.archlinux.org/packages/community/x86_64/pgadmin3/
>
>
> Huh, they have some weird dependencies listed there, that should not be needed. That's not a problem though.
>
>>
>>
>>
>> The wxWidgets version is 2.8.12.1:
>> https://www.archlinux.org/packages/extra/x86_64/wxgtk2.8/
>
>
> That should be OK (some distros have started using wxWidgets 3, which we don't fully support).
>
> I've done some more testing on CentOS 6, and cannot reproduce a problem there either. I'm beginning to wonder if it's something more distro-specific, perhaps related to the version of GTK in use, or the window manager. That makes it *far* more difficult to track down unfortunately.
>
> Are you in a position to be able to install the EDB PostgreSQL installer? I'm curious to know if the build of pgAdmin that's included with that works OK. It was built against a fairly old version of GTK for maximum compatibility with different distros.
>
> http://www.enterprisedb.com/products-services-training/pgdownload
>
>I have the problem in Kububtu with the version downloaded from edb. As far as I can tell, pgAdmin is not copying text when I hit copy either by keyboard, shortcut, or menu. I checked my clipboard manager last time this happened and the text was not there. Again, it doesn't happen always, but it persists in a pgAdmin window once it begins to happen, and the copy does happen eventually. Other laggy behavior showing up when this happens (such as taking a full second to respond to a key press, and not registering all key presses when this happens and I nevertheless type fast) suggests to me that the problem is very slow cursor movement or text processing.
I have been trying to notice a pattern of what triggers it, but have not seen any. It does happen often on windows with long queries and after several copy paste ops within the window or between pgAdmin windows. But not always. However I use many other programs and only see this bug with pgAdmin.
Just want to add my thanks for this project, Dave. Great program, and I'm looking forward to v4!
Following up, I upgraded from 1.20 to 1.22.1 from a fresh EDB download. I opened a query window, copied in some text, and began copy-pasting and typing randomly, and was able to reproduce the bug within a minute. I recorded video, which you can get here:
http://www.filedropper.com/screencast2016-02-16100737
You can see that I am selecting text. Following every selection, I quickly do a copy, and then I move the cursor somewhere and do a paste. I also type random keys. Everything works as expected until about 0:34, when I try to paste and it doesn't. Then I type quickly "asdfjkl;" many times, and you can see only a few of those keys are typed, and the response is laggy. I try pasting several times again in the lines below, but it still doesn't work (0:40). I type again, and response seems to be a bit better. I try paste again and this time it works (0:46). While on this video it seems to have recovered, my experience has been that it doesn't. It's especially annoying when you have a session with temporary tables that take a long time to prepare, because it costs time to start a new session and re-make the temporary tables.
Once again, many thanks for your attention to this.
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
On Tue, Feb 16, 2016 at 1:04 PM, Dave Page <dpage@pgadmin.org> wrote: > Are you in a position to be able to install the EDB PostgreSQL installer? > I'm curious to know if the build of pgAdmin that's included with that works > OK. It was built against a fairly old version of GTK for maximum > compatibility with different distros. I tried that, but pgadmin won't be executed because of a library missing which is not available on my system.
On 02/16/2016 07:23 AM, Gabriel Sánchez wrote:
On Feb 16, 2016 7:04 AM, "Dave Page" <dpage@pgadmin.org> wrote:
>
>
>
> On Tue, Feb 16, 2016 at 11:06 AM, johannes graën <johannes@selfnet.de> wrote:
>>
>> On Tue, Feb 16, 2016 at 12:00 PM, Dave Page <dpage@pgadmin.org> wrote:
>> > Where did your build come from? What version of wxWidgets is it using?
>>
>> It's an official Arch package:
>> https://www.archlinux.org/packages/community/x86_64/pgadmin3/
>
>
> Huh, they have some weird dependencies listed there, that should not be needed. That's not a problem though.
>
>>
>>
>>
>> The wxWidgets version is 2.8.12.1:
>> https://www.archlinux.org/packages/extra/x86_64/wxgtk2.8/
>
>
> That should be OK (some distros have started using wxWidgets 3, which we don't fully support).
>
> I've done some more testing on CentOS 6, and cannot reproduce a problem there either. I'm beginning to wonder if it's something more distro-specific, perhaps related to the version of GTK in use, or the window manager. That makes it *far* more difficult to track down unfortunately.
>
> Are you in a position to be able to install the EDB PostgreSQL installer? I'm curious to know if the build of pgAdmin that's included with that works OK. It was built against a fairly old version of GTK for maximum compatibility with different distros.
>
> http://www.enterprisedb.com/products-services-training/pgdownload
>
>I have the problem in Kububtu with the version downloaded from edb. As far as I can tell, pgAdmin is not copying text when I hit copy either by keyboard, shortcut, or menu. I checked my clipboard manager last time this happened and the text was not there. Again, it doesn't happen always, but it persists in a pgAdmin window once it begins to happen, and the copy does happen eventually. Other laggy behavior showing up when this happens (such as taking a full second to respond to a key press, and not registering all key presses when this happens and I nevertheless type fast) suggests to me that the problem is very slow cursor movement or text processing.
I have been trying to notice a pattern of what triggers it, but have not seen any. It does happen often on windows with long queries and after several copy paste ops within the window or between pgAdmin windows. But not always. However I use many other programs and only see this bug with pgAdmin.
Just want to add my thanks for this project, Dave. Great program, and I'm looking forward to v4!
Following up, I upgraded from 1.20 to 1.22.1 from a fresh EDB download. I opened a query window, copied in some text, and began copy-pasting and typing randomly, and was able to reproduce the bug within a minute. I recorded video, which you can get here:
http://www.filedropper.com/screencast2016-02-16100737
You can see that I am selecting text. Following every selection, I quickly do a copy, and then I move the cursor somewhere and do a paste. I also type random keys. Everything works as expected until about 0:34, when I try to paste and it doesn't. Then I type quickly "asdfjkl;" many times, and you can see only a few of those keys are typed, and the response is laggy. I try pasting several times again in the lines below, but it still doesn't work (0:40). I type again, and response seems to be a bit better. I try paste again and this time it works (0:46). While on this video it seems to have recovered, my experience has been that it doesn't. It's especially annoying when you have a session with temporary tables that take a long time to prepare, because it costs time to start a new session and re-make the temporary tables.
Once again, many thanks for your attention to this.
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения
Hi, On Fri, Feb 19, 2016 at 12:42 PM, Dave Page <dpage@pgadmin.org> wrote: > Can you test the attached patch please? I've done various tests with gprof > to profile the code whilst copying/pasting text in the query tool up to > about 20MB worth. I found a couple of optimisations that seem to make good > improvements here, and only see issues with very large files, most notably > when the editor is doing brace matching over megabytes of text (which seems > unavoidable). I managed to compile pgadmin3 with the patch you provided. The bug is still there, I see exactly the same behaviour as before. Best Johannes
Another interesting finding: When pasting text from another application, the text doesn't appear the first time I press Ctrl+V, but on the second keypress, always.