mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 06:31:50 +08:00
Merge branch 'v1-dev' into v1-issue-6407-enterprise-autoconfig5
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <qbuttongroup.h>
|
||||
|
||||
ActionDialog::ActionDialog(QWidget* parent, ServerConfig& config, Hotkey& hotkey, Action& action) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
|
||||
@@ -764,14 +764,27 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_pLineEditHostname->text().isEmpty()) {
|
||||
show();
|
||||
QMessageBox::warning(
|
||||
this, tr("Hostname is empty"),
|
||||
tr("Please fill in a hostname for the synergy client to connect to."));
|
||||
return false;
|
||||
}
|
||||
if (m_pLineEditHostname->text().isEmpty())
|
||||
{
|
||||
#ifndef SYNERGY_ENTERPRISE
|
||||
//check if autoconfig mode is enabled
|
||||
if (!appConfig().autoConfig())
|
||||
{
|
||||
#endif
|
||||
show();
|
||||
QMessageBox::warning(
|
||||
this, tr("Hostname is empty"),
|
||||
tr("Please fill in a hostname for the synergy client to connect to."));
|
||||
return false;
|
||||
|
||||
#ifndef SYNERGY_ENTERPRISE
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <qheaderview.h>
|
||||
|
||||
ScreenSetupView::ScreenSetupView(QWidget* parent) :
|
||||
QTableView(parent)
|
||||
|
||||
@@ -199,6 +199,7 @@ SecureSocket::doWrite()
|
||||
{
|
||||
static bool s_retry = false;
|
||||
static int s_retrySize = 0;
|
||||
static int s_staticBufferSize = 0;
|
||||
static void* s_staticBuffer = NULL;
|
||||
|
||||
// write data
|
||||
@@ -211,8 +212,13 @@ SecureSocket::doWrite()
|
||||
}
|
||||
else {
|
||||
bufferSize = m_outputBuffer.getSize();
|
||||
s_staticBuffer = malloc(bufferSize);
|
||||
memcpy(s_staticBuffer, m_outputBuffer.peek(bufferSize), bufferSize);
|
||||
if (bufferSize != 0) {
|
||||
if (bufferSize > s_staticBufferSize) {
|
||||
s_staticBuffer = realloc(s_staticBuffer, bufferSize);
|
||||
s_staticBufferSize = bufferSize;
|
||||
}
|
||||
memcpy(s_staticBuffer, m_outputBuffer.peek(bufferSize), bufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
if (bufferSize == 0) {
|
||||
@@ -224,8 +230,6 @@ SecureSocket::doWrite()
|
||||
if (status > 0) {
|
||||
s_retry = false;
|
||||
bufferSize = 0;
|
||||
free(s_staticBuffer);
|
||||
s_staticBuffer = NULL;
|
||||
}
|
||||
else if (status < 0) {
|
||||
return kBreak;
|
||||
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
void sendClipboardEvent(Event::Type type, ClipboardID id) const;
|
||||
|
||||
// message handlers
|
||||
bool onMouseMove(SInt32 mx, SInt32 my);
|
||||
bool onMouseMove(CGFloat mx, CGFloat my);
|
||||
// mouse button handler. pressed is true if this is a mousedown
|
||||
// event, false if it is a mouseup event. macButton is the index
|
||||
// of the button pressed using the mac button mapping.
|
||||
|
||||
@@ -1080,20 +1080,20 @@ OSXScreen::handleSystemEvent(const Event& event, void*)
|
||||
}
|
||||
|
||||
bool
|
||||
OSXScreen::onMouseMove(SInt32 mx, SInt32 my)
|
||||
OSXScreen::onMouseMove(CGFloat mx, CGFloat my)
|
||||
{
|
||||
LOG((CLOG_DEBUG2 "mouse move %+d,%+d", mx, my));
|
||||
LOG((CLOG_DEBUG2 "mouse move %+f,%+f", mx, my));
|
||||
|
||||
SInt32 x = mx - m_xCursor;
|
||||
SInt32 y = my - m_yCursor;
|
||||
CGFloat x = mx - m_xCursor;
|
||||
CGFloat y = my - m_yCursor;
|
||||
|
||||
if ((x == 0 && y == 0) || (mx == m_xCenter && mx == m_yCenter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// save position to compute delta of next motion
|
||||
m_xCursor = mx;
|
||||
m_yCursor = my;
|
||||
m_xCursor = (SInt32)mx;
|
||||
m_yCursor = (SInt32)my;
|
||||
|
||||
if (m_isOnScreen) {
|
||||
// motion on primary screen
|
||||
@@ -1122,7 +1122,21 @@ OSXScreen::onMouseMove(SInt32 mx, SInt32 my)
|
||||
}
|
||||
else {
|
||||
// send motion
|
||||
sendEvent(m_events->forIPrimaryScreen().motionOnSecondary(), MotionInfo::alloc(x, y));
|
||||
// Accumulate together the move into the running total
|
||||
static CGFloat m_xFractionalMove = 0;
|
||||
static CGFloat m_yFractionalMove = 0;
|
||||
|
||||
m_xFractionalMove += x;
|
||||
m_yFractionalMove += y;
|
||||
|
||||
// Return the integer part
|
||||
SInt32 intX = (SInt32)m_xFractionalMove;
|
||||
SInt32 intY = (SInt32)m_yFractionalMove;
|
||||
|
||||
// And keep only the fractional part
|
||||
m_xFractionalMove -= intX;
|
||||
m_yFractionalMove -= intY;
|
||||
sendEvent(m_events->forIPrimaryScreen().motionOnSecondary(), MotionInfo::alloc(intX, intY));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user