@@ -601,7 +601,6 @@ void svConfigWrite ()
601601 ofs << " vncpass=" << base64Encode (reinterpret_cast <const unsigned char *>
602602 (itm->vncPassword .c_str ()), itm->vncPassword .size ()) << std::endl;
603603 ofs << " type=" << itm->hostType << std::endl;
604- // ofs << "sshkeypublic=" << itm->sshKeyPublic << std::endl;
605604 ofs << " sshkeyprivate=" << itm->sshKeyPrivate << std::endl;
606605 ofs << " sshuser=" << itm->sshUser << std::endl;
607606 ofs << " sshpass=" << itm->sshPass << std::endl;
@@ -1911,43 +1910,33 @@ void svHandleMainWindowEvents (Fl_Widget * window, void *)
19111910void svPositionWidgets ()
19121911{
19131912 // only continue if main window geometry changes
1914- if (app->mainWin ->w () != app->nMainWinPreviousW
1915- || app->mainWin ->h () != app->nMainWinPreviousH )
1916- {
1917- svDebugLog (" svPositionWidgets - Resizing GUI elements" );
1918-
1919- // store window geometry for comparison later
1920- app->nMainWinPreviousW = app->mainWin ->w ();
1921- app->nMainWinPreviousH = app->mainWin ->h ();
1922-
1923- // resize the host list vertically if the main window resizes
1924- app->hostList ->size (app->hostList ->w (), app->mainWin ->h () - 26 );
1913+ svDebugLog (" svPositionWidgets - Resizing GUI elements" );
19251914
1926- // set list buttons position
1927- app->packButtons -> position ( 3 , app->hostList ->x () + app->hostList ->h () + 3 );
1915+ // resize the host list vertically if the main window resizes
1916+ app->hostList -> size ( app->hostList ->w (), app->mainWin ->h () - 26 );
19281917
1929- // don't allow host list width to be smaller than right-most button's x+w
1930- if (app->hostList ->w () < (app->packButtons ->x () + app->packButtons ->w ()))
1931- app->hostList ->size ((app->packButtons ->x () + app->packButtons ->w ()), app->hostList ->h ());
1918+ // set list buttons position
1919+ app->packButtons ->position (3 , app->hostList ->x () + app->hostList ->h () + 3 );
19321920
1933- // set scroller x
1934- app-> scroller -> position (app->hostList ->x () + app->hostList -> w () + 3 , app->scroller -> y ());
1935- app->scroller -> redraw ( );
1921+ // don't allow host list width to be smaller than right-most button's x+w
1922+ if (app->hostList ->w () < ( app->packButtons -> x () + app->packButtons -> w ()))
1923+ app->hostList -> size ((app-> packButtons -> x () + app-> packButtons -> w ()), app-> hostList -> h () );
19361924
1937- VncObject * vnc = app->vncViewer ->vnc ;
1938-
1939- // reset scroller position
1940- if (vnc != NULL )
1941- {
1942- svResizeScroller ();
1943- vnc->setObjectVisible ();
1944- }
1925+ // set scroller x
1926+ app->scroller ->position (app->hostList ->x () + app->hostList ->w () + 3 , app->scroller ->y ());
1927+ app->scroller ->redraw ();
19451928
1946- Fl::redraw ();
1947- Fl::check ();
1929+ VncObject * vnc = app->vncViewer ->vnc ;
19481930
1949- return ;
1931+ // reset scroller position
1932+ if (vnc != NULL )
1933+ {
1934+ svResizeScroller ();
1935+ vnc->setObjectVisible ();
19501936 }
1937+
1938+ Fl::redraw ();
1939+ Fl::check ();
19511940}
19521941
19531942
@@ -1967,9 +1956,9 @@ void svHandleListItemIconChange (void *)
19671956
19681957 if (itm != NULL && itm->icon != NULL )
19691958 {
1970- Fl::lock ();
1959+ // Fl::lock(); // <<<--- commenting out because this is main thread ---<<<
19711960 app->hostList ->icon (i, itm->icon );
1972- Fl::unlock ();
1961+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
19731962 Fl::check ();
19741963 }
19751964 }
@@ -1978,7 +1967,7 @@ void svHandleListItemIconChange (void *)
19781967}
19791968
19801969
1981- /* handle messages from child threads */
1970+ /* handle connection changes from child threads */
19821971void svHandleThreadConnection (void * data)
19831972{
19841973 HostItem * itm = static_cast <HostItem *>(data);
@@ -2026,8 +2015,9 @@ void svHandleThreadConnection (void * data)
20262015
20272016 std::string strHostViewName = " Listening - " ;
20282017 strHostViewName.append (vnc->vncClient ->desktopName );
2018+ itm->name = strHostViewName;
20292019
2030- app->hostList ->text (nListeningItem, strHostViewName.c_str ());
2020+ app->hostList ->text (nListeningItem, itm-> name . c_str ()); // strHostViewName.c_str());
20312021
20322022 // (try to) create another listener
20332023 svDebugLog (" svConnectionWatcher - Creating Listener object" );
@@ -2126,7 +2116,7 @@ void svHandleThreadCursorChange (void * setToDefault)
21262116 if (vnc == NULL )
21272117 return ;
21282118
2129- Fl::lock ();
2119+ // Fl::lock(); // <<<--- commenting out because this is main thread ---<<<
21302120
21312121 // set cursor, if valid
21322122 if (vnc->imgCursor != NULL )
@@ -2136,7 +2126,7 @@ void svHandleThreadCursorChange (void * setToDefault)
21362126 } else
21372127 app->mainWin ->cursor (FL_CURSOR_DEFAULT);
21382128
2139- Fl::unlock ();
2129+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
21402130}
21412131
21422132
@@ -2149,17 +2139,16 @@ void svInsertEmptyItem ()
21492139 itm->hostAddress = " 192.168.0.1" ;
21502140 itm->vncPort = " 5900" ;
21512141 itm->scaling = ' f' ;
2152- // itm->sshKeyPublic = "";
21532142 itm->sshKeyPrivate = " " ;
21542143 itm->showRemoteCursor = true ;
21552144 itm->compressLevel = 5 ;
21562145 itm->qualityLevel = 5 ;
21572146
2158- Fl::lock ();
2147+ // Fl::lock(); // <<<--- commenting out because this is main thread ---<<<
21592148 app->hostList ->add (itm->name .c_str (), itm);
21602149 app->hostList ->icon (app->hostList ->size (), app->iconDisconnected );
21612150 app->hostList ->make_visible (app->hostList ->size ());
2162- Fl::unlock ();
2151+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
21632152
21642153 Fl::redraw ();
21652154 Fl::check ();
@@ -2175,7 +2164,7 @@ int svItemNumFromItm (const HostItem * itmIn)
21752164 HostItem * itm = NULL ;
21762165 uint16_t nSize = app->hostList ->size ();
21772166
2178- Fl::lock ();
2167+ // Fl::lock(); // <<<--- commenting out because this is main thread ---<<<
21792168
21802169 // go through hostlist and find item owning matching itmIn
21812170 for (uint16_t i = 0 ; i <= nSize; i ++)
@@ -2185,13 +2174,13 @@ int svItemNumFromItm (const HostItem * itmIn)
21852174
21862175 if (itm != NULL && itm == itmIn)
21872176 {
2188- Fl::unlock ();
2177+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
21892178
21902179 return i;
21912180 }
21922181 }
21932182
2194- Fl::unlock ();
2183+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
21952184
21962185 return 0 ;
21972186}
@@ -2206,7 +2195,7 @@ HostItem * svItmFromVnc (const VncObject * vncIn)
22062195 HostItem * itm = NULL ;
22072196 uint16_t nSize = app->hostList ->size ();
22082197
2209- Fl::lock ();
2198+ // Fl::lock(); // <<<--- commenting out because this is main thread ---<<<
22102199
22112200 for (uint16_t i = 0 ; i <= nSize; i ++)
22122201 {
@@ -2217,14 +2206,14 @@ HostItem * svItmFromVnc (const VncObject * vncIn)
22172206 {
22182207 if (itm->vnc == vncIn)
22192208 {
2220- Fl::unlock ();
2209+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
22212210
22222211 return itm;
22232212 }
22242213 }
22252214 }
22262215
2227- Fl::unlock ();
2216+ // Fl::unlock(); // <<<--- commenting out because this is main thread ---<<<
22282217
22292218 return NULL ;
22302219}
@@ -2928,7 +2917,6 @@ void svShowItemOptions (HostItem * im)
29282917 itm->vncPort = " 5900" ;
29292918 itm->sshPort = " " ;
29302919 itm->scaling = ' s' ;
2931- // itm->sshKeyPublic = "";
29322920 itm->sshKeyPrivate = " " ;
29332921 itm->showRemoteCursor = true ;
29342922 itm->compressLevel = 5 ;
0 commit comments