Klemens, Andrew, I'd like to update tdesktop to 7.1.3 and drop my scroll patches.
fido's patches came from Nazarenko Mykyta's 64gram port. Why? Upstream suggested to try the latest version of tdesktop to check does scroll work better. It more or less works on my case and I can't say that my patches makes it better, but here no more custom hacky patches. If anyone wouldlike to try it, the prebuild amd64 packages is here: https://kirill.korins.ky/pub/packages/tdesktop-7.1.3.tgz Thoutgs? Ok? Index: Makefile =================================================================== RCS file: /home/cvs/ports/net/tdesktop/Makefile,v diff -u -p -r1.227 Makefile --- Makefile 14 Aug 2026 15:37:42 -0000 1.227 +++ Makefile 29 Aug 2026 09:11:46 -0000 @@ -5,8 +5,7 @@ NOT_FOR_ARCHS = ${BE_ARCHS} i386 COMMENT = Telegram Desktop messenger PORTROACH = limit:-full$$ -V = 7.0.6 -REVISION = 1 +V = 7.1.3 DISTNAME = tdesktop-${V}-full PKGNAME = ${DISTNAME:-full=} CATEGORIES = net @@ -35,9 +34,9 @@ WANTLIB += ${COMPILER_LIBCXX} KF6CoreAdd WANTLIB += Qt6OpenGL Qt6OpenGLWidgets Qt6Qml Qt6Quick Qt6QuickWidgets WANTLIB += Qt6Svg Qt6WaylandCompositor Qt6Widgets absl_strings WANTLIB += ada avcodec avfilter avformat avutil c crypto dispatch -WANTLIB += gio-2.0 glib-2.0 gobject-2.0 hunspell-1.7 jpeg lz4 -WANTLIB += m minizip openal protobuf-lite qrcodegencpp rnnoise -WANTLIB += swresample swscale tg_owt xxhash z +WANTLIB += fido2 gio-2.0 glib-2.0 gobject-2.0 hunspell-1.7 jpeg +WANTLIB += lz4 m minizip openal qrcodegencpp rnnoise swresample +WANTLIB += swscale tg_owt xxhash z # dlopen()ed WANTLIB += webkitgtk-6.0 xcb xcb-keysyms xcb-record xcb-screensaver Index: distinfo =================================================================== RCS file: /home/cvs/ports/net/tdesktop/distinfo,v diff -u -p -r1.168 distinfo --- distinfo 1 Aug 2026 02:00:56 -0000 1.168 +++ distinfo 29 Aug 2026 00:48:08 -0000 @@ -1,2 +1,2 @@ -SHA256 (tdesktop-7.0.6-full.tar.gz) = DOvqr7jG/gIfmWMEl5xKxzHUfSIX43sbjwUC+Y/tvSM= -SIZE (tdesktop-7.0.6-full.tar.gz) = 80240282 +SHA256 (tdesktop-7.1.3-full.tar.gz) = kvrMDdhHNiEBkN3QS7W6k8w2r4eNCPVaZScrkBQB8v4= +SIZE (tdesktop-7.1.3-full.tar.gz) = 81493031 Index: patches/patch-Telegram_SourceFiles_platform_linux_specific_linux_cpp =================================================================== RCS file: /home/cvs/ports/net/tdesktop/patches/patch-Telegram_SourceFiles_platform_linux_specific_linux_cpp,v diff -u -p -r1.12 patch-Telegram_SourceFiles_platform_linux_specific_linux_cpp --- patches/patch-Telegram_SourceFiles_platform_linux_specific_linux_cpp 14 Aug 2026 13:20:06 -0000 1.12 +++ patches/patch-Telegram_SourceFiles_platform_linux_specific_linux_cpp 29 Aug 2026 00:47:53 -0000 @@ -1,8 +1,5 @@ /usr/ports/pobj/tdesktop-6.2.5/tdesktop-6.2.5-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp:71:7: error: reference to 'GObject' is ambiguous -plus fix scroll on X11 -https://github.com/desktop-app/lib_ui/pull/339 - Index: Telegram/SourceFiles/platform/linux/specific_linux.cpp --- Telegram/SourceFiles/platform/linux/specific_linux.cpp.orig +++ Telegram/SourceFiles/platform/linux/specific_linux.cpp Index: patches/patch-Telegram_SourceFiles_webauthn_webauthn_common_cpp =================================================================== RCS file: patches/patch-Telegram_SourceFiles_webauthn_webauthn_common_cpp diff -N patches/patch-Telegram_SourceFiles_webauthn_webauthn_common_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-Telegram_SourceFiles_webauthn_webauthn_common_cpp 29 Aug 2026 09:08:34 -0000 @@ -0,0 +1,18 @@ +Replace `raw_ptr` and `raw_len` with `_ptr` and `_len` to ensure +compatibility with lib_fido2. Otherwise, the 64gram will fail to +compile. + +Index: Telegram/SourceFiles/webauthn/webauthn_common.cpp +--- Telegram/SourceFiles/webauthn/webauthn_common.cpp.orig ++++ Telegram/SourceFiles/webauthn/webauthn_common.cpp +@@ -353,8 +353,8 @@ void CloseBox(const std::shared_ptr<State> &state) { + fido_assert_id_len(assert, 0)); + out.authenticatorData = QByteArray( + reinterpret_cast<const char*>( +- fido_assert_authdata_raw_ptr(assert, 0)), +- fido_assert_authdata_raw_len(assert, 0)); ++ fido_assert_authdata_ptr(assert, 0)), ++ fido_assert_authdata_len(assert, 0)); + out.signature = QByteArray( + reinterpret_cast<const char*>(fido_assert_sig_ptr(assert, 0)), + fido_assert_sig_len(assert, 0)); Index: patches/patch-Telegram_cmake_lib_fido2_cmake =================================================================== RCS file: patches/patch-Telegram_cmake_lib_fido2_cmake diff -N patches/patch-Telegram_cmake_lib_fido2_cmake --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-Telegram_cmake_lib_fido2_cmake 29 Aug 2026 00:55:28 -0000 @@ -0,0 +1,19 @@ +Fix libfido2 detection on OpenBSD + +Index: Telegram/cmake/lib_fido2.cmake +--- Telegram/cmake/lib_fido2.cmake.orig ++++ Telegram/cmake/lib_fido2.cmake +@@ -9,6 +9,13 @@ + # On Windows it serves only systems without webauthn.dll (Win7/8/8.1, + # Win10 < 1903); winhello.c is left out. + ++if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") ++ add_library(lib_fido2 INTERFACE) ++ add_library(tdesktop::lib_fido2 ALIAS lib_fido2) ++ target_link_libraries(lib_fido2 INTERFACE fido2) ++ return() ++endif() ++ + if (DESKTOP_APP_USE_PACKAGED) + find_package(PkgConfig) + if (PkgConfig_FOUND) Index: patches/patch-Telegram_lib_ui_ui_ui_utility_cpp =================================================================== RCS file: patches/patch-Telegram_lib_ui_ui_ui_utility_cpp diff -N patches/patch-Telegram_lib_ui_ui_ui_utility_cpp --- patches/patch-Telegram_lib_ui_ui_ui_utility_cpp 14 Aug 2026 13:20:06 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,57 +0,0 @@ -fix scroll on X11 -https://github.com/desktop-app/lib_ui/pull/339 - -Index: Telegram/lib_ui/ui/ui_utility.cpp ---- Telegram/lib_ui/ui/ui_utility.cpp.orig -+++ Telegram/lib_ui/ui/ui_utility.cpp -@@ -7,6 +7,7 @@ - #include "ui/ui_utility.h" - - #include "base/platform/base_platform_info.h" -+#include "base/qt/qt_common_adapters.h" - #include "ui/integration.h" - #include "ui/style/style_core.h" - -@@ -22,6 +23,7 @@ namespace { - - constexpr auto kDefaultWheelScrollLines = 3; - constexpr auto kMagicScrollMultiplier = 2.5; -+constexpr auto kX11SmoothScrollMultiplier = 5.; - - class WidgetCreator : public QWidget { - public: -@@ -272,13 +274,31 @@ QPointF ScrollDeltaF(not_null<QWheelEvent*> e, bool to - style::ConvertScaleExact(point.x()), - style::ConvertScaleExact(point.y())); - }; -- if (!e->pixelDelta().isNull()) { -- return convert(e->pixelDelta()) -+ const auto pixelDelta = e->pixelDelta(); -+ auto x11Touchpad = false; -+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -+ x11Touchpad = e->device() -+ && e->device()->type() == base::TouchDevice::TouchPad; -+#endif // Qt >= 6.0.0 -+ const auto x11Smooth = !touch -+ && ::Platform::IsX11() -+ && (!pixelDelta.isNull() || x11Touchpad); -+ const auto angleDelta = e->angleDelta(); -+ if (x11Smooth && !angleDelta.isNull()) { -+ return (convert(angleDelta) -+ * QApplication::wheelScrollLines() -+ * kX11SmoothScrollMultiplier) -+ / float64(QWheelEvent::DefaultDeltasPerStep); -+ } -+ if (!pixelDelta.isNull()) { -+ return (::Platform::IsX11() && !touch -+ ? QPointF(pixelDelta) -+ : convert(pixelDelta)) - * ((::Platform::IsWayland() && !touch) - ? kMagicScrollMultiplier - : 1.); - } -- return (convert(e->angleDelta()) * QApplication::wheelScrollLines()) -+ return (convert(angleDelta) * QApplication::wheelScrollLines()) - / float64(kPixelToAngleDelta * kDefaultWheelScrollLines); - } - Index: patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_cpp =================================================================== RCS file: patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_cpp diff -N patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_cpp --- patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_cpp 14 Aug 2026 13:20:06 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,62 +0,0 @@ -fix scroll on X11 -https://github.com/desktop-app/lib_ui/pull/339 - -Index: Telegram/lib_ui/ui/widgets/elastic_scroll.cpp ---- Telegram/lib_ui/ui/widgets/elastic_scroll.cpp.orig -+++ Telegram/lib_ui/ui/widgets/elastic_scroll.cpp -@@ -867,7 +867,7 @@ bool ElasticScroll::eventHook(QEvent *e) { - switch (e->type()) { - case QEvent::ScrollPrepare: { - QScrollPrepareEvent *se = static_cast<QScrollPrepareEvent *>(e); -- se->setViewportSize(QSizeF(viewport()->size())); -+ se->setViewportSize(QSizeF(size())); - se->setContentPosRange(QRectF( - 0, - 0, -@@ -1029,21 +1029,29 @@ bool ElasticScroll::handleWheelEvent(not_null<QWheelEv - const auto guard = gsl::finally([&] { - _lastScroll = now; - }); -- auto unmultiplied = ScrollDelta(e, touch); -+ if (phase == Qt::ScrollBegin) { -+ _wheelDeltaRemainder = {}; -+ } -+ auto exactPixels = ScrollDeltaF(e, touch); - if (ownAxisLocked) { - if (_vertical) { -- unmultiplied.setX(0); -+ exactPixels.setX(0.); -+ _wheelDeltaRemainder.setX(0.); - } else { -- unmultiplied.setY(0); -+ exactPixels.setY(0.); -+ _wheelDeltaRemainder.setY(0.); - } - } - const auto multiply = e->modifiers() - & (Qt::ControlModifier | Qt::ShiftModifier); -- const auto pixels = multiply -- ? QPoint( -- (unmultiplied.x() * std::max(width(), 120) / 120.), -- (unmultiplied.y() * std::max(height(), 120) / 120.)) -- : unmultiplied; -+ if (multiply) { -+ exactPixels = QPointF( -+ exactPixels.x() * std::max(width(), 120) / 120., -+ exactPixels.y() * std::max(height(), 120) / 120.); -+ } -+ exactPixels += _wheelDeltaRemainder; -+ const auto pixels = exactPixels.toPoint(); -+ _wheelDeltaRemainder = exactPixels - QPointF(pixels); - auto ignore = false; - auto delta = _vertical ? -pixels.y() : -pixels.x(); - if (!ownAxisLocked -@@ -1092,7 +1100,7 @@ bool ElasticScroll::handleWheelEvent(not_null<QWheelEv - case Qt::ScrollBegin: - case Qt::ScrollUpdate: { - if (phase == Qt::ScrollBegin -- && !pixels.isNull() -+ && !exactPixels.isNull() - && _scroller->state() == QScroller::Scrolling) { - // On macOS, when Qt loses the race detecting that a - // momentum phase follows the finger lift, the OS momentum Index: patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_h =================================================================== RCS file: patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_h diff -N patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_h --- patches/patch-Telegram_lib_ui_ui_widgets_elastic_scroll_h 14 Aug 2026 13:20:06 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -fix scroll on X11 -https://github.com/desktop-app/lib_ui/pull/339 - -Index: Telegram/lib_ui/ui/widgets/elastic_scroll.h ---- Telegram/lib_ui/ui/widgets/elastic_scroll.h.orig -+++ Telegram/lib_ui/ui/widgets/elastic_scroll.h -@@ -334,6 +334,7 @@ class ElasticScroll : public RpWidget { (private) - - QPointer<QScroller> _scroller; - QPoint _wheelPos; -+ QPointF _wheelDeltaRemainder; - - base::Timer _touchTimer; - base::Timer _touchScrollTimer; Index: patches/patch-Telegram_lib_webview_webview_platform_linux_webview_linux_webkitgtk_library_cpp =================================================================== RCS file: /home/cvs/ports/net/tdesktop/patches/patch-Telegram_lib_webview_webview_platform_linux_webview_linux_webkitgtk_library_cpp,v diff -u -p -r1.5 patch-Telegram_lib_webview_webview_platform_linux_webview_linux_webkitgtk_library_cpp --- patches/patch-Telegram_lib_webview_webview_platform_linux_webview_linux_webkitgtk_library_cpp 31 Jul 2026 11:50:44 -0000 1.5 +++ patches/patch-Telegram_lib_webview_webview_platform_linux_webview_linux_webkitgtk_library_cpp 29 Aug 2026 00:48:27 -0000 @@ -5,7 +5,7 @@ Index: Telegram/lib_webview/webview/plat +++ Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk_library.cpp @@ -14,10 +14,10 @@ ResolveResult Resolve(Platform platform, WindowMode mo const auto gtkPlug = (platform == Platform::X11) - && (mode != WindowMode::External); + && (mode == WindowMode::Embedded); const auto lib = (!gtkPlug - ? base::Platform::LoadLibrary("libwebkitgtk-6.0.so.4", RTLD_NODELETE) + ? base::Platform::LoadLibrary("libwebkitgtk-6.0.so", RTLD_NODELETE) -- wbr, Kirill
