feat: remove defunct --no-xinitThreads option

based on https://github.com/input-leap/input-leap/pull/1503
This commit is contained in:
sithlord48
2025-06-11 23:47:06 -04:00
committed by Nick Bolton
parent bc350852e7
commit c2a658256e
7 changed files with 9 additions and 49 deletions

View File

@ -130,10 +130,6 @@ bool ArgParser::parsePlatformArgs(
argsBase.m_display = argv[++i];
}
else if (isArg(i, argc, argv, nullptr, "--no-xinitthreads")) {
argsBase.m_disableXInitThreads = true;
}
else {
// option not supported here
return false;

View File

@ -77,10 +77,6 @@ public:
/// @brief Stop this computer from sleeping
bool m_preventSleep = false;
#if WINAPI_XWINDOWS
bool m_disableXInitThreads = false;
#endif
protected:
/// @brief deletes pointers and sets the value to null
template <class T> static inline void destroy(T *&p)

View File

@ -105,7 +105,6 @@ void ClientApp::help()
<< " [--invert-scroll]"
#ifdef WINAPI_XWINDOWS
<< " [--display <display>]"
<< " [--no-xinitthreads]"
#endif
<< HELP_SYS_ARGS << HELP_COMMON_ARGS << " <server-address>"
<< "\n\n"
@ -123,7 +122,6 @@ void ClientApp::help()
#if WINAPI_XWINDOWS
<< " --display <display> when in X mode, connect to the X server\n"
<< " at <display>.\n"
<< " --no-xinitthreads do not call XInitThreads()\n"
#endif
<< HELP_COMMON_INFO_2 << "\n"
<< "* marks defaults.\n"
@ -180,11 +178,7 @@ deskflow::Screen *ClientApp::createScreen()
#if WINAPI_XWINDOWS
LOG((CLOG_INFO "using legacy x windows screen"));
return new deskflow::Screen(
new XWindowsScreen(
args().m_display, false, args().m_disableXInitThreads, args().m_yscroll, m_events,
args().m_clientScrollDirection
),
m_events
new XWindowsScreen(args().m_display, false, args().m_yscroll, m_events, args().m_clientScrollDirection), m_events
);
#endif

View File

@ -107,7 +107,7 @@ void ServerApp::help()
<< " [--address <address>]"
#if WINAPI_XWINDOWS
<< " [--display <display>] [--no-xinitthreads]"
<< " [--display <display>]"
#endif
<< HELP_SYS_ARGS HELP_COMMON_ARGS "\n"
@ -127,7 +127,6 @@ void ServerApp::help()
#if WINAPI_XWINDOWS
<< " --display <display> when in X mode, connect to the X server\n"
<< " at <display>.\n"
<< " --no-xinitthreads do not call XInitThreads()\n"
#endif
<< "* marks defaults.\n"
@ -517,9 +516,7 @@ deskflow::Screen *ServerApp::createScreen()
#if WINAPI_XWINDOWS
LOG((CLOG_INFO "using legacy x windows screen"));
return new deskflow::Screen(
new XWindowsScreen(args().m_display, true, args().m_disableXInitThreads, 0, m_events), m_events
);
return new deskflow::Screen(new XWindowsScreen(args().m_display, true, 0, m_events), m_events);
#elif WINAPI_CARBON
return new deskflow::Screen(new OSXScreen(m_events, true), m_events);
#endif

View File

@ -86,7 +86,7 @@ static int xi_opcode;
XWindowsScreen *XWindowsScreen::s_screen = nullptr;
XWindowsScreen::XWindowsScreen(
const char *displayName, bool isPrimary, bool disableXInitThreads, int mouseScrollDelta, IEventQueue *events,
const char *displayName, bool isPrimary, int mouseScrollDelta, IEventQueue *events,
deskflow::ClientScrollDirection scrollDirection
)
: PlatformScreen(events, scrollDirection),
@ -101,12 +101,8 @@ XWindowsScreen::XWindowsScreen(
m_mouseScrollDelta = 120;
s_screen = this;
if (!disableXInitThreads) {
// initializes Xlib support for concurrent threads.
if (XInitThreads() == 0)
throw std::runtime_error("XInitThreads() returned zero");
} else {
LOG((CLOG_DEBUG "skipping XInitThreads()"));
if (XInitThreads() == 0) {
throw std::runtime_error("XInitThreads() returned zero");
}
// set the X I/O error handler so we catch the display disconnecting

View File

@ -31,7 +31,7 @@ class XWindowsScreen : public PlatformScreen
{
public:
XWindowsScreen(
const char *displayName, bool isPrimary, bool disableXInitThreads, int mouseScrollDelta, IEventQueue *events,
const char *displayName, bool isPrimary, int mouseScrollDelta, IEventQueue *events,
deskflow::ClientScrollDirection m_clientScrollDirection = deskflow::ClientScrollDirection::SERVER
);
~XWindowsScreen() override;

View File

@ -197,15 +197,7 @@ void ArgParserTests::serverArgs()
{
deskflow::ServerArgs args;
args.m_daemon = false;
char const *argv[] = {
"deskflow", "--help"
#if WINAPI_XWINDOWS
,
"--no-xinitthreads"
#endif
,
"--res-w", "888"
};
char const *argv[] = {"deskflow", "--help", "--res-w", "888"};
QVERIFY(m_parser.parseServerArgs(args, sizeof(argv) / sizeof(argv[0]), argv));
QVERIFY(args.m_shouldExitOk);
@ -215,18 +207,7 @@ void ArgParserTests::clientArgs()
{
deskflow::ClientArgs args;
args.m_daemon = false;
char const *argv[] = {
kAppId,
"--help"
#if WINAPI_XWINDOWS
,
"--no-xinitthreads"
#endif
,
"--res-w",
"888",
"127.0.0.1"
};
char const *argv[] = {kAppId, "--help", "--res-w", "888", "127.0.0.1"};
QVERIFY(m_parser.parseClientArgs(args, sizeof(argv) / sizeof(argv[0]), argv));
QVERIFY(args.m_shouldExitOk);