Compare commits

..

1 Commits

Author SHA1 Message Date
Martin Furter
020ae96bf3 Restoring terminal settings after daemonizing.
Signed-off-by: Dom Rodriguez <shymega@shymega.org.uk>
2021-11-06 21:48:05 +00:00
17 changed files with 23 additions and 45 deletions

View File

@@ -86,7 +86,7 @@ specific packages.
**Q: Does drag and drop work on linux?**
> A: No *(see [#855](https://github.com/debauchee/barrier/issues/855) if you'd like to change that)*
> A: No *(see [#855](https://github.com/debauchee/barrier/issues/544) if you'd like to change that)*
**Q: What OSes are supported?**

View File

@@ -1 +0,0 @@
Fixed FAQ link to Linux drag and drop issue.

View File

@@ -1 +0,0 @@
Fixed a regression in 2.4.0 that caused Barrier to not support scaling other than 100% (https://github.com/debauchee/barrier/issues/1462).

View File

@@ -21,9 +21,7 @@ set(sources
if (WIN32)
file(GLOB arch_headers "MSWindows*.h")
file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
barrierc.rc
barrierc.exe.manifest)
list(APPEND sources barrierc.rc)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
file(GLOB arch_sources "OSX*.cpp")

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

View File

@@ -21,9 +21,7 @@ set(sources
if (WIN32)
file(GLOB arch_headers "MSWindows*.h")
file(GLOB arch_sources "MSWindows*.cpp")
list(APPEND sources
barriers.rc
barriers.exe.manifest)
list(APPEND sources barriers.rc)
elseif (APPLE)
file(GLOB arch_headers "OSX*.h")
file(GLOB arch_sources "OSX*.cpp")

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

View File

@@ -20,6 +20,7 @@
#include "arch/unix/XArchUnix.h"
#include "base/Log.h"
#include "barrier/App.h"
#include <unistd.h>
#include <sys/types.h>
@@ -86,6 +87,8 @@ ArchDaemonUnix::daemonize(const char* name, DaemonFunc func)
break;
default:
// first restore terminal settings
App::instance().getEvents()->restoreTerminal();
// parent exits
exit(0);
}

View File

@@ -98,7 +98,7 @@ FileChunk::assemble(barrier::IStream* stream, String& dataReceived, size_t& expe
case kDataChunk:
dataReceived.append(content);
if (CLOG->getFilter() >= kDEBUG2) {
LOG((CLOG_DEBUG2 "recv file chunk size=%i", content.size()));
LOG((CLOG_DEBUG2 "recv file chunck size=%i", content.size()));
double interval = stopwatch.getTime();
receivedDataSize += content.size();
LOG((CLOG_DEBUG2 "recv file interval=%f s", interval));

View File

@@ -63,6 +63,7 @@ public:
virtual Event::Type getRegisteredType(const std::string& name) const;
void* getSystemTarget();
virtual void waitForReady() const;
virtual void restoreTerminal() const { m_parentStream.restoreTerminal(); }
private:
UInt32 saveEvent(const Event& event);

View File

@@ -184,6 +184,11 @@ public:
be added.
*/
virtual void waitForReady() const = 0;
//! Restore the terminal settings
/*!
Called to restore the terminal settings after daemonizing.
*/
virtual void restoreTerminal() const = 0;
//@}
//! @name accessors

View File

@@ -57,4 +57,10 @@ bool NonBlockingStream::try_read_char(char &ch) const
return false;
}
void NonBlockingStream::restoreTerminal() const
{
tcsetattr(_fd, TCSANOW, _p_ta_previous);
fcntl(_fd, F_SETFL, _cntl_previous);
}
#endif // !defined(_WIN32)

View File

@@ -39,6 +39,7 @@ public:
~NonBlockingStream();
bool try_read_char(char &ch) const;
void restoreTerminal(void) const;
private:
int _fd;

View File

@@ -190,7 +190,7 @@ void generate_pem_self_signed_cert(const std::string& path)
X509_sign(cert, private_key, EVP_sha256());
auto fp = fopen_utf8_path(path.c_str(), "w");
auto fp = fopen_utf8_path(path.c_str(), "r");
if (!fp) {
throw std::runtime_error("Could not open certificate output path");
}

View File

@@ -324,7 +324,7 @@ XWindowsScreen::leave()
m_impl->XGetInputFocus(m_display, &m_lastFocus, &m_lastFocusRevert);
// take focus
if (!m_preserveFocus) {
if (m_isPrimary || !m_preserveFocus) {
m_impl->XSetInputFocus(m_display, m_window, RevertToPointerRoot, CurrentTime);
}

View File

@@ -64,4 +64,5 @@ public:
MOCK_METHOD0(forClipboard, ClipboardEvents&());
MOCK_METHOD0(forFile, FileEvents&());
MOCK_CONST_METHOD0(waitForReady, void());
MOCK_CONST_METHOD0(restoreTerminal, void());
};