Compare commits

...

8 Commits

Author SHA1 Message Date
John Preston
97d8ee75d5 Version 2.6.1.
- Fix time formatting in links.
- Fix copy QR code in night mode.
- Fix invite link sharing without a comment.
- Fix crash in link editing on Linux.
2021-02-24 21:41:37 +04:00
Ilya Fedin
f9bba75395 Use custom method to focus main window on X11 2021-02-24 21:41:14 +04:00
Ilya Fedin
9b88f816d6 Use new Platform::IsX11 2021-02-24 21:41:14 +04:00
John Preston
28c918a36a Update submodules. 2021-02-24 21:40:40 +04:00
John Preston
b638650b41 Fix invite link sharing without a comment. 2021-02-24 19:17:48 +04:00
John Preston
2d8e6f9745 Fix crash in EditLinkBox destruction.
Fixes #10432.
2021-02-24 19:07:49 +04:00
John Preston
627426f604 Fix copy QR code in night mode. 2021-02-24 15:10:19 +04:00
John Preston
7b80514986 Fix time formatting in links. 2021-02-24 15:10:06 +04:00
14 changed files with 48 additions and 31 deletions

View File

@@ -9,7 +9,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="2.6.0.0" />
Version="2.6.1.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,6,0,0
PRODUCTVERSION 2,6,0,0
FILEVERSION 2,6,1,0
PRODUCTVERSION 2,6,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "2.6.0.0"
VALUE "FileVersion", "2.6.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "2.6.0.0"
VALUE "ProductVersion", "2.6.1.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,6,0,0
PRODUCTVERSION 2,6,0,0
FILEVERSION 2,6,1,0
PRODUCTVERSION 2,6,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "2.6.0.0"
VALUE "FileVersion", "2.6.1.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2021"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "2.6.0.0"
VALUE "ProductVersion", "2.6.1.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -118,7 +118,7 @@ private:
return updated.link.isEmpty() || (!revoked && updated.revoked);
}
QImage QrExact(const Qr::Data &data, int pixel) {
QImage QrExact(const Qr::Data &data, int pixel, QColor color) {
const auto image = [](int size) {
auto result = QImage(
size,
@@ -141,7 +141,7 @@ QImage QrExact(const Qr::Data &data, int pixel) {
return result;
};
return Qr::ReplaceCenter(
Qr::Generate(data, pixel, st::windowFg->c),
Qr::Generate(data, pixel, color),
image(Qr::ReplaceSize(data, pixel)));
}
@@ -151,7 +151,7 @@ QImage Qr(const Qr::Data &data, int pixel, int max = 0) {
if (max > 0 && data.size * pixel > max) {
pixel = std::max(max / data.size, 1);
}
return QrExact(data, pixel * style::DevicePixelRatio());
return QrExact(data, pixel * style::DevicePixelRatio(), st::windowFg->c);
}
QImage Qr(const QString &text, int pixel, int max) {
@@ -161,7 +161,7 @@ QImage Qr(const QString &text, int pixel, int max) {
QImage QrForShare(const QString &text) {
const auto data = Qr::Encode(text);
const auto size = (kShareQrSize - 2 * kShareQrPadding);
const auto image = QrExact(data, size / data.size);
const auto image = QrExact(data, size / data.size, Qt::black);
auto result = QImage(
kShareQrPadding * 2 + image.width(),
kShareQrPadding * 2 + image.height(),
@@ -881,6 +881,8 @@ void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
for (auto &tag : comment.tags) {
tag.offset += add;
}
} else {
comment.text = link;
}
const auto owner = &peer->owner();
auto &api = peer->session().api();

View File

@@ -166,7 +166,7 @@ private:
link.usageLimit)
: tr::lng_group_invite_no_joined(tr::now);
const auto add = [&](const QString &text) {
result += QString::fromUtf8(" \xE2\xB8\xB1 ") + text;
result += QString::fromUtf8(" \xE2\x80\xA2 ") + text;
};
if (revoked) {
return result;
@@ -189,8 +189,7 @@ private:
left / 86400));
} else {
const auto time = base::unixtime::parse(link.expireDate).time();
add(time.toString(QLocale::system().dateTimeFormat(
QLocale::LongFormat)));
add(QLocale::system().toString(time, QLocale::LongFormat));
}
}
return result;

View File

@@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Telegram Desktop"_cs;
constexpr auto AppFile = "Telegram"_cs;
constexpr auto AppVersion = 2006000;
constexpr auto AppVersionStr = "2.6";
constexpr auto AppVersion = 2006001;
constexpr auto AppVersionStr = "2.6.1";
constexpr auto AppBetaVersion = false;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View File

@@ -139,7 +139,7 @@ bool XCBSkipTaskbar(QWindow *window, bool set) {
bool SkipTaskbar(QWindow *window, bool set) {
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
if (!IsWayland()) {
if (IsX11()) {
return XCBSkipTaskbar(window, set);
}
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION

View File

@@ -132,7 +132,7 @@ void PortalAutostart(bool start, bool silent = false) {
const auto parentWindowId = [&] {
if (const auto activeWindow = Core::App().activeWindow()) {
if (!IsWayland()) {
if (IsX11()) {
return qsl("x11:%1").arg(QString::number(
activeWindow->widget().get()->windowHandle()->winId(),
16));
@@ -579,7 +579,7 @@ bool TrayIconSupported() {
bool SkipTaskbarSupported() {
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
return !IsWayland()
return IsX11()
&& base::Platform::XCB::IsSupportedByWM("_NET_WM_STATE_SKIP_TASKBAR");
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION

View File

@@ -120,10 +120,10 @@ void EditInviteLinkBox(
int expireValue = 0;
int usageValue = 0;
};
const auto state = container->lifetime().make_state<State>(State{
const auto state = box->lifetime().make_state<State>(State{
.expireValue = expire,
.usageValue = usage
});
});
const auto regenerate = [=] {
expireGroup->setValue(state->expireValue);
usageGroup->setValue(state->usageValue);

View File

@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "platform/platform_specific.h"
#include "platform/platform_window_title.h"
#include "base/platform/base_platform_info.h"
#include "base/platform/base_platform_process.h"
#include "ui/platform/ui_platform_utility.h"
#include "history/history.h"
#include "window/themes/window_theme.h"
@@ -314,8 +315,16 @@ void MainWindow::activate() {
setWindowState(windowState() & ~Qt::WindowMinimized);
setVisible(true);
psActivateProcess();
raise();
activateWindow();
// allow to focus even if X11 native code is disabled
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
if (Platform::IsX11()) {
base::Platform::ActivateThisProcessWindow(winId());
} else
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
{
raise();
activateWindow();
}
controller().updateIsActiveFocus();
if (wasHidden) {
if (const auto session = sessionController()) {

View File

@@ -1,7 +1,7 @@
AppVersion 2006000
AppVersion 2006001
AppVersionStrMajor 2.6
AppVersionStrSmall 2.6
AppVersionStr 2.6.0
AppVersionStrSmall 2.6.1
AppVersionStr 2.6.1
BetaChannel 0
AlphaVersion 0
AppVersionOriginal 2.6
AppVersionOriginal 2.6.1

View File

@@ -1,3 +1,10 @@
2.6.1 (24.02.21)
- Fix time formatting in links.
- Fix copy QR code in night mode.
- Fix invite link sharing without a comment.
- Fix crash in link editing on Linux.
2.6 (23.02.21)
- Set messages to auto-delete for everyone 24 hours or 7 days after sending.