diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ServerResolver.cpp | 2 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut_win.cpp | 84 | ||||
-rw-r--r-- | src/mumble/ServerHandler.cpp | 10 | ||||
-rw-r--r-- | src/mumble/ServerHandler.h | 1 |
4 files changed, 48 insertions, 49 deletions
diff --git a/src/ServerResolver.cpp b/src/ServerResolver.cpp index 7191fd5a0..6dc225ca7 100644 --- a/src/ServerResolver.cpp +++ b/src/ServerResolver.cpp @@ -91,7 +91,7 @@ void ServerResolverPrivate::hostResolved(QHostInfo hostInfo) { foreach (QHostAddress ha, resolvedAddresses) { addresses << HostAddress(ha); } qint64 priority = normalizeSrvPriority(record.priority(), record.weight()); - m_resolved << ServerResolverRecord(m_origHostname, record.port(), priority, addresses); + m_resolved << ServerResolverRecord(record.target(), record.port(), priority, addresses); } m_srvQueueRemain -= 1; diff --git a/src/mumble/GlobalShortcut_win.cpp b/src/mumble/GlobalShortcut_win.cpp index 170098b0a..9f3c43cc3 100644 --- a/src/mumble/GlobalShortcut_win.cpp +++ b/src/mumble/GlobalShortcut_win.cpp @@ -510,55 +510,47 @@ void GlobalShortcutWin::on_keyboardMessage(const uint16_t flags, uint16_t scanCo } void GlobalShortcutWin::on_mouseMessage(const uint16_t flags, const uint16_t data) { - InputMouse input; - bool down; + // Multiple mouse transitions can be contained in a single message. + // See https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawmouse. + if (flags & RI_MOUSE_BUTTON_1_DOWN) { + handleButton(QVariant::fromValue(InputMouse::Left), true); + } - switch (flags) { - case RI_MOUSE_BUTTON_1_DOWN: - input = InputMouse::Left; - down = true; - break; - case RI_MOUSE_BUTTON_1_UP: - input = InputMouse::Left; - down = false; - break; - case RI_MOUSE_BUTTON_2_DOWN: - input = InputMouse::Right; - down = true; - break; - case RI_MOUSE_BUTTON_2_UP: - input = InputMouse::Right; - down = false; - break; - case RI_MOUSE_BUTTON_3_DOWN: - input = InputMouse::Middle; - down = true; - break; - case RI_MOUSE_BUTTON_3_UP: - input = InputMouse::Middle; - down = false; - break; - case RI_MOUSE_BUTTON_4_DOWN: - input = InputMouse::Side_1; - down = true; - break; - case RI_MOUSE_BUTTON_4_UP: - input = InputMouse::Side_1; - down = false; - break; - case RI_MOUSE_BUTTON_5_DOWN: - input = InputMouse::Side_2; - down = true; - break; - case RI_MOUSE_BUTTON_5_UP: - input = InputMouse::Side_2; - down = false; - break; - default: - return; + if (flags & RI_MOUSE_BUTTON_1_UP) { + handleButton(QVariant::fromValue(InputMouse::Left), false); + } + + if (flags & RI_MOUSE_BUTTON_2_DOWN) { + handleButton(QVariant::fromValue(InputMouse::Right), true); + } + + if (flags & RI_MOUSE_BUTTON_2_UP) { + handleButton(QVariant::fromValue(InputMouse::Right), false); + } + + if (flags & RI_MOUSE_BUTTON_3_DOWN) { + handleButton(QVariant::fromValue(InputMouse::Middle), true); + } + + if (flags & RI_MOUSE_BUTTON_3_UP) { + handleButton(QVariant::fromValue(InputMouse::Middle), false); } - handleButton(QVariant::fromValue(input), down); + if (flags & RI_MOUSE_BUTTON_4_DOWN) { + handleButton(QVariant::fromValue(InputMouse::Side_1), true); + } + + if (flags & RI_MOUSE_BUTTON_4_UP) { + handleButton(QVariant::fromValue(InputMouse::Side_1), false); + } + + if (flags & RI_MOUSE_BUTTON_5_DOWN) { + handleButton(QVariant::fromValue(InputMouse::Side_2), true); + } + + if (flags & RI_MOUSE_BUTTON_5_UP) { + handleButton(QVariant::fromValue(InputMouse::Side_2), false); + } } GlobalShortcutWin::DeviceMap::iterator GlobalShortcutWin::addDevice(const HANDLE deviceHandle) { diff --git a/src/mumble/ServerHandler.cpp b/src/mumble/ServerHandler.cpp index cb3f17c81..94e81bd29 100644 --- a/src/mumble/ServerHandler.cpp +++ b/src/mumble/ServerHandler.cpp @@ -359,10 +359,16 @@ void ServerHandler::hostnameResolved() { // Create the list of target host:port pairs // that the ServerHandler should try to connect to. QList< ServerAddress > ql; + QHash< ServerAddress, QString > qh; foreach (ServerResolverRecord record, records) { - foreach (HostAddress addr, record.addresses()) { ql.append(ServerAddress(addr, record.port())); } + foreach (HostAddress addr, record.addresses()) { + auto sa = ServerAddress(addr, record.port()); + ql.append(sa); + qh[sa] = record.hostname(); + } } qlAddresses = ql; + qhHostnames = qh; // Exit the event loop with 'success' status code, // to continue connecting to the server. @@ -392,7 +398,7 @@ void ServerHandler::run() { qbaDigest = QByteArray(); bStrong = true; qtsSock = new QSslSocket(this); - qtsSock->setPeerVerifyName(qsHostName); + qtsSock->setPeerVerifyName(qhHostnames[saTargetServer]); if (!Global::get().s.bSuppressIdentity && CertWizard::validateCert(Global::get().s.kpCertificate)) { qtsSock->setPrivateKey(Global::get().s.kpCertificate.second); diff --git a/src/mumble/ServerHandler.h b/src/mumble/ServerHandler.h index 8307938aa..3fed29bde 100644 --- a/src/mumble/ServerHandler.h +++ b/src/mumble/ServerHandler.h @@ -105,6 +105,7 @@ public: boost::shared_ptr< VoiceRecorder > recorder; QSslSocket *qtsSock; QList< ServerAddress > qlAddresses; + QHash< ServerAddress, QString > qhHostnames; ServerAddress saTargetServer; unsigned int uiVersion; |