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 2024-02-26 19:44:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xdg-desktop-portal-hyprland (Old)
and /work/SRC/openSUSE:Factory/.xdg-desktop-portal-hyprland.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xdg-desktop-portal-hyprland"
Mon Feb 26 19:44:25 2024 rev:10 rq:1150304 version:1.3.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/xdg-desktop-portal-hyprland/xdg-desktop-portal-hyprland.changes
2023-12-01 21:26:22.108082106 +0100
+++
/work/SRC/openSUSE:Factory/.xdg-desktop-portal-hyprland.new.1770/xdg-desktop-portal-hyprland.changes
2024-02-26 19:45:30.662169426 +0100
@@ -1,0 +2,28 @@
+Sun Feb 25 11:22:11 UTC 2024 - Soc Virnyl Estela
<[email protected]>
+
+- Cleanup specfile
+ * remove meson as build requirement.
+
+-------------------------------------------------------------------
+Sat Feb 24 09:42:58 UTC 2024 - Soc Virnyl Estela
<[email protected]>
+
+- Add fix-systemd-service-file-install-path.patch
+
+-------------------------------------------------------------------
+Sat Feb 24 08:59:07 UTC 2024 - Soc Virnyl Estela
<[email protected]>
+
+- Cleanup specfile
+ * we remove sources for hyprland-protocols and hyprlang. They are now
separate packages
+
+-------------------------------------------------------------------
+Fri Feb 23 23:28:31 UTC 2024 - Soc Virnyl Estela
<[email protected]>
+
+- Update to version 1.3.1:
+ * Add hyprlang as new subproject dependency
+ * Screencopy: Fixed restore tokens with multiple relaunches
+ * Screencopy: Fixed paused -> resume state handling
+- Update specfile:
+ * Meson and makefile has been obsoleted by CMake. Only
+ exception is for hyprland-protocols.
+
+-------------------------------------------------------------------
Old:
----
hyprland-protocols-0.2.tar.gz
xdg-desktop-portal-hyprland-1.2.5.tar.gz
New:
----
fix-systemd-service-file-install-path.patch
xdg-desktop-portal-hyprland-1.3.1.tar.gz
BETA DEBUG BEGIN:
New:
- Add fix-systemd-service-file-install-path.patch
BETA DEBUG END:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xdg-desktop-portal-hyprland.spec ++++++
--- /var/tmp/diff_new_pack.ID2kwy/_old 2024-02-26 19:45:31.290192129 +0100
+++ /var/tmp/diff_new_pack.ID2kwy/_new 2024-02-26 19:45:31.290192129 +0100
@@ -1,7 +1,7 @@
#
# spec file for package xdg-desktop-portal-hyprland
#
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,19 +16,18 @@
#
-%define _protocol_version 0.2
Name: xdg-desktop-portal-hyprland
-Version: 1.2.5
+Version: 1.3.1
Release: 0
Summary: Extended xdg-desktop-portal backend for Hyprland
License: MIT
Group: System/Libraries
URL: https://github.com/hyprwm/xdg-desktop-portal-hyprland
Source0:
https://github.com/hyprwm/xdg-desktop-portal-hyprland/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
-Source1:
https://github.com/hyprwm/hyprland-protocols/archive/refs/tags/v%{_protocol_version}.tar.gz#/hyprland-protocols-%{_protocol_version}.tar.gz
+Patch1: fix-systemd-service-file-install-path.patch
BuildRequires: cmake
BuildRequires: gcc-c++
-BuildRequires: meson
+BuildRequires: hyprland-protocols-devel
BuildRequires: pkgconfig
BuildRequires: qt6-base-devel
BuildRequires: qt6-wayland
@@ -37,6 +36,7 @@
BuildRequires: qt6-waylandclient-private-devel
BuildRequires: scdoc >= 1.9.7
BuildRequires: pkgconfig(gbm) >= 21.3
+BuildRequires: pkgconfig(hyprlang)
BuildRequires: pkgconfig(inih)
BuildRequires: pkgconfig(libdrm) >= 2.4.109
BuildRequires: pkgconfig(libjpeg)
@@ -56,47 +56,21 @@
# Required since the picker uses qt wayland.
# Not a strict requirement as the portal will fallback to slurp
Recommends: qt6-wayland
-
Requires: xdg-desktop-portal
%description
A fork of xdg-desktop-portal backend for wlroots for Hyprland. It supports
other wlroots-based Wayland compositors too with some limitations.
-%package -n hyprland-protocols-devel
-Summary: Development files for Hyprland protocols
-Group: Development/Libraries/Other
-Version: 0.2
-BuildArch: noarch
-Provides: hyprland-protocols-devel = %{_protocol_version}
-
-%description -n hyprland-protocols-devel
-Wayland protocol extensions for interacting or modifying Hyprland.
-
%prep
%autosetup -p1
-# Needed for this portal to work.
-tar xvf %{SOURCE1} -C subprojects/hyprland-protocols --strip-components=1
-
%build
-# We need to build hyprland protocols so it can be installed.
-pushd subprojects/hyprland-protocols
-%meson
-%meson_build
-popd
-
-%meson
-%meson_build
+%cmake
+%cmake_build
%install
-
-# Install the protocols
-pushd subprojects/hyprland-protocols
-%meson_install
-popd
-
-%meson_install
+%cmake_install
%pre
%systemd_user_pre %{name}.service
@@ -122,9 +96,3 @@
%{_datadir}/xdg-desktop-portal/portals/hyprland.portal
%{_userunitdir}/%{name}.service
-%files -n hyprland-protocols-devel
-%{_datadir}/pkgconfig/hyprland-protocols.pc
-%dir %{_datadir}/hyprland-protocols
-%dir %{_datadir}/hyprland-protocols/protocols
-%{_datadir}/hyprland-protocols/protocols/*
-
++++++ fix-systemd-service-file-install-path.patch ++++++
diff -ruN xdg-desktop-portal-hyprland-1.3.1.orig/CMakeLists.txt
xdg-desktop-portal-hyprland-1.3.1/CMakeLists.txt
--- xdg-desktop-portal-hyprland-1.3.1.orig/CMakeLists.txt 2024-02-24
17:39:34.004619666 +0800
+++ xdg-desktop-portal-hyprland-1.3.1/CMakeLists.txt 2024-02-24
17:41:22.511554969 +0800
@@ -104,4 +104,4 @@
install(FILES hyprland.portal DESTINATION
"${CMAKE_INSTALL_DATAROOTDIR}/xdg-desktop-portal/portals")
install(FILES
${CMAKE_BINARY_DIR}/org.freedesktop.impl.portal.desktop.hyprland.service
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
-install(FILES
${CMAKE_BINARY_DIR}/contrib/systemd/xdg-desktop-portal-hyprland.service
DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
+install(FILES
${CMAKE_BINARY_DIR}/contrib/systemd/xdg-desktop-portal-hyprland.service
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/systemd/user")
++++++ xdg-desktop-portal-hyprland-1.2.5.tar.gz ->
xdg-desktop-portal-hyprland-1.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/CMakeLists.txt
new/xdg-desktop-portal-hyprland-1.3.1/CMakeLists.txt
--- old/xdg-desktop-portal-hyprland-1.2.5/CMakeLists.txt 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/CMakeLists.txt 2024-01-05
15:58:42.000000000 +0100
@@ -21,24 +21,46 @@
include_directories(
.
"protocols/"
- "subprojects/sdbus-cpp/include/"
)
+# configure
+include(GNUInstallDirs)
+set(LIBEXECDIR ${CMAKE_INSTALL_FULL_LIBEXECDIR})
+configure_file(org.freedesktop.impl.portal.desktop.hyprland.service.in
org.freedesktop.impl.portal.desktop.hyprland.service @ONLY)
+configure_file(contrib/systemd/xdg-desktop-portal-hyprland.service.in
contrib/systemd/xdg-desktop-portal-hyprland.service @ONLY)
+
set(CMAKE_CXX_STANDARD 23)
-add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
-Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith -fpermissive)
+add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
+ -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith
+ -fpermissive -Wno-address-of-temporary)
+# dependencies
message(STATUS "Checking deps...")
-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)
+pkg_check_modules(deps REQUIRED IMPORTED_TARGET wayland-client
wayland-protocols libpipewire-0.3 libspa-0.2 libdrm gbm hyprlang>=0.2.0)
+
+# check whether we can find sdbus-c++ through pkg-config
+pkg_check_modules(SDBUS IMPORTED_TARGET sdbus-c++)
+if(NOT SDBUS_FOUND)
+ include_directories("subprojects/sdbus-cpp/include/")
+ add_subdirectory(subprojects/sdbus-cpp)
+ add_library(PkgConfig::SDBUS ALIAS sdbus-c++)
+endif()
+
+# same for hyprland-protocols
+pkg_check_modules(HYPRLAND_PROTOS IMPORTED_TARGET hyprland-protocols)
+if(HYPRLAND_PROTOS_FOUND)
+ set(HYPRLAND_PROTOCOLS
"${HYPRLAND_PROTOS_PREFIX}/share/hyprland-protocols")
+else()
+ set(HYPRLAND_PROTOCOLS "subprojects/hyprland-protocols")
+endif()
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++
Threads::Threads PkgConfig::deps)
+target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt PkgConfig::SDBUS
Threads::Threads PkgConfig::deps)
# protocols
find_program(WaylandScanner NAMES wayland-scanner)
@@ -57,7 +79,7 @@
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
execute_process(
COMMAND ${WaylandScanner} private-code ${protoPath}
protocols/${protoName}-protocol.c
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(xdg-desktop-portal-hyprland PRIVATE
protocols/${protoName}-protocol.c)
else()
execute_process(
@@ -65,14 +87,21 @@
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
execute_process(
COMMAND ${WaylandScanner} private-code
${WAYLAND_PROTOCOLS_DIR}/${protoPath} protocols/${protoName}-protocol.c
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(xdg-desktop-portal-hyprland PRIVATE
protocols/${protoName}-protocol.c)
endif()
endfunction()
protocol("protocols/wlr-foreign-toplevel-management-unstable-v1.xml"
"wlr-foreign-toplevel-management-unstable-v1" true)
protocol("protocols/wlr-screencopy-unstable-v1.xml"
"wlr-screencopy-unstable-v1" true)
-protocol("subprojects/hyprland-protocols/protocols/hyprland-global-shortcuts-v1.xml"
"hyprland-global-shortcuts-v1" true)
-protocol("subprojects/hyprland-protocols/protocols/hyprland-toplevel-export-v1.xml"
"hyprland-toplevel-export-v1" true)
+protocol("${HYPRLAND_PROTOCOLS}/protocols/hyprland-global-shortcuts-v1.xml"
"hyprland-global-shortcuts-v1" true)
+protocol("${HYPRLAND_PROTOCOLS}/protocols/hyprland-toplevel-export-v1.xml"
"hyprland-toplevel-export-v1" true)
protocol("unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml"
"linux-dmabuf-unstable-v1" false)
-##
+
+# Installation
+install(TARGETS hyprland-share-picker)
+install(TARGETS xdg-desktop-portal-hyprland DESTINATION
${CMAKE_INSTALL_LIBEXECDIR})
+
+install(FILES hyprland.portal DESTINATION
"${CMAKE_INSTALL_DATAROOTDIR}/xdg-desktop-portal/portals")
+install(FILES
${CMAKE_BINARY_DIR}/org.freedesktop.impl.portal.desktop.hyprland.service
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
+install(FILES
${CMAKE_BINARY_DIR}/contrib/systemd/xdg-desktop-portal-hyprland.service
DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/Makefile
new/xdg-desktop-portal-hyprland-1.3.1/Makefile
--- old/xdg-desktop-portal-hyprland-1.2.5/Makefile 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/Makefile 1970-01-01
01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-PREFIX = /usr/local
-LIBEXEC = /usr/lib
-SHARE = /usr/share
-
-all:
- $(MAKE) release
-
-release:
- cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -H./
-B./build -G Ninja
- cmake --build ./build --config Release --target all -j$(nproc)
-
-debug:
- cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -H./
-B./build -G Ninja
- cmake --build ./build --config Debug --target all -j$(nproc)
-
-install:
- $(MAKE) release
- cp -f ./build/hyprland-share-picker/hyprland-share-picker ${PREFIX}/bin
- cp -f ./build/xdg-desktop-portal-hyprland ${LIBEXEC}/
- 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.2.5/README.md
new/xdg-desktop-portal-hyprland-1.3.1/README.md
--- old/xdg-desktop-portal-hyprland-1.2.5/README.md 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/README.md 2024-01-05
15:58:42.000000000 +0100
@@ -1,14 +1,34 @@
# xdg-desktop-portal-hyprland
-An [XDG Desktop Portal](https://github.com/flatpak/xdg-desktop-portal) backend
for Hyprland.
+
+An [XDG Desktop Portal](https://github.com/flatpak/xdg-desktop-portal) backend
+for Hyprland.
## Installing
+
+First, make sure to install the required dependencies:
+
+```
+gbm
+hyprland-protocols
+hyprlang
+libdrm
+libpipewire-0.3
+libspa-0.2
+sdbus-cpp
+wayland-client
+wayland-protocols
+```
+
+Then run the build and install command:
+
```sh
git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland
cd xdg-desktop-portal-hyprland/
-make all
-sudo make install
+cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -B build
+cmake --install /usr
```
## Running, FAQs, etc.
-See [the Hyprland
wiki](https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal/)
+See
+[the Hyprland
wiki](https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/VERSION
new/xdg-desktop-portal-hyprland-1.3.1/VERSION
--- old/xdg-desktop-portal-hyprland-1.2.5/VERSION 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/VERSION 2024-01-05
15:58:42.000000000 +0100
@@ -1 +1 @@
-1.2.5
+1.3.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/contrib/systemd/xdg-desktop-portal-hyprland.service.in
new/xdg-desktop-portal-hyprland-1.3.1/contrib/systemd/xdg-desktop-portal-hyprland.service.in
---
old/xdg-desktop-portal-hyprland-1.2.5/contrib/systemd/xdg-desktop-portal-hyprland.service.in
2023-11-20 20:24:10.000000000 +0100
+++
new/xdg-desktop-portal-hyprland-1.3.1/contrib/systemd/xdg-desktop-portal-hyprland.service.in
2024-01-05 15:58:42.000000000 +0100
@@ -7,6 +7,6 @@
[Service]
Type=dbus
BusName=org.freedesktop.impl.portal.desktop.hyprland
-ExecStart=@libexecdir@/xdg-desktop-portal-hyprland
+ExecStart=@LIBEXECDIR@/xdg-desktop-portal-hyprland
Restart=on-failure
Slice=session.slice
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/flake.lock
new/xdg-desktop-portal-hyprland-1.3.1/flake.lock
--- old/xdg-desktop-portal-hyprland-1.2.5/flake.lock 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/flake.lock 2024-01-05
15:58:42.000000000 +0100
@@ -23,13 +23,47 @@
"type": "github"
}
},
+ "hyprlang": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ },
+ "locked": {
+ "lastModified": 1704287638,
+ "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
+ "owner": "hyprwm",
+ "repo": "hyprlang",
+ "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hyprwm",
+ "repo": "hyprlang",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
- "lastModified": 1694183432,
- "narHash": "sha256-YyPGNapgZNNj51ylQMw9lAgvxtM2ai1HZVUu3GS8Fng=",
+ "lastModified": 1702645756,
+ "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1703961334,
+ "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "db9208ab987cdeeedf78ad9b4cf3c55f5ebd269b",
+ "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
"type": "github"
},
"original": {
@@ -42,7 +76,8 @@
"root": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
- "nixpkgs": "nixpkgs",
+ "hyprlang": "hyprlang",
+ "nixpkgs": "nixpkgs_2",
"systems": "systems"
}
},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/flake.nix
new/xdg-desktop-portal-hyprland-1.3.1/flake.nix
--- old/xdg-desktop-portal-hyprland-1.2.5/flake.nix 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/flake.nix 2024-01-05
15:58:42.000000000 +0100
@@ -12,6 +12,8 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
+
+ hyprlang.url = "github:hyprwm/hyprlang";
};
outputs = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/meson.build
new/xdg-desktop-portal-hyprland-1.3.1/meson.build
--- old/xdg-desktop-portal-hyprland-1.2.5/meson.build 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/meson.build 2024-01-05
15:58:42.000000000 +0100
@@ -33,8 +33,7 @@
]), language: 'cpp')
conf_data = configuration_data()
-conf_data.set('libexecdir', join_paths(get_option('prefix'),
get_option('libexecdir')))
-conf_data.set('systemd_service', '')
+conf_data.set('LIBEXECDIR', join_paths(get_option('prefix'),
get_option('libexecdir')))
systemd = dependency('systemd', required: get_option('systemd'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/nix/default.nix
new/xdg-desktop-portal-hyprland-1.3.1/nix/default.nix
--- old/xdg-desktop-portal-hyprland-1.2.5/nix/default.nix 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/nix/default.nix 2024-01-05
15:58:42.000000000 +0100
@@ -1,50 +1,47 @@
{
lib,
stdenv,
+ cmake,
makeWrapper,
- meson,
- ninja,
pkg-config,
+ wayland-scanner,
+ wrapQtAppsHook,
+ hyprland,
+ hyprland-protocols,
+ hyprlang,
libdrm,
mesa,
pipewire,
- sdbus-cpp,
- systemd,
- wayland-protocols,
- wayland-scanner,
qtbase,
qttools,
qtwayland,
- wrapQtAppsHook,
- hyprland,
+ sdbus-cpp,
slurp,
- hyprland-protocols,
+ systemd,
wayland,
+ wayland-protocols,
debug ? false,
version ? "git",
}:
stdenv.mkDerivation {
- pname = "xdg-desktop-portal-hyprland";
+ pname = "xdg-desktop-portal-hyprland" + lib.optionalString debug "-debug";
inherit version;
src = ../.;
- mesonBuildType =
- if debug
- then "debug"
- else "release";
+ cmakeFlags = lib.optional debug (lib.strings.cmakeFeature "CMAKE_BUILD_TYPE"
"DEBUG");
nativeBuildInputs = [
- meson
- ninja
+ cmake
+ makeWrapper
pkg-config
wayland-scanner
- makeWrapper
wrapQtAppsHook
];
buildInputs = [
hyprland-protocols
+ hyprlang
libdrm
mesa
pipewire
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/nix/overlays.nix
new/xdg-desktop-portal-hyprland-1.3.1/nix/overlays.nix
--- old/xdg-desktop-portal-hyprland-1.2.5/nix/overlays.nix 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/nix/overlays.nix 2024-01-05
15:58:42.000000000 +0100
@@ -25,6 +25,7 @@
inherit (final) hyprland-protocols;
inherit (final.qt6) qtbase qttools wrapQtAppsHook qtwayland;
inherit version;
+ inherit (inputs.hyprlang.packages.${prev.system}) hyprlang;
};
};
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/org.freedesktop.impl.portal.desktop.hyprland.service.in
new/xdg-desktop-portal-hyprland-1.3.1/org.freedesktop.impl.portal.desktop.hyprland.service.in
---
old/xdg-desktop-portal-hyprland-1.2.5/org.freedesktop.impl.portal.desktop.hyprland.service.in
2023-11-20 20:24:10.000000000 +0100
+++
new/xdg-desktop-portal-hyprland-1.3.1/org.freedesktop.impl.portal.desktop.hyprland.service.in
2024-01-05 15:58:42.000000000 +0100
@@ -1,4 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.impl.portal.desktop.hyprland
-Exec=@libexecdir@/xdg-desktop-portal-hyprland
+Exec=@LIBEXECDIR@/xdg-desktop-portal-hyprland
SystemdService=xdg-desktop-portal-hyprland.service
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/src/core/PortalManager.cpp
new/xdg-desktop-portal-hyprland-1.3.1/src/core/PortalManager.cpp
--- old/xdg-desktop-portal-hyprland-1.2.5/src/core/PortalManager.cpp
2023-11-20 20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/core/PortalManager.cpp
2024-01-05 15:58:42.000000000 +0100
@@ -198,6 +198,25 @@
//
+CPortalManager::CPortalManager() {
+ const auto XDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME");
+ const auto HOME = getenv("HOME");
+
+ if (!HOME && !XDG_CONFIG_HOME) {
+ Debug::log(CRIT, "Cannot proceed: neither $HOME nor $XDG_CONFIG_HOME
is present in env");
+ throw "$HOME and $XDG_CONFIG_HOME both missing from env";
+ }
+
+ std::string path = XDG_CONFIG_HOME ? std::string{XDG_CONFIG_HOME} +
"/hypr/xdph.conf" : std::string{HOME} + "/.config/hypr/xdph.conf";
+
+ m_sConfig.config = std::make_unique<Hyprlang::CConfig>(path.c_str(),
Hyprlang::SConfigOptions{.allowMissingConfig = true});
+
+ m_sConfig.config->addConfigValue("general:toplevel_dynamic_bind", {0L});
+
+ m_sConfig.config->commence();
+ m_sConfig.config->parse();
+}
+
void CPortalManager::onGlobal(void* data, struct wl_registry* registry,
uint32_t name, const char* interface, uint32_t version) {
const std::string INTERFACE = interface;
@@ -234,9 +253,13 @@
else if (INTERFACE == wl_shm_interface.name)
m_sWaylandConnection.shm = (wl_shm*)wl_registry_bind(registry, name,
&wl_shm_interface, version);
- else if (INTERFACE == zwlr_foreign_toplevel_manager_v1_interface.name)
- m_sHelpers.toplevel =
-
std::make_unique<CToplevelManager>((zwlr_foreign_toplevel_manager_v1*)wl_registry_bind(registry,
name, &zwlr_foreign_toplevel_manager_v1_interface, version));
+ else if (INTERFACE == zwlr_foreign_toplevel_manager_v1_interface.name) {
+ m_sHelpers.toplevel = std::make_unique<CToplevelManager>(registry,
name, version);
+
+ // remove when another fix is found for
https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/147
+ if
(!std::any_cast<Hyprlang::INT>(m_sConfig.config->getConfigValue("general:toplevel_dynamic_bind")))
+ m_sHelpers.toplevel->activate();
+ }
}
void CPortalManager::onGlobalRemoved(void* data, struct wl_registry* registry,
uint32_t name) {
@@ -331,7 +354,7 @@
std::thread pollThr([this, &pollfds]() {
while (1) {
- int ret = poll(pollfds, 3, 5 /* 5 seconds, reasonable. It's
because we might need to terminate */);
+ int ret = poll(pollfds, 3, 5000 /* 5 seconds, reasonable. It's
because we might need to terminate */);
if (ret < 0) {
Debug::log(CRIT, "[core] Polling fds failed with {}",
strerror(errno));
g_pPortalManager->terminate();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/src/core/PortalManager.hpp
new/xdg-desktop-portal-hyprland-1.3.1/src/core/PortalManager.hpp
--- old/xdg-desktop-portal-hyprland-1.2.5/src/core/PortalManager.hpp
2023-11-20 20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/core/PortalManager.hpp
2024-01-05 15:58:42.000000000 +0100
@@ -3,6 +3,7 @@
#include <memory>
#include <sdbus-c++/sdbus-c++.h>
#include <wayland-client.h>
+#include <hyprlang.hpp>
#include "../portals/Screencopy.hpp"
#include "../portals/Screenshot.hpp"
@@ -30,6 +31,8 @@
class CPortalManager {
public:
+ CPortalManager();
+
void init();
void onGlobal(void* data, struct wl_registry* registry,
uint32_t name, const char* interface, uint32_t version);
@@ -67,6 +70,10 @@
} dma;
} m_sWaylandConnection;
+ struct {
+ std::unique_ptr<Hyprlang::CConfig> config;
+ } m_sConfig;
+
std::vector<SDMABUFModifier> m_vDMABUFMods;
void addTimer(const CTimer& timer);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/xdg-desktop-portal-hyprland-1.2.5/src/meson.build
new/xdg-desktop-portal-hyprland-1.3.1/src/meson.build
--- old/xdg-desktop-portal-hyprland-1.2.5/src/meson.build 2023-11-20
20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/meson.build 2024-01-05
15:58:42.000000000 +0100
@@ -5,6 +5,7 @@
[src, wl_proto_files],
dependencies: [
dependency('gbm'),
+ dependency('hyprlang'),
dependency('libdrm'),
dependency('libpipewire-0.3'),
dependency('sdbus-c++'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/src/portals/Screencopy.cpp
new/xdg-desktop-portal-hyprland-1.3.1/src/portals/Screencopy.cpp
--- old/xdg-desktop-portal-hyprland-1.2.5/src/portals/Screencopy.cpp
2023-11-20 20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/portals/Screencopy.cpp
2024-01-05 15:58:42.000000000 +0100
@@ -46,7 +46,8 @@
g_pPortalManager->m_sPortals.screencopy->m_pPipewire->enqueue(PSESSION);
- g_pPortalManager->m_sPortals.screencopy->queueNextShareFrame(PSESSION);
+ if
(g_pPortalManager->m_sPortals.screencopy->m_pPipewire->streamFromSession(PSESSION))
+ g_pPortalManager->m_sPortals.screencopy->queueNextShareFrame(PSESSION);
zwlr_screencopy_frame_v1_destroy(frame);
PSESSION->sharingData.frameCallback = nullptr;
@@ -284,6 +285,8 @@
void CScreencopyPortal::onCreateSession(sdbus::MethodCall& call) {
sdbus::ObjectPath requestHandle, sessionHandle;
+ g_pPortalManager->m_sHelpers.toplevel->activate();
+
call >> requestHandle;
call >> sessionHandle;
@@ -306,6 +309,9 @@
}
PSESSION->session.release();
Debug::log(LOG, "[screencopy] Session destroyed");
+
+ // deactivate toplevel so it doesn't listen and waste battery
+ g_pPortalManager->m_sHelpers.toplevel->deactivate();
};
PSESSION->request = createDBusRequest(requestHandle);
PSESSION->request->onDestroy = [PSESSION]() { PSESSION->request.release();
};
@@ -468,6 +474,7 @@
SHAREDATA.output = restoreData.output;
SHAREDATA.windowHandle =
(zwlr_foreign_toplevel_handle_v1*)restoreData.windowHandle;
SHAREDATA.type = restoreData.windowHandle ? TYPE_WINDOW :
TYPE_OUTPUT;
+ SHAREDATA.allowToken = true; // user allowed token before
PSESSION->cursorMode = restoreData.withCursor;
} else {
Debug::log(LOG, "[screencopy] restore data invalid / missing,
prompting");
@@ -745,6 +752,15 @@
PSTREAM->streamState = true;
if (PSTREAM->pSession->sharingData.status == FRAME_NONE)
g_pPortalManager->m_sPortals.screencopy->startFrameCopy(PSTREAM->pSession);
+ else {
+ if (PSTREAM->pSession->sharingData.frameCallback)
+
zwlr_screencopy_frame_v1_destroy(PSTREAM->pSession->sharingData.frameCallback);
+ if (PSTREAM->pSession->sharingData.windowFrameCallback)
+
hyprland_toplevel_export_frame_v1_destroy(PSTREAM->pSession->sharingData.windowFrameCallback);
+ PSTREAM->pSession->sharingData.windowFrameCallback = nullptr;
+ PSTREAM->pSession->sharingData.frameCallback = nullptr;
+
g_pPortalManager->m_sPortals.screencopy->startFrameCopy(PSTREAM->pSession);
+ }
break;
default: PSTREAM->streamState = false; break;
}
@@ -1084,7 +1100,7 @@
paramCount = 2;
params[0] = build_format(b[0],
pwFromDrmFourcc(stream->pSession->sharingData.frameInfoDMA.fmt),
stream->pSession->sharingData.frameInfoDMA.w,
- stream->pSession->sharingData.frameInfoDMA.h,
stream->pSession->sharingData.framerate, modifiers, modCount);
+
stream->pSession->sharingData.frameInfoDMA.h,
stream->pSession->sharingData.framerate, modifiers, modCount);
assert(params[0] != NULL);
params[1] = build_format(b[1],
pwFromDrmFourcc(stream->pSession->sharingData.frameInfoSHM.fmt),
stream->pSession->sharingData.frameInfoSHM.w,
stream->pSession->sharingData.frameInfoSHM.h,
stream->pSession->sharingData.framerate, NULL, 0);
@@ -1094,7 +1110,7 @@
paramCount = 1;
params[0] = build_format(b[0],
pwFromDrmFourcc(stream->pSession->sharingData.frameInfoSHM.fmt),
stream->pSession->sharingData.frameInfoSHM.w,
- stream->pSession->sharingData.frameInfoSHM.h,
stream->pSession->sharingData.framerate, NULL, 0);
+
stream->pSession->sharingData.frameInfoSHM.h,
stream->pSession->sharingData.framerate, NULL, 0);
}
if (modifiers)
@@ -1118,6 +1134,11 @@
void CPipewireConnection::enqueue(CScreencopyPortal::SSession* pSession) {
const auto PSTREAM = streamFromSession(pSession);
+ if (!PSTREAM) {
+ Debug::log(ERR, "[pw] Attempted enqueue on invalid session??");
+ return;
+ }
+
Debug::log(TRACE, "[pw] enqueue on {}", (void*)PSTREAM);
if (!PSTREAM->currentPWBuffer) {
@@ -1202,6 +1223,11 @@
void CPipewireConnection::dequeue(CScreencopyPortal::SSession* pSession) {
const auto PSTREAM = streamFromSession(pSession);
+ if (!PSTREAM) {
+ Debug::log(ERR, "[pw] Attempted dequeue on invalid session??");
+ return;
+ }
+
Debug::log(TRACE, "[pw] dequeue on {}", (void*)PSTREAM);
const auto PWBUF = pw_stream_dequeue_buffer(PSTREAM->stream);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/src/shared/ScreencopyShared.cpp
new/xdg-desktop-portal-hyprland-1.3.1/src/shared/ScreencopyShared.cpp
--- old/xdg-desktop-portal-hyprland-1.2.5/src/shared/ScreencopyShared.cpp
2023-11-20 20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/shared/ScreencopyShared.cpp
2024-01-05 15:58:42.000000000 +0100
@@ -154,7 +154,8 @@
case WL_SHM_FORMAT_ARGB2101010:
case WL_SHM_FORMAT_ABGR2101010:
case WL_SHM_FORMAT_RGBA1010102:
- case WL_SHM_FORMAT_BGRA1010102: return (uint32_t)format;
+ case WL_SHM_FORMAT_BGRA1010102:
+ case WL_SHM_FORMAT_BGR888: return (uint32_t)format;
default: Debug::log(ERR, "[screencopy] Unknown format {}",
(int)format); abort();
}
}
@@ -178,6 +179,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;
+ case DRM_FORMAT_BGR888: return SPA_VIDEO_FORMAT_BGR;
default: Debug::log(ERR, "[screencopy] Unknown format {}",
(int)format); abort();
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/src/shared/ToplevelManager.cpp
new/xdg-desktop-portal-hyprland-1.3.1/src/shared/ToplevelManager.cpp
--- old/xdg-desktop-portal-hyprland-1.2.5/src/shared/ToplevelManager.cpp
2023-11-20 20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/shared/ToplevelManager.cpp
2024-01-05 15:58:42.000000000 +0100
@@ -1,5 +1,6 @@
#include "ToplevelManager.hpp"
#include "../helpers/Log.hpp"
+#include "../core/PortalManager.hpp"
static void toplevelTitle(void* data, zwlr_foreign_toplevel_handle_v1*
zwlr_foreign_toplevel_handle_v1, const char* title) {
const auto PTL = (SToplevelHandle*)data;
@@ -81,11 +82,6 @@
.finished = managerFinished,
};
-CToplevelManager::CToplevelManager(zwlr_foreign_toplevel_manager_v1* mgr) {
- m_pManager = mgr;
- zwlr_foreign_toplevel_manager_v1_add_listener(mgr, &managerListener, this);
-}
-
bool CToplevelManager::exists(zwlr_foreign_toplevel_handle_v1* handle) {
for (auto& h : m_vToplevels) {
if (h->handle == handle)
@@ -93,4 +89,39 @@
}
return false;
+}
+
+CToplevelManager::CToplevelManager(wl_registry* registry, uint32_t name,
uint32_t version) {
+ m_sWaylandConnection = {registry, name, version};
+}
+
+void CToplevelManager::activate() {
+ m_iActivateLocks++;
+
+ Debug::log(LOG, "[toplevel] (activate) locks: {}", m_iActivateLocks);
+
+ if (m_pManager || m_iActivateLocks < 1)
+ return;
+
+ m_pManager =
(zwlr_foreign_toplevel_manager_v1*)wl_registry_bind(m_sWaylandConnection.registry,
m_sWaylandConnection.name, &zwlr_foreign_toplevel_manager_v1_interface,
+
m_sWaylandConnection.version);
+ zwlr_foreign_toplevel_manager_v1_add_listener(m_pManager,
&managerListener, this);
+ wl_display_roundtrip(g_pPortalManager->m_sWaylandConnection.display);
+
+ Debug::log(LOG, "[toplevel] Activated, bound to {:x}, toplevels: {}",
(uintptr_t)m_pManager, m_vToplevels.size());
+}
+
+void CToplevelManager::deactivate() {
+ m_iActivateLocks--;
+
+ Debug::log(LOG, "[toplevel] (deactivate) locks: {}", m_iActivateLocks);
+
+ if (!m_pManager || m_iActivateLocks > 0)
+ return;
+
+ zwlr_foreign_toplevel_manager_v1_destroy(m_pManager);
+ m_pManager = nullptr;
+ m_vToplevels.clear();
+
+ Debug::log(LOG, "[toplevel] unbound manager");
}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/xdg-desktop-portal-hyprland-1.2.5/src/shared/ToplevelManager.hpp
new/xdg-desktop-portal-hyprland-1.3.1/src/shared/ToplevelManager.hpp
--- old/xdg-desktop-portal-hyprland-1.2.5/src/shared/ToplevelManager.hpp
2023-11-20 20:24:10.000000000 +0100
+++ new/xdg-desktop-portal-hyprland-1.3.1/src/shared/ToplevelManager.hpp
2024-01-05 15:58:42.000000000 +0100
@@ -17,12 +17,23 @@
class CToplevelManager {
public:
- CToplevelManager(zwlr_foreign_toplevel_manager_v1* mgr);
+ CToplevelManager(wl_registry* registry, uint32_t name, uint32_t version);
+
+ void activate();
+ void deactivate();
bool
exists(zwlr_foreign_toplevel_handle_v1* handle);
std::vector<std::unique_ptr<SToplevelHandle>> m_vToplevels;
private:
- zwlr_foreign_toplevel_manager_v1* m_pManager;
+ zwlr_foreign_toplevel_manager_v1* m_pManager = nullptr;
+
+ int64_t m_iActivateLocks = 0;
+
+ struct {
+ wl_registry* registry = nullptr;
+ uint32_t name = 0;
+ uint32_t version = 0;
+ } m_sWaylandConnection;
};
\ No newline at end of file