Skip to content

Commit 21a3484

Browse files
committed
v2.16.7
1 parent fac5664 commit 21a3484

File tree

20 files changed

+249
-75
lines changed

20 files changed

+249
-75
lines changed

client/common/changelog.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2.16.7 (04/07/2025)
2+
All:
3+
* Added flag for Iran. #1413
4+
* Improved Russian translations. #1411
5+
* Fixed Look & Feel preferences not translated. #1412
6+
* Fixed 400 'header or cookie too large' for Cloudflare API endpoints. #1399
7+
* Fixed incorrectly formatted client log entries. #1416
8+
Windows:
9+
* Fixed playing a sound may capture the audio device, preventing Windows from sleeping. #1410
10+
MacOS:
11+
* Fixed wsnet not detecting OS Default DNS server when using DHCP. #1376
12+
* Fixed app firewall blocking Sidecar/Continuity features. #415
13+
* Fixed docked window is sometimes in the wrong position. #1334
14+
15+
116
2.16.6 (24/06/2025)
217
All:
318
* Fixed various UI bugs. #1151 #1400 #1401

client/common/utils/log/logger.cpp

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,45 @@
1515

1616
namespace log_utils {
1717

18+
19+
// The custom formatter that allows:
20+
// to output unformatted messages for the logger with "raw" name
21+
// to output messages for the logger with "qt" name for message from Qt loggers
22+
// to output messages for all other loggers with standard json pattern
23+
24+
class CustomFormatter : public spdlog::formatter {
25+
public:
26+
27+
explicit CustomFormatter(std::unique_ptr<spdlog::formatter> formatter)
28+
{
29+
formatter_ = std::move(formatter);
30+
jsonFormatter_ = log_utils::createJsonFormatter();
31+
}
32+
33+
virtual ~CustomFormatter() = default;
34+
35+
void format(const spdlog::details::log_msg &msg, spdlog::memory_buf_t &dest) override
36+
{
37+
if (msg.logger_name == "raw") {
38+
dest.append(msg.payload.data(), msg.payload.data() + msg.payload.size());
39+
} else if (msg.logger_name == "qt") {
40+
formatter_->format(msg, dest);
41+
} else {
42+
jsonFormatter_->format(msg, dest);
43+
}
44+
}
45+
46+
std::unique_ptr<formatter> clone() const override
47+
{
48+
return spdlog::details::make_unique<CustomFormatter>(formatter_->clone());
49+
}
50+
51+
private:
52+
std::unique_ptr<spdlog::formatter> formatter_;
53+
std::unique_ptr<spdlog::formatter> jsonFormatter_;
54+
};
55+
56+
1857
bool Logger::install(const QString &logFilePath, bool consoleOutput)
1958
{
2059
QLoggingCategory::setFilterRules("qt.tlsbackend.ossl=false\nqt.network.ssl=false");
@@ -38,7 +77,7 @@ bool Logger::install(const QString &logFilePath, bool consoleOutput)
3877
// Create rotation logger with 2 file with unlimited size
3978
// rotate it on open, the first file is the current log, the 2nd is the previous log
4079
auto fileSink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(path, SIZE_MAX, 1, true);
41-
auto defaultLogger = std::make_shared<spdlog::logger>("default", fileSink);
80+
auto defaultLogger = std::make_shared<spdlog::logger>("qt", fileSink);
4281
spdlog::set_default_logger(defaultLogger);
4382

4483
// Create the logger without formatting for logging output from libraries such as wsnet, which format logs themselves
@@ -96,16 +135,17 @@ void Logger::myMessageHandler(QtMsgType type, const QMessageLogContext &context,
96135
//::OutputDebugString(qUtf16Printable(s));
97136
#endif
98137

138+
auto qtLogger = spdlog::get("qt");
99139
std::string escapedMsg = log_utils::escape_string(s.toStdString());
100140
static const std::string fmt = "\"mod\": \"{}\", \"msg\": \"{}\"";
101141
if (type == QtDebugMsg)
102-
spdlog::debug(fmt, context.category, escapedMsg);
142+
qtLogger->debug(fmt, context.category, escapedMsg);
103143
else if (type == QtWarningMsg)
104-
spdlog::warn(fmt, context.category, escapedMsg);
144+
qtLogger->warn(fmt, context.category, escapedMsg);
105145
else if (type == QtInfoMsg)
106-
spdlog::info(fmt, context.category, escapedMsg);
146+
qtLogger->info(fmt, context.category, escapedMsg);
107147
else
108-
spdlog::error(fmt, context.category, escapedMsg);
148+
qtLogger->error(fmt, context.category, escapedMsg);
109149
}
110150

111151
void Logger::startConnectionMode(const std::string &id)
@@ -136,10 +176,8 @@ spdlog::logger *Logger::getSpdLogger(const std::string &category)
136176
{
137177
auto it = spd_loggers_.find(category);
138178
if (it == spd_loggers_.end()) {
139-
auto formatter = log_utils::createJsonFormatter();
140179
auto sinks = spdlog::default_logger()->sinks();
141180
auto logger = std::make_shared<spdlog::logger>(category, sinks.begin(), sinks.end());
142-
logger->set_formatter(std::move(formatter));
143181
spd_loggers_[category] = logger;
144182
return logger.get();
145183
} else {

client/common/utils/log/spdlog_utils.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -170,34 +170,6 @@ class customFormatterFlag : public spdlog::custom_flag_formatter
170170
}
171171
};
172172

173-
// The custom formatter that allows to output unformatted messages for the logger with "raw" name
174-
class CustomFormatter : public spdlog::formatter {
175-
public:
176-
177-
explicit CustomFormatter(std::unique_ptr<spdlog::formatter> formatter)
178-
{
179-
formatter_ = std::move(formatter);
180-
}
181-
182-
virtual ~CustomFormatter() = default;
183-
184-
void format(const spdlog::details::log_msg &msg, spdlog::memory_buf_t &dest) override
185-
{
186-
if (msg.logger_name == "raw") {
187-
dest.append(msg.payload.data(), msg.payload.data() + msg.payload.size());
188-
} else {
189-
formatter_->format(msg, dest);
190-
}
191-
}
192-
193-
std::unique_ptr<formatter> clone() const override
194-
{
195-
return spdlog::details::make_unique<CustomFormatter>(formatter_->clone());
196-
}
197-
198-
private:
199-
std::unique_ptr<spdlog::formatter> formatter_;
200-
};
201173

202174
// quick check if the file is a new or old log format
203175
// check that the first 3 lines start and end with symbols { and }

client/common/utils/network_utils/network_utils_mac.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
QStringList list = res.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts);
249249
QStringList ret;
250250
for (const auto &s : list)
251-
if (s.startsWith("p2p") || s.startsWith("awdl"))
251+
if (s.startsWith("p2p") || s.startsWith("awdl") || s.startsWith("llw"))
252252
ret << s;
253253
return ret;
254254
}

