From 9e1549647b49b8048a08df2c0c1cca551b02eb77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 18 Jul 2023 02:32:07 -0400 Subject: [PATCH] ecode macOS fixes (WIP) --- src/thirdparty/efsw | 2 +- src/tools/ecode/ecode.cpp | 4 +++- src/tools/ecode/plugins/lsp/lspclientplugin.cpp | 3 ++- src/tools/ecode/universallocator.cpp | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/thirdparty/efsw b/src/thirdparty/efsw index 03e36f9f8..ac1a2fc2c 160000 --- a/src/thirdparty/efsw +++ b/src/thirdparty/efsw @@ -1 +1 @@ -Subproject commit 03e36f9f80170881a145161e66b62fdf8bb30cc8 +Subproject commit ac1a2fc2cb7d41d3aa9f655347e48df97e2489bd diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index e66f936d4..0489a0070 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -170,7 +170,9 @@ void App::setAppTitle( const std::string& title ) { if ( mBenchmarkMode ) fullTitle += " - " + String::toString( mWindow->getFPS() ) + " FPS"; - mWindow->setTitle( fullTitle ); + mUISceneNode->runOnMainThread( [this, fullTitle] { + mWindow->setTitle( fullTitle ); + } ); } void App::onDocumentModified( UICodeEditor* editor, TextDocument& ) { diff --git a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp index 21ec3d23d..821b6354d 100644 --- a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp @@ -271,7 +271,8 @@ PluginRequestHandle LSPClientPlugin::processWorkspaceSymbol( const PluginMessage if ( servers.empty() ) return {}; - std::string query = msg.asJSON().value( "query", "" ); + json jmsg = msg.asJSON(); + std::string query = jmsg.value( "query", "" ); for ( const auto server : servers ) { server->workspaceSymbol( query, [&, query]( const PluginIDType& id, LSPSymbolInformationList&& info ) { diff --git a/src/tools/ecode/universallocator.cpp b/src/tools/ecode/universallocator.cpp index 32fed19f7..8a4483012 100644 --- a/src/tools/ecode/universallocator.cpp +++ b/src/tools/ecode/universallocator.cpp @@ -412,7 +412,7 @@ void UniversalLocator::updateLocateBarSync() { mLocateTable->setPixelsSize( width, mLocateTable->getRowHeight() * LOCATEBAR_MAX_VISIBLE_ITEMS ); width -= mLocateTable->getVerticalScrollBar()->getPixelsSize().getWidth(); - if ( mLocateTable->getModel()->columnCount() >= 2 ) { + if ( mLocateTable->getModel() && mLocateTable->getModel()->columnCount() >= 2 ) { mLocateTable->setColumnsVisible( { 0, 1 } ); mLocateTable->setColumnWidth( 0, eeceil( width * 0.5 ) ); mLocateTable->setColumnWidth( 1, width - mLocateTable->getColumnWidth( 0 ) ); @@ -719,7 +719,8 @@ void UniversalLocator::requestWorkspaceSymbol() { } mLocateTable->setModel( mWorkspaceSymbolModel ); - json j = json{ json{ "query", mWorkspaceSymbolQuery } }; + json j; + j["query"] = mWorkspaceSymbolQuery; mApp->getPluginManager()->sendRequest( PluginMessageType::WorkspaceSymbol, PluginMessageFormat::JSON, &j ); } else if ( mWorkspaceSymbolModel && mWorkspaceSymbolModel.get() != mLocateTable->getModel() ) {