mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-13 07:06:10 +08:00
fixed problem with opening client and server. in some cases it
would fail to open in such a way that it could never succeed but it'd never stop retrying. now terminating when open fails such that it'll never succeed.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "CPrimaryClient.h"
|
||||
#include "IPrimaryScreenFactory.h"
|
||||
#include "IServer.h"
|
||||
#include "XScreen.h"
|
||||
#include "XSynergy.h"
|
||||
#include "CPrimaryScreen.h"
|
||||
#include "CClipboard.h"
|
||||
@@ -19,11 +20,15 @@ CPrimaryClient::CPrimaryClient(IPrimaryScreenFactory* screenFactory,
|
||||
m_seqNum(0)
|
||||
{
|
||||
assert(m_server != NULL);
|
||||
assert(screenFactory != NULL);
|
||||
|
||||
// create screen
|
||||
log((CLOG_DEBUG1 "creating primary screen"));
|
||||
m_screen = screenFactory->create(this, receiver);
|
||||
if (screenFactory != NULL) {
|
||||
m_screen = screenFactory->create(this, receiver);
|
||||
}
|
||||
if (m_screen == NULL) {
|
||||
throw XScreenOpenFailure();
|
||||
}
|
||||
}
|
||||
|
||||
CPrimaryClient::~CPrimaryClient()
|
||||
@@ -100,7 +105,7 @@ CPrimaryClient::onClipboardChanged(ClipboardID id, const CString& data)
|
||||
m_server->onClipboardChanged(id, m_seqNum, data);
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
CPrimaryClient::open()
|
||||
{
|
||||
// all clipboards are clean
|
||||
@@ -110,8 +115,6 @@ CPrimaryClient::open()
|
||||
|
||||
// now open the screen
|
||||
m_screen->open();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user