client/common/version/windscribe_version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
#define WINDSCRIBE_MAJOR_VERSION 2
44
#define WINDSCRIBE_MINOR_VERSION 16
5-
#define WINDSCRIBE_BUILD_VERSION 6
5+
#define WINDSCRIBE_BUILD_VERSION 7
66

77
// only one of these should be enabled; neither -> stable
8-
//#define WINDSCRIBE_IS_BETA
9-
#define WINDSCRIBE_IS_GUINEA_PIG
8+
#define WINDSCRIBE_IS_BETA
9+
//#define WINDSCRIBE_IS_GUINEA_PIG
1010

1111
#define STR_HELPER(x) #x
1212
#define STR(x) STR_HELPER(x)

client/gui/images.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
<file>svg/flags/ie.svg</file>
116116
<file>svg/flags/il.svg</file>
117117
<file>svg/flags/in.svg</file>
118+
<file>svg/flags/ir.svg</file>
118119
<file>svg/flags/is.svg</file>
119120
<file>svg/flags/it.svg</file>
120121
<file>svg/flags/jp.svg</file>
@@ -206,6 +207,7 @@
206207
<file>svg/flags/ie_circle.svg</file>
207208
<file>svg/flags/il_circle.svg</file>
208209
<file>svg/flags/in_circle.svg</file>
210+
<file>svg/flags/ir_circle.svg</file>
209211
<file>svg/flags/is_circle.svg</file>
210212
<file>svg/flags/it_circle.svg</file>
211213
<file>svg/flags/jp_circle.svg</file>

