Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xdg-desktop-portal-hyprland for openSUSE:Factory checked in at 2023-10-17 20:25:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xdg-desktop-portal-hyprland (Old) and /work/SRC/openSUSE:Factory/.xdg-desktop-portal-hyprland.new.20540 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xdg-desktop-portal-hyprland" Tue Oct 17 20:25:30 2023 rev:7 rq:1118309 version:unknown Changes: -------- --- /work/SRC/openSUSE:Factory/xdg-desktop-portal-hyprland/xdg-desktop-portal-hyprland.changes 2023-09-26 22:15:48.067044881 +0200 +++ /work/SRC/openSUSE:Factory/.xdg-desktop-portal-hyprland.new.20540/xdg-desktop-portal-hyprland.changes 2023-10-17 20:25:50.201042874 +0200 @@ -1,0 +2,14 @@ +Sun Oct 15 12:44:00 UTC 2023 - Nicolas Lorin <androw95...@gmail.com> + +- Update to version 1.2.2: + * Unbreak build on FreeBSD + * Fix build when using clang + * specify flag for manual installation + * fixes the picker starting at windows and not monitors + * performance improvements + * fix for high CPU usage after exit + * hotfix to 1.2.0 to fix crashes after a few seconds + * fix some issues with screensharing on non-linear dmabuf GPUs + * fix xdph not exiting on terminate + +------------------------------------------------------------------- Old: ---- xdg-desktop-portal-hyprland-1.1.0.tar.gz New: ---- xdg-desktop-portal-hyprland-1.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xdg-desktop-portal-hyprland.spec ++++++ --- /var/tmp/diff_new_pack.96qbPp/_old 2023-10-17 20:25:51.205078023 +0200 +++ /var/tmp/diff_new_pack.96qbPp/_new 2023-10-17 20:25:51.205078023 +0200 @@ -18,7 +18,7 @@ %define _protocol_version 0.2 Name: xdg-desktop-portal-hyprland -Version: 1.1.0 +Version: 1.2.2 Release: 0 Summary: Extended xdg-desktop-portal backend for Hyprland License: MIT ++++++ xdg-desktop-portal-hyprland-1.1.0.tar.gz -> xdg-desktop-portal-hyprland-1.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/CMakeLists.txt new/xdg-desktop-portal-hyprland-1.2.2/CMakeLists.txt --- old/xdg-desktop-portal-hyprland-1.1.0/CMakeLists.txt 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/CMakeLists.txt 2023-10-10 21:52:22.000000000 +0200 @@ -31,12 +31,14 @@ add_subdirectory(subprojects/sdbus-cpp) add_subdirectory(hyprland-share-picker) +find_package(Threads REQUIRED) + find_package(PkgConfig REQUIRED) pkg_check_modules(deps REQUIRED IMPORTED_TARGET wayland-client wayland-protocols libpipewire-0.3 libspa-0.2 libdrm gbm) file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp") add_executable(xdg-desktop-portal-hyprland ${SRCFILES}) -target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt sdbus-c++ PkgConfig::deps) +target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt sdbus-c++ Threads::Threads PkgConfig::deps) # protocols find_program(WaylandScanner NAMES wayland-scanner) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/Makefile new/xdg-desktop-portal-hyprland-1.2.2/Makefile --- old/xdg-desktop-portal-hyprland-1.1.0/Makefile 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/Makefile 2023-10-10 21:52:22.000000000 +0200 @@ -20,3 +20,4 @@ cp -f ./hyprland.portal ${SHARE}/xdg-desktop-portal/portals/ sed "s|@libexecdir@|${LIBEXEC}|g" ./org.freedesktop.impl.portal.desktop.hyprland.service.in > ${SHARE}/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland sed "s|@libexecdir@|${LIBEXEC}|g" ./contrib/systemd/xdg-desktop-portal-hyprland.service.in > ${LIBEXEC}/systemd/user/xdg-desktop-portal-hyprland.service + chmod 755 ${LIBEXEC}/xdg-desktop-portal-hyprland diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/README.md new/xdg-desktop-portal-hyprland-1.2.2/README.md --- old/xdg-desktop-portal-hyprland-1.1.0/README.md 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/README.md 2023-10-10 21:52:22.000000000 +0200 @@ -1,13 +1,11 @@ # xdg-desktop-portal-hyprland An [XDG Desktop Portal](https://github.com/flatpak/xdg-desktop-portal) backend for Hyprland. -## Building -```sh -make all -``` - ## Installing ```sh +git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland +cd xdg-desktop-portal-hyprland/ +make all sudo make install ``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/VERSION new/xdg-desktop-portal-hyprland-1.2.2/VERSION --- old/xdg-desktop-portal-hyprland-1.1.0/VERSION 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/VERSION 2023-10-10 21:52:22.000000000 +0200 @@ -1 +1 @@ -1.1.0 +1.2.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/hyprland-share-picker/mainpicker.ui new/xdg-desktop-portal-hyprland-1.2.2/hyprland-share-picker/mainpicker.ui --- old/xdg-desktop-portal-hyprland-1.1.0/hyprland-share-picker/mainpicker.ui 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/hyprland-share-picker/mainpicker.ui 2023-10-10 21:52:22.000000000 +0200 @@ -66,7 +66,7 @@ <enum>QTabWidget::North</enum> </property> <property name="currentIndex"> - <number>1</number> + <number>0</number> </property> <widget class="QWidget" name="screens"> <attribute name="title"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/meson.build new/xdg-desktop-portal-hyprland-1.2.2/meson.build --- old/xdg-desktop-portal-hyprland-1.1.0/meson.build 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/meson.build 2023-10-10 21:52:22.000000000 +0200 @@ -25,10 +25,11 @@ add_project_arguments(cpp_compiler.get_supported_arguments([ '-Wno-missing-field-initializers', '-Wno-narrowing', - '-Wno-pointer-arith', + '-Wno-pointer-arith', '-Wno-unused-parameter', '-Wno-unused-value', - '-fpermissive' + '-fpermissive', + '-Wno-address-of-temporary' ]), language: 'cpp') conf_data = configuration_data() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/src/core/PortalManager.cpp new/xdg-desktop-portal-hyprland-1.2.2/src/core/PortalManager.cpp --- old/xdg-desktop-portal-hyprland-1.1.0/src/core/PortalManager.cpp 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/src/core/PortalManager.cpp 2023-10-10 21:52:22.000000000 +0200 @@ -11,6 +11,7 @@ #include <sys/poll.h> #include <sys/mman.h> #include <fcntl.h> +#include <unistd.h> #include <thread> @@ -169,7 +170,8 @@ uint32_t n_modifiers = g_pPortalManager->m_sWaylandConnection.dma.formatTableSize / sizeof(struct fm_entry); fm_entry* fm_entry = (struct fm_entry*)g_pPortalManager->m_sWaylandConnection.dma.formatTable; uint16_t* idx; - wl_array_for_each(idx, indices) { + + for (idx = (uint16_t*)indices->data; (const char*)idx < (const char*)indices->data + indices->size; idx++) { if (*idx >= n_modifiers) continue; @@ -241,6 +243,8 @@ } void CPortalManager::init() { + m_iPID = getpid(); + try { m_pConnection = sdbus::createDefaultBusConnection("org.freedesktop.impl.portal.desktop.hyprland"); } catch (std::exception& e) { @@ -312,20 +316,23 @@ std::thread pollThr([this, &pollfds]() { while (1) { - int ret = poll(pollfds, 3, -1); + int ret = poll(pollfds, 3, 5 /* 5 seconds, reasonable. It's because we might need to terminate */); if (ret < 0) { Debug::log(CRIT, "[core] Polling fds failed with {}", strerror(errno)); - exit(1); + g_pPortalManager->terminate(); } for (size_t i = 0; i < 3; ++i) { if (pollfds[0].revents & POLLHUP) { Debug::log(CRIT, "[core] Disconnected from pollfd id {}", i); - exit(1); + g_pPortalManager->terminate(); } } - { + if (m_bTerminate) + break; + + if (ret != 0) { Debug::log(TRACE, "[core] got poll event"); std::lock_guard<std::mutex> lg(m_sEventLoopInternals.loopRequestMutex); m_sEventLoopInternals.shouldProcess = true; @@ -351,6 +358,9 @@ m_sTimersThread.loopSignal.wait_for(lk, std::chrono::milliseconds((int)nearest), [this] { return m_sTimersThread.shouldProcess; }); m_sTimersThread.shouldProcess = false; + if (m_bTerminate) + break; + // awakened. Check if any timers passed m_mEventLock.lock(); bool notify = false; @@ -381,6 +391,9 @@ m_sEventLoopInternals.loopRequestMutex.lock(); // lock incoming events + if (m_bTerminate) + break; + m_sEventLoopInternals.shouldProcess = false; m_mEventLock.lock(); @@ -430,7 +443,17 @@ m_mEventLock.unlock(); } + Debug::log(ERR, "[core] Terminated"); + + m_sPortals.globalShortcuts.reset(); + m_sPortals.screencopy.reset(); + + m_pConnection.reset(); + pw_loop_destroy(m_sPipewire.loop); + wl_display_disconnect(m_sWaylandConnection.display); + m_sTimersThread.thread.release(); + pollThr.join(); // wait for poll to exit } sdbus::IConnection* CPortalManager::getConnection() { @@ -493,3 +516,20 @@ m_sTimersThread.shouldProcess = true; m_sTimersThread.loopSignal.notify_all(); } + +void CPortalManager::terminate() { + m_bTerminate = true; + + // if we don't exit in 5s, we'll kill by force. Nuclear option. PIDs are not reused in linux until a wrap-around, + // and I doubt anyone will make 4.2M PIDs within 5s. + if (fork() == 0) + execl("/bin/sh", "/bin/sh", "-c", std::format("sleep 5 && kill -9 {}", m_iPID).c_str(), nullptr); + + { + m_sEventLoopInternals.shouldProcess = true; + m_sEventLoopInternals.loopSignal.notify_all(); + } + + m_sTimersThread.shouldProcess = true; + m_sTimersThread.loopSignal.notify_all(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/src/core/PortalManager.hpp new/xdg-desktop-portal-hyprland-1.2.2/src/core/PortalManager.hpp --- old/xdg-desktop-portal-hyprland-1.1.0/src/core/PortalManager.hpp 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/src/core/PortalManager.hpp 2023-10-10 21:52:22.000000000 +0200 @@ -71,8 +71,14 @@ gbm_device* createGBMDevice(drmDevice* dev); + // terminate after the event loop has been created. Before we can exit() + void terminate(); + private: - void startEventLoop(); + void startEventLoop(); + + bool m_bTerminate = false; + pid_t m_iPID = 0; struct { std::condition_variable loopSignal; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/src/helpers/MiscFunctions.cpp new/xdg-desktop-portal-hyprland-1.2.2/src/helpers/MiscFunctions.cpp --- old/xdg-desktop-portal-hyprland-1.1.0/src/helpers/MiscFunctions.cpp 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/src/helpers/MiscFunctions.cpp 2023-10-10 21:52:22.000000000 +0200 @@ -1,5 +1,6 @@ #include "MiscFunctions.hpp" #include <memory> +#include <unistd.h> #include "../helpers/Log.hpp" std::string execAndGet(const char* cmd) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/src/meson.build new/xdg-desktop-portal-hyprland-1.2.2/src/meson.build --- old/xdg-desktop-portal-hyprland-1.1.0/src/meson.build 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/src/meson.build 2023-10-10 21:52:22.000000000 +0200 @@ -8,6 +8,7 @@ dependency('libdrm'), dependency('libpipewire-0.3'), dependency('sdbus-c++'), + dependency('threads'), dependency('wayland-client'), ], include_directories: inc, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/src/portals/Screencopy.cpp new/xdg-desktop-portal-hyprland-1.2.2/src/portals/Screencopy.cpp --- old/xdg-desktop-portal-hyprland-1.1.0/src/portals/Screencopy.cpp 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/src/portals/Screencopy.cpp 2023-10-10 21:52:22.000000000 +0200 @@ -102,6 +102,7 @@ Debug::log(TRACE, "[sc] pw format {} size {}x{}", (int)PSTREAM->pwVideoInfo.format, PSTREAM->pwVideoInfo.size.width, PSTREAM->pwVideoInfo.size.height); Debug::log(TRACE, "[sc] wlr format {} size {}x{}", (int)PSESSION->sharingData.frameInfoSHM.fmt, PSESSION->sharingData.frameInfoSHM.w, PSESSION->sharingData.frameInfoSHM.h); + Debug::log(TRACE, "[sc] wlr format dma {} size {}x{}", (int)PSESSION->sharingData.frameInfoDMA.fmt, PSESSION->sharingData.frameInfoDMA.w, PSESSION->sharingData.frameInfoDMA.h); const auto FMT = PSTREAM->isDMA ? PSESSION->sharingData.frameInfoDMA.fmt : PSESSION->sharingData.frameInfoSHM.fmt; if ((PSTREAM->pwVideoInfo.format != pwFromDrmFourcc(FMT) && PSTREAM->pwVideoInfo.format != pwStripAlpha(pwFromDrmFourcc(FMT))) || @@ -781,7 +782,7 @@ const spa_pod* pod_modifier = &prop_modifier->value; uint32_t n_modifiers = SPA_POD_CHOICE_N_VALUES(pod_modifier) - 1; - uint64_t* modifiers = SPA_POD_CHOICE_VALUES(pod_modifier); + uint64_t* modifiers = (uint64_t*)SPA_POD_CHOICE_VALUES(pod_modifier); modifiers++; uint32_t flags = GBM_BO_USE_RENDERING; uint64_t modifier; @@ -853,14 +854,15 @@ params[0] = build_buffer(&dynBuilder[0].b, blocks, PSTREAM->pSession->sharingData.frameInfoSHM.size, PSTREAM->pSession->sharingData.frameInfoSHM.stride, data_type); - params[1] = spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, - SPA_POD_Int(sizeof(struct spa_meta_header))); + params[1] = (const spa_pod*)spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), + SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header))); - params[2] = spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform), - SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_videotransform))); + params[2] = (const spa_pod*)spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform), + SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_videotransform))); - params[3] = spa_pod_builder_add_object(&dynBuilder[2].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size, - SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 4, sizeof(struct spa_meta_region) * 1, sizeof(struct spa_meta_region) * 4)); + params[3] = (const spa_pod*)spa_pod_builder_add_object( + &dynBuilder[2].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size, + SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 4, sizeof(struct spa_meta_region) * 1, sizeof(struct spa_meta_region) * 4)); pw_stream_update_params(PSTREAM->stream, params, 4); spa_pod_dynamic_builder_clean(&dynBuilder[0]); @@ -965,7 +967,8 @@ if (!PSTREAM->stream) { Debug::log(ERR, "[pipewire] refused to create stream"); - exit(1); + g_pPortalManager->terminate(); + return; } spa_pod_builder* builder[2] = {&dynBuilder[0].b, &dynBuilder[1].b}; @@ -1019,15 +1022,16 @@ return true; } - for (size_t i = 0; i < g_pPortalManager->m_vDMABUFMods.size(); ++i) { + size_t i = 0; + for (const auto& mod : g_pPortalManager->m_vDMABUFMods) { if (i >= num_modifiers) break; - const auto& mod = g_pPortalManager->m_vDMABUFMods[i]; - if (mod.fourcc == drm_format && - (mod.mod == DRM_FORMAT_MOD_INVALID || gbm_device_get_format_modifier_plane_count(g_pPortalManager->m_sWaylandConnection.gbmDevice, mod.fourcc, mod.mod) > 0)) + (mod.mod == DRM_FORMAT_MOD_INVALID || gbm_device_get_format_modifier_plane_count(g_pPortalManager->m_sWaylandConnection.gbmDevice, mod.fourcc, mod.mod) > 0)) { modifiers[i] = mod.mod; + ++i; + } } *max_modifiers = num_modifiers; @@ -1074,6 +1078,9 @@ stream->pSession->sharingData.frameInfoSHM.h, stream->pSession->sharingData.framerate, NULL, 0); } + if (modifiers) + free(modifiers); + return paramCount; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.1.0/src/shared/ScreencopyShared.cpp new/xdg-desktop-portal-hyprland-1.2.2/src/shared/ScreencopyShared.cpp --- old/xdg-desktop-portal-hyprland-1.1.0/src/shared/ScreencopyShared.cpp 2023-09-18 19:10:57.000000000 +0200 +++ new/xdg-desktop-portal-hyprland-1.2.2/src/shared/ScreencopyShared.cpp 2023-10-10 21:52:22.000000000 +0200 @@ -132,7 +132,7 @@ case DRM_FORMAT_ABGR2101010: case DRM_FORMAT_RGBA1010102: case DRM_FORMAT_BGRA1010102: return (wl_shm_format)format; - default: Debug::log(ERR, "[screencopy] Unknown format {}", format); exit(1); + default: Debug::log(ERR, "[screencopy] Unknown format {}", format); abort(); } } @@ -155,7 +155,7 @@ case WL_SHM_FORMAT_ABGR2101010: case WL_SHM_FORMAT_RGBA1010102: case WL_SHM_FORMAT_BGRA1010102: return (uint32_t)format; - default: Debug::log(ERR, "[screencopy] Unknown format {}", (int)format); exit(1); + default: Debug::log(ERR, "[screencopy] Unknown format {}", (int)format); abort(); } } @@ -178,7 +178,7 @@ case DRM_FORMAT_ABGR2101010: return SPA_VIDEO_FORMAT_ABGR_210LE; case DRM_FORMAT_RGBA1010102: return SPA_VIDEO_FORMAT_RGBA_102LE; case DRM_FORMAT_BGRA1010102: return SPA_VIDEO_FORMAT_BGRA_102LE; - default: Debug::log(ERR, "[screencopy] Unknown format {}", (int)format); exit(1); + default: Debug::log(ERR, "[screencopy] Unknown format {}", (int)format); abort(); } }