Re: Vanishing cursor in SQL editor - propose quick - Mailing list pgadmin-hackers

From Andreas Pflug
Subject Re: Vanishing cursor in SQL editor - propose quick
Date
Msg-id 403E2EF4.7050303@pse-consulting.de
Whole thread Raw
In response to Vanishing cursor in SQL editor - propose quick and dirty fix  (Tim Booth <tbooth@ceh.ac.uk>)
Responses Re: Vanishing cursor in SQL editor - propose
List pgadmin-hackers
Tim Booth wrote:

>Hi,
>
>I love PGAdminIII, and use it extensively on my Redhat Linux box.  I'm
>currently using a CVS build as it fixes a significant crashing situation
>over the stable release.  However, I find the disappearence of the
>cursor/caret in the SQL editor very annoying.
>
>

Hi Tim,
can you tell us in which situation stable (1.0.2?) crashes? Seems we
missed to backport a fix.

>An hour or so of poking has led me into the labyrinth of code which is
>the wxWindows focus handling mechanism.  I really don't have the time or
>inclination to debug that so here is my hacky fix:
>
>In the file contrib/src/stc/ScintillaWX.cpp, line 637, change the left
>mouse click callback as follows:
>
>...
>void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool
>shift, bool ctrl, bool alt) {
>    ButtonDown(pt, curTime, shift, ctrl, alt);
>
            
>    //Hack to try and reclaim the caret:
>    if(!hasFocus) DoGainFocus();
>}
>...
>ie - we force a focus event and hence redraw the caret.
>
>The added line should never be called, since you should never get a left
>click without getting focus, so on the plus side this patch should not
>break anything if wxWindows gets fixed properly.  Also, the wxWindows
>build you use has already been forked, so I don't think it would be
>polluting good code to add this.
>
>

Thanks Tim for contributing this fix. IFAIR I did some debugging about
this myself, can't remember what happened.
We'll be upgrading our wx snapshot quite soon (as soon as I find the
time to do so, yes guys I'm telling this for quite a while now...), the
2.5.1 release is settling these days. The Scintilla control has been
updated, and AFAIK there has been work on focus code too. Maybe the
problem is already fixed properly, if not we'll certainly incorporate
this hack into our version.

Regards,
Andreas



pgadmin-hackers by date:

Previous
From: Tim Booth
Date:
Subject: Vanishing cursor in SQL editor - propose quick and dirty fix
Next
From: "Hiroshi Saito"
Date:
Subject: Re: Solaris9 Sparc64 edition