client/gui/mainwindow.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,19 @@ MainWindow::MainWindow() :
147147
qCDebug(LOG_BASIC) << "GUI pid: " << guiPid;
148148
backend_ = new Backend(this);
149149

150+
// On MacOS the tray icon geometry can be invalid for the first few milliseconds (on my Mac about 160 ms)
151+
// Give the icon a chance to initialize completely within a maximum of 2 seconds for the docked mode
152+
#if defined(Q_OS_MACOS)
153+
if (backend_->getPreferences()->isDockedToTray()) {
154+
QElapsedTimer t;
155+
t.start();
156+
while (!isTrayIconRectValid() && t.elapsed() < 2000) {
157+
qApp->processEvents();
158+
QThread::msleep(10);
159+
}
160+
}
161+
#endif
162+
150163
#if defined(Q_OS_MACOS)
151164
permissionMonitor_ = new PermissionMonitor_mac(this);
152165
connect(permissionMonitor_, &PermissionMonitor_mac::locationPermissionUpdated, this, &MainWindow::onLocationPermissionUpdated);
@@ -3918,6 +3931,24 @@ void MainWindow::updateTrayTooltip(QString tooltip)
39183931
#endif
39193932
}
39203933

3934+
bool MainWindow::isTrayIconRectValid()
3935+
{
3936+
if (!trayIcon_.isVisible())
3937+
return false;
3938+
3939+
const QRect rc = trayIcon_.geometry();
3940+
if (!rc.isValid())
3941+
return false;
3942+
3943+
// check for valid screen because on macOS trayIcon_.geometry() can be valid but contain invalid coordinates
3944+
QScreen *screen = QGuiApplication::screenAt(rc.center());
3945+
if (!screen) {
3946+
return false;
3947+
}
3948+
3949+
return true;
3950+
}
3951+
39213952
void MainWindow::onWireGuardAtKeyLimit()
39223953
{
39233954
GeneralMessageController::instance().showMessage(

client/gui/mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ private slots:
347347
void updateAppIconType(AppIconType type);
348348
void updateTrayIconType(AppIconType type);
349349
void updateTrayTooltip(QString tooltip);
350+
bool isTrayIconRectValid();
350351
AppIconType currentAppIconType_;
351352
QSystemTrayIcon trayIcon_;
352353
QRect savedTrayIconRect_;

client/gui/preferenceswindow/lookandfeelwindow/lookandfeelwindowitem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ LookAndFeelWindowItem::LookAndFeelWindowItem(ScalableGraphicsObject *parent, Pre
5757

5858

5959
// Populate combo boxes and other text
60+
connect(&LanguageController::instance(), &LanguageController::languageChanged, this, &LookAndFeelWindowItem::onLanguageChanged);
6061
onLanguageChanged();
6162
}
6263

client/gui/sounds/soundmanager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ SoundManager::SoundManager(QObject *parent, Preferences *preferences)
88
#ifdef Q_OS_MACOS
99
// the default of "ffmpeg" does not seem to play anything, use native backend
1010
setenv("QT_MEDIA_BACKEND", "darwin", 1);
11+
#elif defined(Q_OS_WIN)
12+
_putenv_s("QT_DISABLE_AUDIO_PREPARE", "1");
1113
#endif
1214
connect(preferences_, &Preferences::soundSettingsChanged, this, &SoundManager::onSoundSettingsChanged);
1315

0 commit comments

Comments
 (0)