From cbd742ebb52f4ef3e7c7f6c462dc8f4887780953 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 24 Feb 2018 11:29:07 +1100 Subject: [PATCH 1/4] Fix -Wreorder warnings --- src/lib/core/ArgsBase.cpp | 8 ++++---- src/lib/platform/XWindowsEventQueueBuffer.cpp | 4 ++-- src/lib/platform/XWindowsScreen.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/core/ArgsBase.cpp b/src/lib/core/ArgsBase.cpp index 81b08f6c..d9154ad4 100644 --- a/src/lib/core/ArgsBase.cpp +++ b/src/lib/core/ArgsBase.cpp @@ -27,10 +27,6 @@ m_stopOnDeskSwitch(false), #else m_daemon(true), // backward compatibility for unix (daemon by default) #endif -#if WINAPI_XWINDOWS -m_disableXInitThreads(false), -m_runAsUid(-1), -#endif m_backend(false), m_restartable(true), m_noHooks(false), @@ -39,6 +35,10 @@ m_logFilter(nullptr), m_logFile(nullptr), m_display(nullptr), m_enableDragDrop(false), +#if WINAPI_XWINDOWS +m_disableXInitThreads(false), +m_runAsUid(-1), +#endif m_shouldExit(false), m_profileDirectory(""), m_pluginDirectory("") diff --git a/src/lib/platform/XWindowsEventQueueBuffer.cpp b/src/lib/platform/XWindowsEventQueueBuffer.cpp index 3bdaa557..5c98f3ac 100644 --- a/src/lib/platform/XWindowsEventQueueBuffer.cpp +++ b/src/lib/platform/XWindowsEventQueueBuffer.cpp @@ -54,10 +54,10 @@ class EventQueueTimer { }; XWindowsEventQueueBuffer::XWindowsEventQueueBuffer( Display* display, Window window, IEventQueue* events) : - m_events(events), m_display(display), m_window(window), - m_waiting(false) + m_waiting(false), + m_events(events) { assert(m_display != NULL); assert(m_window != None); diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 9dd0b40d..6100e3b0 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -97,6 +97,7 @@ XWindowsScreen::XWindowsScreen( bool disableXInitThreads, int mouseScrollDelta, IEventQueue* events) : + PlatformScreen(events), m_isPrimary(isPrimary), m_mouseScrollDelta(mouseScrollDelta), m_display(nullptr), @@ -121,8 +122,7 @@ XWindowsScreen::XWindowsScreen( m_xkb(false), m_xi2detected(false), m_xrandr(false), - m_events(events), - PlatformScreen(events) + m_events(events) { assert(s_screen == NULL); @@ -1415,8 +1415,8 @@ XWindowsScreen::handleSystemEvent(const Event& event, void* /*unused*/) #if HAVE_X11_EXTENSIONS_XRANDR_H if (m_xrandr) { - if (xevent->type == m_xrandrEventBase + RRScreenChangeNotify - || xevent->type == m_xrandrEventBase + RRNotify + if ((xevent->type == m_xrandrEventBase + RRScreenChangeNotify + || xevent->type == m_xrandrEventBase + RRNotify) && reinterpret_cast(xevent)->subtype == RRNotify_CrtcChange) { LOG((CLOG_INFO "XRRScreenChangeNotifyEvent or RRNotify_CrtcChange received")); From d2a331c3766230530a740216ece8bd5f5bb36bff Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 24 Feb 2018 11:44:07 +1100 Subject: [PATCH 2/4] Fix compile error --- src/lib/core/App.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/core/App.cpp b/src/lib/core/App.cpp index aa5db401..c3a7db64 100644 --- a/src/lib/core/App.cpp +++ b/src/lib/core/App.cpp @@ -175,7 +175,7 @@ App::initApp(int argc, const char** argv) // this is a simple way to allow the core process to talk to X. this avoids // the "WARNING: primary screen unavailable: unable to open screen" error. // a better way would be to use xauth cookie and dbus to get access to X. - if (static_cast((!(argsBase().m_runAsUid) == 0 != -1))) { + if (argsBase().m_runAsUid >= 0) { if (setuid(argsBase().m_runAsUid) == 0) { LOG((CLOG_DEBUG "process uid was set to: %d", argsBase().m_runAsUid)); } From a0616a54be0e3fbab6138c782f1aab31ea6d453e Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 24 Feb 2018 12:46:49 +1100 Subject: [PATCH 3/4] Update .gitignore Ignore generated cmake files and directories. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 9bd8c19d..8f484c9f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ config.h .DS_Store *.pyc *.o +*.a *~ \.*.swp *build-gui-Desktop_Qt* @@ -20,3 +21,6 @@ src/gui/.rnd src/setup/win32/synergy.suo CMakeCache.txt CMakeLists.txt.user +Makefile +cmake_install.cmake +CMakeFiles/ From d2f6e56e5396e39d58a1188b7b63ba3c5afad084 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 11 Mar 2018 15:01:59 +1100 Subject: [PATCH 4/4] Fix a memory leak --- src/lib/arch/unix/ArchMultithreadPosix.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/arch/unix/ArchMultithreadPosix.cpp b/src/lib/arch/unix/ArchMultithreadPosix.cpp index 599d3b88..7b40dd46 100644 --- a/src/lib/arch/unix/ArchMultithreadPosix.cpp +++ b/src/lib/arch/unix/ArchMultithreadPosix.cpp @@ -150,6 +150,7 @@ ArchMultithreadPosix::~ArchMultithreadPosix() closeMutex(m_threadMutex); s_instance = nullptr; + delete m_mainThread; } void