|
From: Ethan M. <merritt@u.washington.edu> - 2005-07-15 20:45:15
|
On Friday 15 July 2005 03:17 pm, Timoth=C3=A9e Lecomte wrote:
> While working on my wxwidgets terminal, I've just encountered the=20
> following problem : typing "set terminal wxt" twice (without any plot=20
> call between) gives a segmentation fault.
That is indeed a problem, but since existing drivers do not segfault
on two "set term" command I think this is a something you need to
fix in your driver.
=20
> Indeed, it calls event_reset to cancel zoombox (in particular) as=20
> explained in a comment in set.c
> event_reset calls term->set_cursor but this fails as the terminal is not=
=20
> initialiased at this stage. I don't think it's a problem from my=20
> terminal, so I am proposing the attached patch to check for=20
> term_initialised.
=2D-- mouse.c 2005-07-16 00:01:58.000000000 +0200
+++ mouse2.c 2005-07-16 00:02:51.000000000 +0200
@@ -1782,7 +1782,7 @@
modifier_mask =3D 0;
button =3D 0;
builtin_cancel_zoom(ge);
=2D if (term && term->set_cursor) {
+ if (term && term->set_cursor && term_initialised) {
term->set_cursor(0, 0, 0);
if (mouse_setting.annotate_zoom_box && term->put_tmptext) {
term->put_tmptext(1, "");
I am not certain this fix is corrent, since
term->set_cursor() is also called from builtin_cancel_zoom()
on the line above your new test.
Would it not be better to make sure your WXWIDGETS_set_cursor()
routine does not segfault. Here is the routine for x11, where you
can see that if the communication channel is not initialized then
nothing happens:
TERM_PUBLIC void
X11_set_cursor(int c, int x, int y)
{
if (X11_ipc) {
PRINT3("u%04d%04d%04d\n", c, x, y);
FFLUSH();
}
}
=2D-=20
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|