Skip to content

Commit 8efec7d

Browse files
authored
Another segfault fix, mouse cursor fix, bump years and version
Found another issue where resizing the window still triggered a segfault so removed a `wait` from VncViewer::handle, probably causing stack overflow. Also minor mouse cursor fix so mouse cursor changes properly after leaving viewer area the first time.
1 parent 2abd467 commit 8efec7d

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

src/app.cxx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* app.cxx - part of SpiritVNC - FLTK
3-
* 2016-2022 Will Brokenbourgh https://www.pismotek.com/brainout/
3+
* 2016-2023 Will Brokenbourgh https://www.pismotek.com/brainout/
44
*/
55

66
/*
@@ -2038,10 +2038,6 @@ void svHandleThreadConnection (void * data)
20382038
{
20392039
svMessageWindow("A remote VNC host has just reverse-connected"
20402040
"\n\nClick the 'Listen' item(s) in the host list to view");
2041-
//app->mBar = new SVMessageBar("A remote VNC host has just reverse-connected"
2042-
//"\n\nClick the 'Listen' item(s) in the host list to view");
2043-
//svResizeScroller();
2044-
//// app->scroller->add(app->mBar);
20452041
}
20462042
}
20472043
}
@@ -2111,8 +2107,17 @@ void svHandleThreadConnection (void * data)
21112107
handle thread cursor change
21122108
(void * not used so parameter name removed)
21132109
*/
2114-
void svHandleThreadCursorChange (void *)
2110+
void svHandleThreadCursorChange (void * setToDefault)
21152111
{
2112+
bool setDefault = reinterpret_cast<bool *>(setToDefault);
2113+
2114+
// if we're just resetting the cursor and nothing else
2115+
if (setDefault == true)
2116+
{
2117+
app->mainWin->cursor(FL_CURSOR_DEFAULT);
2118+
return;
2119+
}
2120+
21162121
if (app->vncViewer == NULL)
21172122
return;
21182123

src/app.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* app.h - part of SpiritVNC - FLTK
3-
* 2016-2022 Will Brokenbourgh https://www.pismotek.com/brainout/
3+
* 2016-2023 Will Brokenbourgh https://www.pismotek.com/brainout/
44
*/
55

66
/*
@@ -285,7 +285,7 @@ void svHandleMainWindowEvents (Fl_Widget *, void *);
285285
void svPositionWidgets ();
286286
void svHandleListItemIconChange (void * notUsed);
287287
void svHandleThreadConnection (void *);
288-
void svHandleThreadCursorChange (void * notUsed);
288+
void svHandleThreadCursorChange (void *);
289289
void svInsertEmptyItem ();
290290
int svItemNumFromItm (const HostItem *);
291291
HostItem * svItmFromVnc (const VncObject *);

src/consts_enums.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* consts_enums.h - part of SpiritVNC - FLTK
3-
* 2016-2022 Will Brokenbourgh https://www.pismotek.com/brainout/
3+
* 2016-2023 Will Brokenbourgh https://www.pismotek.com/brainout/
44
*/
55

66
/*
@@ -36,7 +36,7 @@
3636
#define CONSTS_H
3737

3838
/* constants */
39-
#define SV_APP_VERSION "0.4.12"
39+
#define SV_APP_VERSION "0.4.13"
4040

4141
#define SV_CURRENT_YEAR "2023"
4242

src/spiritvnc.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* spiritvnc.cxx - part of SpiritVNC - FLTK
3-
* 2016-2022 Will Brokenbourgh https://www.pismotek.com/brainout/
3+
* 2016-2023 Will Brokenbourgh https://www.pismotek.com/brainout/
44
*
55
* To God be the glory! In Jesus name! :-D
66
*

src/vnc.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* vnc.cxx - part of SpiritVNC - FLTK
3-
* 2016-2022 Will Brokenbourgh https://www.pismotek.com/brainout/
3+
* 2016-2023 Will Brokenbourgh https://www.pismotek.com/brainout/
44
*/
55

66
/*
@@ -456,7 +456,7 @@ void VncObject::handleCursorShapeChange (rfbClient * cl, int xHot, int yHot, int
456456
vnc->nCursorXHot = xHot;
457457
vnc->nCursorYHot = yHot;
458458

459-
svHandleThreadCursorChange(NULL);
459+
Fl::awake(svHandleThreadCursorChange, reinterpret_cast<void *>(false));
460460

461461
delete img;
462462
}
@@ -892,7 +892,8 @@ void VncObject::checkVNCMessages (VncObject * vnc)
892892
return;
893893
}
894894
else
895-
Fl::awake();
895+
//Fl::awake();
896+
Fl::check();
896897
}
897898
}
898899

@@ -1150,13 +1151,12 @@ int VncViewer::handle (int event)
11501151
// ** misc events **
11511152
case FL_ENTER:
11521153
if (vnc->imgCursor != NULL && itm->showRemoteCursor == true)
1153-
svHandleThreadCursorChange(NULL);
1154+
Fl::awake(svHandleThreadCursorChange, reinterpret_cast<void *>(false));
11541155
return 1;
11551156
break;
11561157

11571158
case FL_LEAVE:
1158-
app->mainWin->cursor(FL_CURSOR_DEFAULT);
1159-
Fl::wait();
1159+
Fl::awake(svHandleThreadCursorChange, reinterpret_cast<void *>(true));
11601160
return 1;
11611161
break;
11621162

0 commit comments

Comments
 (0)