Vanishing cursor in SQL editor - propose quick and dirty fix

From: Tim Booth <tbooth(at)ceh(dot)ac(dot)uk>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Vanishing cursor in SQL editor - propose quick and dirty fix
Date: 2004-02-26 15:24:54
Message-ID: 1077809094.7845.565.camel@ivpcp044.nerc-oxford.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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.

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.

Anyway, whoever maintains this code, take it or leave it.

TIM

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Andreas Pflug 2004-02-26 17:37:56 Re: Vanishing cursor in SQL editor - propose quick
Previous Message Jean-Michel POURE 2004-02-26 14:57:38 New Finnish translation