On Tue, Feb 16, 2016 at 3:20 PM, Gabriel E. Sánchez Martínez < gabrielesanc...@gmail.com> wrote:
> > > On 02/16/2016 07:23 AM, Gabriel Sánchez wrote: > > > On Feb 16, 2016 7:04 AM, "Dave Page" < <dp...@pgadmin.org> > dp...@pgadmin.org> wrote: > > > > > > > > On Tue, Feb 16, 2016 at 11:06 AM, johannes graën < <johan...@selfnet.de> > johan...@selfnet.de> wrote: > >> > >> On Tue, Feb 16, 2016 at 12:00 PM, Dave Page < <dp...@pgadmin.org> > dp...@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. > Hi 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). Thanks, Dave. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
diff --git a/pgadmin/ctl/ctlSQLBox.cpp b/pgadmin/ctl/ctlSQLBox.cpp index a45bb5e..0f8bdb2 100644 --- a/pgadmin/ctl/ctlSQLBox.cpp +++ b/pgadmin/ctl/ctlSQLBox.cpp @@ -796,7 +796,7 @@ void ctlSQLBox::OnPositionStc(wxStyledTextEvent &event) } // Roll back through the doc and highlight any unmatched braces - while ((pos--) >= 0) + while ((pos--) >= PositionFromPoint(wxPoint(0, 0))) { ch = GetCharAt(pos); st = GetStyleAt(pos); diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp index 067b2d5..cc3056e 100644 --- a/pgadmin/frm/frmQuery.cpp +++ b/pgadmin/frm/frmQuery.cpp @@ -1435,6 +1435,13 @@ bool frmQuery::relatesToWindow(wxWindow *which, wxWindow *related) void frmQuery::updateMenu(bool allowUpdateModelSize) { + // This function can get called a lot, and getting settings is expensive + static wxString favouritesFile; + if (favouritesFile.IsEmpty()) + { + favouritesFile = settings->GetFavouritesFile(); + } + bool canCut = false; bool canCopy = false; bool canPaste = false; @@ -1480,8 +1487,8 @@ void frmQuery::updateMenu(bool allowUpdateModelSize) canRedo = sqlQuery->CanRedo(); canPaste = sqlQuery->CanPaste(); canFind = true; - canAddFavourite = (sqlQuery->GetLength() > 0) && (settings->GetFavouritesFile().Length() > 0); - canManageFavourite = (settings->GetFavouritesFile().Length() > 0); + canAddFavourite = (sqlQuery->GetLength() > 0) && (favouritesFile.Length() > 0); + canManageFavourite = (favouritesFile.Length() > 0); } else if (relatesToWindow(wnd, scratchPad)) {
-- Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-support