diff --git a/com.github.ahrm.sioyek.metainfo.xml b/com.github.ahrm.sioyek.metainfo.xml index a5a508e..32588bc 100644 --- a/com.github.ahrm.sioyek.metainfo.xml +++ b/com.github.ahrm.sioyek.metainfo.xml @@ -44,6 +44,12 @@ nbenitezl_AT_gmail.com + + + Flathub Beta release from Sioyek github code at 29-03-2024. + + https://github.com/ahrm/sioyek/commit/35a550e8e8a6d179ed877ca6b0207da009620fb6 + diff --git a/com.github.ahrm.sioyek.yaml b/com.github.ahrm.sioyek.yaml index 8a7a62f..a21ea70 100644 --- a/com.github.ahrm.sioyek.yaml +++ b/com.github.ahrm.sioyek.yaml @@ -46,7 +46,8 @@ modules: sources: - type: git url: https://github.com/ahrm/sioyek.git - tag: 'v2.0.0' + # latest master HEAD at 29/03/2024 + commit: 35a550e8e8a6d179ed877ca6b0207da009620fb6 - type: patch path: patch/sioyek_build_fix.patch - type: file @@ -55,4 +56,5 @@ modules: path: com.github.ahrm.sioyek.desktop cleanup: - - /share/man \ No newline at end of file + - /share/man + - /include # Reduces app size considerably (thx Aman9das) \ No newline at end of file diff --git a/patch/qtwayland-decoration-support-backports-from-qt6.patch b/patch/qtwayland-decoration-support-backports-from-qt6.patch new file mode 100644 index 0000000..56e2ea6 --- /dev/null +++ b/patch/qtwayland-decoration-support-backports-from-qt6.patch @@ -0,0 +1,228 @@ +diff --git a/src/client/qwaylandabstractdecoration_p.h b/src/client/qwaylandabstractdecoration_p.h +index 81c8e17..61cbde7 100644 +--- a/src/client/qwaylandabstractdecoration_p.h ++++ b/src/client/qwaylandabstractdecoration_p.h +@@ -82,6 +82,12 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandAbstractDecoration : public QObject + Q_OBJECT + Q_DECLARE_PRIVATE(QWaylandAbstractDecoration) + public: ++ enum MarginsType { ++ Full, ++ ShadowsExcluded, ++ ShadowsOnly ++ }; ++ + QWaylandAbstractDecoration(); + ~QWaylandAbstractDecoration() override; + +@@ -91,7 +97,8 @@ public: + void update(); + bool isDirty() const; + +- virtual QMargins margins() const = 0; ++ virtual QMargins margins(MarginsType marginsType = Full) const = 0; ++ + QWindow *window() const; + const QImage &contentImage(); + +diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp +index ec232cd..54b27f1 100644 +--- a/src/client/qwaylandwindow.cpp ++++ b/src/client/qwaylandwindow.cpp +@@ -383,6 +383,16 @@ void QWaylandWindow::setGeometry(const QRect &r) + void QWaylandWindow::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) + { + QMargins margins = frameMargins(); ++ ++ // Exclude shadows from margins once they are excluded from window geometry ++ // 1) First resizeFromApplyConfigure() call will have sizeWithMargins equal to surfaceSize() ++ // which has full margins (shadows included). ++ // 2) Following resizeFromApplyConfigure() calls should have sizeWithMargins equal to ++ // windowContentGeometry() which excludes shadows, therefore in this case we have to ++ // exclude them too in order not to accidentally apply smaller size to the window. ++ if (mWindowDecoration && (sizeWithMargins != surfaceSize())) ++ margins = mWindowDecoration->margins(QWaylandAbstractDecoration::ShadowsExcluded); ++ + int widthWithoutMargins = qMax(sizeWithMargins.width() - (margins.left() + margins.right()), 1); + int heightWithoutMargins = qMax(sizeWithMargins.height() - (margins.top() + margins.bottom()), 1); + QRect geometry(windowGeometry().topLeft(), QSize(widthWithoutMargins, heightWithoutMargins)); +@@ -710,7 +720,12 @@ QSize QWaylandWindow::surfaceSize() const + */ + QRect QWaylandWindow::windowContentGeometry() const + { +- return QRect(QPoint(), surfaceSize()); ++ QMargins shadowMargins; ++ ++ if (mWindowDecoration) ++ shadowMargins = mWindowDecoration->margins(QWaylandAbstractDecoration::ShadowsOnly); ++ ++ return QRect(QPoint(shadowMargins.left(), shadowMargins.top()), surfaceSize().shrunkBy(shadowMargins)); + } + + /*! +@@ -1111,6 +1126,16 @@ Qt::WindowStates QWaylandWindow::windowStates() const + return mLastReportedWindowStates; + } + ++QWaylandWindow::ToplevelWindowTilingStates QWaylandWindow::toplevelWindowTilingStates() const ++{ ++ return mLastReportedToplevelWindowTilingStates; ++} ++ ++void QWaylandWindow::handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates states) ++{ ++ mLastReportedToplevelWindowTilingStates = states; ++} ++ + void QWaylandWindow::handleWindowStatesChanged(Qt::WindowStates states) + { + createDecoration(); +diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h +index 1907f10..33a3b83 100644 +--- a/src/client/qwaylandwindow_p.h ++++ b/src/client/qwaylandwindow_p.h +@@ -95,6 +95,15 @@ public: + Vulkan + }; + ++ enum ToplevelWindowTilingState { ++ WindowNoState = 0, ++ WindowTiledLeft = 1, ++ WindowTiledRight = 2, ++ WindowTiledTop = 4, ++ WindowTiledBottom = 8 ++ }; ++ Q_DECLARE_FLAGS(ToplevelWindowTilingStates, ToplevelWindowTilingState) ++ + QWaylandWindow(QWindow *window, QWaylandDisplay *display); + ~QWaylandWindow() override; + +@@ -148,6 +157,9 @@ public: + void handleContentOrientationChange(Qt::ScreenOrientation orientation) override; + void setOrientationMask(Qt::ScreenOrientations mask); + ++ ToplevelWindowTilingStates toplevelWindowTilingStates() const; ++ void handleToplevelWindowTilingStatesChanged(ToplevelWindowTilingStates states); ++ + void setWindowState(Qt::WindowStates states) override; + void setWindowFlags(Qt::WindowFlags flags) override; + void handleWindowStatesChanged(Qt::WindowStates states); +@@ -260,6 +272,7 @@ protected: + QRegion mMask; + QRegion mOpaqueArea; + Qt::WindowStates mLastReportedWindowStates = Qt::WindowNoState; ++ ToplevelWindowTilingStates mLastReportedToplevelWindowTilingStates = WindowNoState; + + QWaylandShmBackingStore *mBackingStore = nullptr; + QWaylandBuffer *mQueuedBuffer = nullptr; +@@ -296,6 +309,8 @@ private: + friend class QWaylandSubSurface; + }; + ++Q_DECLARE_OPERATORS_FOR_FLAGS(QWaylandWindow::ToplevelWindowTilingStates) ++ + inline QIcon QWaylandWindow::windowIcon() const + { + return mWindowIcon; +diff --git a/src/plugins/decorations/bradient/main.cpp b/src/plugins/decorations/bradient/main.cpp +index e75fda3..72dda67 100644 +--- a/src/plugins/decorations/bradient/main.cpp ++++ b/src/plugins/decorations/bradient/main.cpp +@@ -72,7 +72,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandBradientDecoration : public QWaylandAbstra + public: + QWaylandBradientDecoration(); + protected: +- QMargins margins() const override; ++ QMargins margins(MarginsType marginsType = Full) const override; + void paint(QPaintDevice *device) override; + bool handleMouse(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global,Qt::MouseButtons b,Qt::KeyboardModifiers mods) override; + bool handleTouch(QWaylandInputDevice *inputDevice, const QPointF &local, const QPointF &global, Qt::TouchPointState state, Qt::KeyboardModifiers mods) override; +@@ -129,8 +129,11 @@ QRectF QWaylandBradientDecoration::minimizeButtonRect() const + (margins().top() - BUTTON_WIDTH) / 2, BUTTON_WIDTH, BUTTON_WIDTH); + } + +-QMargins QWaylandBradientDecoration::margins() const ++QMargins QWaylandBradientDecoration::margins(MarginsType marginsType) const + { ++ if (marginsType == ShadowsOnly) ++ return QMargins(); ++ + return QMargins(3, 30, 3, 3); + } + +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +index 2666df2..8d8ac85 100644 +--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp ++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +@@ -88,6 +88,7 @@ void QWaylandXdgSurface::Toplevel::applyConfigure() + && !m_xdgSurface->m_window->display()->isKeyboardAvailable()) + m_xdgSurface->m_window->display()->handleWindowDeactivated(m_xdgSurface->m_window); + ++ m_xdgSurface->m_window->handleToplevelWindowTilingStatesChanged(m_toplevelStates); + m_xdgSurface->m_window->handleWindowStatesChanged(m_pending.states); + + if (m_pending.size.isEmpty()) { +@@ -120,6 +121,7 @@ void QWaylandXdgSurface::Toplevel::xdg_toplevel_configure(int32_t width, int32_t + size_t numStates = states->size / sizeof(uint32_t); + + m_pending.states = Qt::WindowNoState; ++ m_toplevelStates = QWaylandWindow::WindowNoState; + + for (size_t i = 0; i < numStates; i++) { + switch (xdgStates[i]) { +@@ -132,6 +134,18 @@ void QWaylandXdgSurface::Toplevel::xdg_toplevel_configure(int32_t width, int32_t + case XDG_TOPLEVEL_STATE_FULLSCREEN: + m_pending.states |= Qt::WindowFullScreen; + break; ++ case XDG_TOPLEVEL_STATE_TILED_LEFT: ++ m_toplevelStates |= QWaylandWindow::WindowTiledLeft; ++ break; ++ case XDG_TOPLEVEL_STATE_TILED_RIGHT: ++ m_toplevelStates |= QWaylandWindow::WindowTiledRight; ++ break; ++ case XDG_TOPLEVEL_STATE_TILED_TOP: ++ m_toplevelStates |= QWaylandWindow::WindowTiledTop; ++ break; ++ case XDG_TOPLEVEL_STATE_TILED_BOTTOM: ++ m_toplevelStates |= QWaylandWindow::WindowTiledBottom; ++ break; + default: + break; + } +@@ -458,7 +472,7 @@ void QWaylandXdgSurface::xdg_surface_configure(uint32_t serial) + } + + QWaylandXdgShell::QWaylandXdgShell(QWaylandDisplay *display, uint32_t id, uint32_t availableVersion) +- : QtWayland::xdg_wm_base(display->wl_registry(), id, qMin(availableVersion, 1u)) ++ : QtWayland::xdg_wm_base(display->wl_registry(), id, qMin(availableVersion, 2u)) + , m_display(display) + { + display->addRegistryListener(&QWaylandXdgShell::handleRegistryGlobal, this); +diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +index 0c98be3..d791213 100644 +--- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h ++++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +@@ -58,6 +58,7 @@ + + #include + #include ++#include + + #include + #include +@@ -69,7 +70,6 @@ class QWindow; + namespace QtWaylandClient { + + class QWaylandDisplay; +-class QWaylandWindow; + class QWaylandInputDevice; + class QWaylandXdgShell; + +@@ -123,6 +123,7 @@ private: + QSize size = {0, 0}; + Qt::WindowStates states = Qt::WindowNoState; + } m_pending, m_applied; ++ QWaylandWindow::ToplevelWindowTilingStates m_toplevelStates = QWaylandWindow::WindowNoState; + QSize m_normalSize; + + QWaylandXdgSurface *m_xdgSurface = nullptr; diff --git a/patch/sioyek_build_fix.patch b/patch/sioyek_build_fix.patch index 594a7f0..7902c6f 100644 --- a/patch/sioyek_build_fix.patch +++ b/patch/sioyek_build_fix.patch @@ -1,20 +1,26 @@ --- a/pdf_viewer_build_config.pro 2022-02-18 07:47:57.000000000 -0400 +++ b/pdf_viewer_build_config.pro 2022-03-07 17:50:49.489579924 -0400 -@@ -5,9 +5,9 @@ +@@ -6,7 +6,7 @@ zlib - --QT += core opengl gui widgets network 3dinput openglextensions -+QT += core opengl gui widgets openglextensions network + +-QT += core opengl gui widgets network 3dinput ++QT += core opengl gui widgets network + + greaterThan(QT_MAJOR_VERSION, 5){ + QT += openglwidgets +@@ -17,7 +17,7 @@ + } + CONFIG += c++17 -DEFINES += QT_3DINPUT_LIB QT_OPENGL_LIB QT_OPENGLEXTENSIONS_LIB QT_WIDGETS_LIB -+DEFINES += QT_OPENGL_LIB QT_OPENGLEXTENSIONS_LIB QT_WIDGETS_LIB QT_NETWORK_LIB - - ++DEFINES += QT_OPENGL_LIB QT_OPENGLEXTENSIONS_LIB QT_WIDGETS_LIB + CONFIG(non_portable){ -@@ -72,7 +72,7 @@ + DEFINES += NON_PORTABLE +@@ -96,7 +96,7 @@ } - + isEmpty(PREFIX){ - PREFIX = /usr + PREFIX = /app @@ -57,9 +63,9 @@ --- a/pdf_viewer/main_widget.cpp 2022-02-18 07:47:57.000000000 -0400 +++ b/pdf_viewer/main_widget.cpp 2022-03-07 18:09:25.807652975 -0400 @@ -14,7 +14,7 @@ - #include - #include #include + #endif + -#include +#include #include diff --git a/qt5-15.yaml b/qt5-15.yaml index 8e40063..ee9b32d 100644 --- a/qt5-15.yaml +++ b/qt5-15.yaml @@ -5,9 +5,10 @@ cleanup: sources: - type: git url: https://invent.kde.org/qt/qt/qtwayland.git - #branch: kde/5.15 - # HEAD as of 06/07/2022 - commit: 64fa557eb30fc1219bec50a45107ea1a983411ed + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl + - type: patch + # https://src.fedoraproject.org/rpms/qt5-qtwayland/blob/rawhide/f/qtwayland-decoration-support-backports-from-qt6.patch + path: patch/qtwayland-decoration-support-backports-from-qt6.patch modules: - name: qt5-qtbase buildsystem: autotools @@ -58,6 +59,8 @@ modules: - -dbus-linked - -fontconfig - -glib + - -gui + - -widgets - -icu - -openssl-linked - -no-cups @@ -78,9 +81,7 @@ modules: sources: - type: git url: https://invent.kde.org/qt/qt/qtbase.git - #branch: kde/5.15 - # HEAD as of 06/07/2022 - commit: aa0c6db334cf6f0887f42cbd82e4af258126bdc5 + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl - type: patch path: patch/qtbase-avoid-hardcoding-kernel-version.patch - type: patch @@ -103,9 +104,7 @@ modules: sources: - type: git url: https://invent.kde.org/qt/qt/qt3d.git - #branch: kde/5.15 - # HEAD as of 06/07/2022 - commit: 3cc801c4ae41ff3f155258c4bf7e21bb5b3f6a3d + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl - name: qt5-qttools buildsystem: qmake cleanup: @@ -136,9 +135,7 @@ modules: sources: - type: git url: https://invent.kde.org/qt/qt/qttools.git - #branch: kde/5.15 - # HEAD as of 06/07/2022 - commit: 672ba9d902be3634a9fef80be65227aece9e0aed + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl - name: qtx11extras buildsystem: qmake cleanup: @@ -146,9 +143,7 @@ modules: sources: - type: git url: https://invent.kde.org/qt/qt/qtx11extras.git - #branch: kde/5.15 - # HEAD as of 14/03/2022 - commit: 0dfaf36ec6f642a0fd583ce1cc33a31eb6b3328e + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl - name: qtdeclarative buildsystem: qmake cleanup: @@ -156,9 +151,7 @@ modules: sources: - type: git url: https://invent.kde.org/qt/qt/qtdeclarative.git - #branch: kde/5.15 - # HEAD as of 06/07/2022 - commit: c47f3d7b227c9bc86ca1702ae3291a62c2116cfa + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl - name: qtquickcontrols buildsystem: qmake cleanup: @@ -166,6 +159,21 @@ modules: sources: - type: git url: https://invent.kde.org/qt/qt/qtquickcontrols.git - #branch: kde/5.15 - # HEAD as of 06/07/2022 - commit: 4fb4e5942bfa1f92f1c759f182aa504ad52e8e3b \ No newline at end of file + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl + - name: qtsvg + buildsystem: qmake + cleanup: + - /bin + sources: + - type: git + url: https://invent.kde.org/qt/qt/qtsvg.git + tag: v5.15.13-lts-lgpl #v5.15.5-lts-lgpl + - name: QAdwaitaDecorations + buildsystem: cmake + #config-opts: + # - -DCMAKE_INSTALL_PREFIX=/app/lib/plugins/QAdwaitaDecorations + # - -DQT_PLUGINS_DIR=/app/lib/plugins/QAdwaitaDecorations + sources: + - type: git + url: https://github.com/FedoraQt/QAdwaitaDecorations.git + tag: 0.1.5 \ No newline at end of file
Flathub Beta release from Sioyek github code at 29-03-2024.