Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package hyprgraphics for openSUSE:Factory checked in at 2026-11-30 14:26:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hyprgraphics (Old) and /work/SRC/openSUSE:Factory/.hyprgraphics.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hyprgraphics" Mon Nov 30 14:26:54 2026 rev:8 rq:1401438 version:0.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/hyprgraphics/hyprgraphics.changes 2026-11-04 19:44:51.594904464 +0100 +++ /work/SRC/openSUSE:Factory/.hyprgraphics.new.1340718/hyprgraphics.changes 2026-11-30 14:29:23.911513760 +0100 @@ -1,0 +2,9 @@ +Sat Nov 28 17:29:24 UTC 2026 - Nassim Lhadj <[email protected]> + +- Update to version 0.7.0: + * ABI breaking update + * resources/text: fix rendering hints from font family + being overwritten + * resource/gatherer: fix lost wakeups + +------------------------------------------------------------------- Old: ---- hyprgraphics-0.6.0.tar.xz New: ---- hyprgraphics-0.7.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hyprgraphics.spec ++++++ --- /var/tmp/diff_new_pack.yo7aKj/_old 2026-11-30 14:29:25.186567577 +0100 +++ /var/tmp/diff_new_pack.yo7aKj/_new 2026-11-30 14:29:25.190567746 +0100 @@ -17,10 +17,10 @@ # -%define sover 5 +%define sover 6 Name: hyprgraphics -Version: 0.6.0 +Version: 0.7.0 Release: 0 Summary: Hyprland graphics / resource utilities License: BSD-3-Clause ++++++ hyprgraphics-0.6.0.tar.xz -> hyprgraphics-0.7.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/CMakeLists.txt new/hyprgraphics-0.7.0/CMakeLists.txt --- old/hyprgraphics-0.6.0/CMakeLists.txt 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/CMakeLists.txt 2026-11-25 14:16:56.000000000 +0100 @@ -110,7 +110,7 @@ PUBLIC "./include" PRIVATE "./src") set_target_properties(hyprgraphics PROPERTIES VERSION ${HYPRGRAPHICS_VERSION} - SOVERSION 5) + SOVERSION 6) target_link_libraries(hyprgraphics PkgConfig::deps) if(JXL_FOUND) target_link_libraries(hyprgraphics PkgConfig::JXL) @@ -137,6 +137,14 @@ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests COMMAND hyprgraphics_arg "image") add_dependencies(tests hyprgraphics_arg) +add_executable(hyprgraphics_text "tests/text.cpp") +target_link_libraries(hyprgraphics_text PRIVATE hyprgraphics PkgConfig::deps) +add_test(NAME Text COMMAND hyprgraphics_text) +add_dependencies(tests hyprgraphics_text) +add_executable(hyprgraphics_gatherer "tests/gatherer.cpp") +target_link_libraries(hyprgraphics_gatherer PRIVATE hyprgraphics PkgConfig::deps) +add_test(NAME Gatherer COMMAND hyprgraphics_gatherer) +add_dependencies(tests hyprgraphics_gatherer) # Installation install(TARGETS hyprgraphics) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/VERSION new/hyprgraphics-0.7.0/VERSION --- old/hyprgraphics-0.6.0/VERSION 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/VERSION 2026-11-25 14:16:56.000000000 +0100 @@ -1 +1 @@ -0.6.0 +0.7.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/flake.lock new/hyprgraphics-0.7.0/flake.lock --- old/hyprgraphics-0.6.0/flake.lock 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/flake.lock 2026-11-25 14:16:56.000000000 +0100 @@ -10,11 +10,11 @@ ] }, "locked": { - "lastModified": 1786464080, - "narHash": "sha256-W1hxvumEM57yV+QwsZ4QdAHEqOkr7e4S8VAkLX60qDE=", + "lastModified": 1794325570, + "narHash": "sha256-SsmVt5k/q11HLEcgPyEW8pnny0CeBQMoOwuMoPMezYA=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "c157fe1e3092b980cc69315a6631f89aff09dcce", + "rev": "ab978a33215426ae97ff4a9d7313ca01d0abba46", "type": "github" }, "original": { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/include/hyprgraphics/resource/resources/TextResource.hpp new/hyprgraphics-0.7.0/include/hyprgraphics/resource/resources/TextResource.hpp --- old/hyprgraphics-0.6.0/include/hyprgraphics/resource/resources/TextResource.hpp 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/include/hyprgraphics/resource/resources/TextResource.hpp 2026-11-25 14:16:56.000000000 +0100 @@ -29,8 +29,9 @@ cairo_hint_style_t hintStyle = CAIRO_HINT_STYLE_SLIGHT; bool ellipsize = false; bool wrap = true; - int weight = 400; - bool italic = false; + // Negative values preserve the corresponding attribute from the font description. + int weight = -1; + int italic = -1; }; CTextResource(STextResourceData&& data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/nix/default.nix new/hyprgraphics-0.7.0/nix/default.nix --- old/hyprgraphics-0.6.0/nix/default.nix 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/nix/default.nix 2026-11-25 14:16:56.000000000 +0100 @@ -5,6 +5,7 @@ cmake, pkg-config, cairo, + dejavu_fonts, file, hyprutils, libGL, @@ -15,8 +16,8 @@ librsvg, libspng, libwebp, + makeFontsConf, pango, - pixman, version ? "git", doCheck ? false, debug ? false, @@ -55,23 +56,26 @@ propagatedBuildInputs = [ cairo - pango - libdrm + hyprutils libGL + pango ]; buildInputs = [ file + libdrm libheif libjpeg libjxl librsvg libspng libwebp - hyprutils - pixman ]; + env = lib.optionalAttrs doCheck { + FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ dejavu_fonts ]; }; + }; + outputs = [ "out" "dev" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/src/resource/AsyncResourceGatherer.cpp new/hyprgraphics-0.7.0/src/resource/AsyncResourceGatherer.cpp --- old/hyprgraphics-0.6.0/src/resource/AsyncResourceGatherer.cpp 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/src/resource/AsyncResourceGatherer.cpp 2026-11-25 14:16:56.000000000 +0100 @@ -16,7 +16,12 @@ } void CAsyncResourceGatherer::wakeUpMainThread() { - m_asyncLoopState.needsToProcess = true; + // set under the lock the gatherer checks it with, or it can go to sleep right after missing it + { + std::lock_guard<std::mutex> lg(m_asyncLoopState.requestMutex); + m_asyncLoopState.needsToProcess = true; + } + m_asyncLoopState.requestsCV.notify_all(); } @@ -30,10 +35,8 @@ } void CAsyncResourceGatherer::await(Hyprutils::Memory::CAtomicSharedPointer<IAsyncResource> resource) { - resource->m_impl->awaitingCv = Hyprutils::Memory::makeUnique<std::condition_variable>(); std::unique_lock<std::mutex> lk(resource->m_impl->awaitingMtx); - resource->m_impl->awaitingCv->wait(lk, [&resource] { return resource->m_impl->awaitingEvent; }); - resource->m_impl->awaitingCv.reset(); + resource->m_impl->awaitingCv.wait(lk, [&resource] { return resource->m_impl->awaitingEvent; }); } void CAsyncResourceGatherer::asyncAssetSpinLock() { @@ -64,10 +67,13 @@ for (auto& r : requests) { r->render(); - if (r->m_impl->awaitingCv) { + // the resource may finish before anyone awaits it, the flag keeps that from being lost + { + std::lock_guard<std::mutex> lg(r->m_impl->awaitingMtx); r->m_impl->awaitingEvent = true; - r->m_impl->awaitingCv->notify_all(); } + + r->m_impl->awaitingCv.notify_all(); r->m_ready = true; r->m_events.finished.emit(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/src/resource/resources/AsyncResource.hpp new/hyprgraphics-0.7.0/src/resource/resources/AsyncResource.hpp --- old/hyprgraphics-0.6.0/src/resource/resources/AsyncResource.hpp 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/src/resource/resources/AsyncResource.hpp 2026-11-25 14:16:56.000000000 +0100 @@ -1,11 +1,13 @@ #include <hyprgraphics/resource/resources/AsyncResource.hpp> #include <condition_variable> +#include <mutex> namespace Hyprgraphics { struct SAsyncResourceImpl { - Hyprutils::Memory::CUniquePointer<std::condition_variable> awaitingCv; - std::mutex awaitingMtx; - bool awaitingEvent = false; + // awaitingEvent is only touched under awaitingMtx, so await() can't miss it + std::condition_variable awaitingCv; + std::mutex awaitingMtx; + bool awaitingEvent = false; }; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/src/resource/resources/TextResource.cpp new/hyprgraphics-0.7.0/src/resource/resources/TextResource.cpp --- old/hyprgraphics-0.6.0/src/resource/resources/TextResource.cpp 2026-11-01 19:13:52.000000000 +0100 +++ new/hyprgraphics-0.7.0/src/resource/resources/TextResource.cpp 2026-11-25 14:16:56.000000000 +0100 @@ -20,8 +20,10 @@ PangoFontDescription* fontDesc = pango_font_description_from_string(m_data.font.c_str()); pango_font_description_set_size(fontDesc, m_data.fontSize * PANGO_SCALE); - pango_font_description_set_weight(fontDesc, static_cast<PangoWeight>(m_data.weight)); - pango_font_description_set_style(fontDesc, m_data.italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL); + if (m_data.weight >= 0) + pango_font_description_set_weight(fontDesc, static_cast<PangoWeight>(m_data.weight)); + if (m_data.italic >= 0) + pango_font_description_set_style(fontDesc, m_data.italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL); pango_layout_set_font_description(layout, fontDesc); pango_font_description_free(fontDesc); @@ -108,4 +110,4 @@ m_asset.pixelSize = {logical.width, logical.height}; cairo_destroy(CAIRO); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/tests/gatherer.cpp new/hyprgraphics-0.7.0/tests/gatherer.cpp --- old/hyprgraphics-0.6.0/tests/gatherer.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/hyprgraphics-0.7.0/tests/gatherer.cpp 2026-11-25 14:16:56.000000000 +0100 @@ -0,0 +1,56 @@ +#include <hyprgraphics/resource/AsyncResourceGatherer.hpp> +#include <hyprgraphics/resource/resources/AsyncResource.hpp> +#include <hyprutils/memory/Atomic.hpp> + +#include <algorithm> +#include <chrono> +#include <cstdlib> +#include <future> + +#include "shared.hpp" + +using namespace Hyprgraphics; +using namespace Hyprutils::Memory; + +// renders instantly, so the gatherer often finishes before await() starts waiting +class CInstantResource : public IAsyncResource { + public: + virtual void render() { + ; + } +}; + +int main() { + int ret = 0; + + CAsyncResourceGatherer gatherer; + + // the slowest await, a missed wakeup only recovers through the gatherer's 5s poll + auto awaited = std::async(std::launch::async, [&gatherer] { + std::chrono::steady_clock::duration slowest{}; + for (size_t i = 0; i < 20000; ++i) { + const auto INSTANT = makeAtomicShared<CInstantResource>(); + CAtomicSharedPointer<IAsyncResource> resource(INSTANT); + + const auto START = std::chrono::steady_clock::now(); + gatherer.enqueue(resource); + gatherer.await(resource); + slowest = std::max(slowest, std::chrono::steady_clock::now() - START); + } + + return slowest; + }); + + const bool FINISHED = awaited.wait_for(std::chrono::seconds(30)) == std::future_status::ready; + EXPECT(FINISHED, true); + + // a lost wakeup leaves await() blocked forever, that thread can't be joined + if (!FINISHED) { + std::cout << std::flush; + std::_Exit(1); + } + + EXPECT(awaited.get() < std::chrono::seconds(1), true); + + return ret; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hyprgraphics-0.6.0/tests/text.cpp new/hyprgraphics-0.7.0/tests/text.cpp --- old/hyprgraphics-0.6.0/tests/text.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/hyprgraphics-0.7.0/tests/text.cpp 2026-11-25 14:16:56.000000000 +0100 @@ -0,0 +1,62 @@ +#include <cstring> +#include <utility> +#include <hyprgraphics/resource/resources/TextResource.hpp> +#include "shared.hpp" + +using namespace Hyprgraphics; + +static bool sameRendering(CTextResource::STextResourceData first, CTextResource::STextResourceData second) { + CTextResource firstResource(std::move(first)); + CTextResource secondResource(std::move(second)); + firstResource.render(); + secondResource.render(); + + const auto FIRST = firstResource.m_asset.cairoSurface; + const auto SECOND = secondResource.m_asset.cairoSurface; + + if (FIRST->status() != CAIRO_STATUS_SUCCESS || SECOND->status() != CAIRO_STATUS_SUCCESS || FIRST->size().x <= 0 || FIRST->size().y <= 0 || SECOND->size().x <= 0 || + SECOND->size().y <= 0) { + std::cerr << "Failed to render text for comparison\n"; + return false; + } + + if (FIRST->size() != SECOND->size() || FIRST->stride() != SECOND->stride()) + return false; + + return std::memcmp(FIRST->data(), SECOND->data(), FIRST->stride() * static_cast<size_t>(FIRST->size().y)) == 0; +} + +int main() { + int ret = 0; + + const CTextResource::STextResourceData PLAIN{.font = "Sans"}; + const CTextResource::STextResourceData BOLD{.text = "<b>Sample Text</b>", .font = "Sans"}; + const CTextResource::STextResourceData ITALIC{.text = "<i>Sample Text</i>", .font = "Sans"}; + const CTextResource::STextResourceData BOLD_ITALIC{.text = "<b><i>Sample Text</i></b>", .font = "Sans"}; + const CTextResource::STextResourceData SEMIBOLD{.text = "<span weight=\"semibold\">Sample Text</span>", .font = "Sans"}; + const CTextResource::STextResourceData OBLIQUE{.text = "<span style=\"oblique\">Sample Text</span>", .font = "Sans"}; + + // Ensure missing fonts or identical fallback glyphs cannot hide the regression. + EXPECT(sameRendering(PLAIN, BOLD), false); + EXPECT(sameRendering(PLAIN, ITALIC), false); + EXPECT(sameRendering(PLAIN, OBLIQUE), false); + + EXPECT(sameRendering({.font = "Sans Bold"}, BOLD), true); + EXPECT(sameRendering({.font = "Sans Italic"}, ITALIC), true); + EXPECT(sameRendering({.font = "Sans Bold Italic"}, BOLD_ITALIC), true); + EXPECT(sameRendering({.font = "Sans SemiBold"}, SEMIBOLD), true); + EXPECT(sameRendering({.font = "Sans Oblique"}, OBLIQUE), true); + + EXPECT(sameRendering({.font = "Sans", .weight = 400, .italic = false}, PLAIN), true); + EXPECT(sameRendering({.font = "Sans", .weight = 700, .italic = true}, BOLD_ITALIC), true); + EXPECT(sameRendering({.font = "Sans Bold Italic", .weight = 400}, ITALIC), true); + EXPECT(sameRendering({.font = "Sans Bold Italic", .italic = false}, BOLD), true); + EXPECT(sameRendering({.font = "Sans Bold Italic", .weight = 400, .italic = false}, PLAIN), true); + EXPECT(sameRendering({.font = "Sans SemiBold", .weight = 700}, BOLD), true); + EXPECT(sameRendering({.font = "Sans Bold", .italic = true}, BOLD_ITALIC), true); + EXPECT(sameRendering({.font = "Sans Oblique", .weight = 400}, OBLIQUE), true); + EXPECT(sameRendering({.font = "Sans Oblique", .italic = false}, PLAIN), true); + EXPECT(sameRendering({.font = "Sans Oblique", .italic = true}, ITALIC), true); + + return ret; +}
