Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hyprwm/xdg-desktop-portal-hyprland
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.1
Choose a base ref
...
head repository: hyprwm/xdg-desktop-portal-hyprland
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jan 6, 2024

  1. Copy the full SHA
    bad305c View commit details

Commits on Jan 7, 2024

  1. Copy the full SHA
    f2a8536 View commit details
  2. Copy the full SHA
    899a70e View commit details
  3. Cmake: Do not use CMAKE_INSTALL_LIBDIR for the systemd service

    In some distros CMAKE_INSTALL_LIBDIR is lib64, but systemd services are always in lib (not lib64)
    solopasha authored and fufexan committed Jan 7, 2024
    Copy the full SHA
    24fa87b View commit details
  4. cmake: Don't install sdbus-cpp files

    solopasha authored and fufexan committed Jan 7, 2024
    Copy the full SHA
    6a5de92 View commit details

Commits on Jan 18, 2024

  1. Copy the full SHA
    4fc83e6 View commit details

Commits on Jan 25, 2024

  1. Copy the full SHA
    5a59264 View commit details

Commits on Jan 28, 2024

  1. picker: Allow dialog resizing (#173)

    * picker: Allow dialog resizing
    
    * picker: Smaller dialog and remember size changes
    
    * picker: Save size in temp files
    rurigk authored Jan 28, 2024
    Copy the full SHA
    f29e046 View commit details

Commits on Jan 29, 2024

  1. picker: Adds elided buttons for better readability (#176)

    It also fixes the region button size and alignment
    
    fixes #175
    rurigk authored Jan 29, 2024
    Copy the full SHA
    c06fd88 View commit details

Commits on Feb 18, 2024

  1. picker: Save the output name to a proper variable instead of parsing …

    …it from the button text (#183)
    rurigk authored Feb 18, 2024
    Copy the full SHA
    f62fcea View commit details

Commits on Feb 21, 2024

  1. Copy the full SHA
    65fb44a View commit details

Commits on Feb 23, 2024

  1. flake.lock: update

    fufexan committed Feb 23, 2024
    Copy the full SHA
    1b71391 View commit details

Commits on Feb 26, 2024

  1. screencopy: add missing header for sdbus-cpp 1.5.0

    src/portals/Screencopy.cpp:956:9: error: use of undeclared identifier 'close'
            close(PBUFFER->fd[plane]);
            ^
    src/portals/Screencopy.cpp:1293:21: error: use of undeclared identifier 'close'
                        close(pBuffer->fd[plane_tmp]);
                        ^
    src/portals/Screencopy.cpp:1308:17: error: use of undeclared identifier 'close'
                    close(pBuffer->fd[plane]);
                    ^
    jbeich authored and fufexan committed Feb 26, 2024
    Copy the full SHA
    15fd76c View commit details

Commits on Mar 1, 2024

  1. picker: use only qt6

    vaxerski committed Mar 1, 2024
    Copy the full SHA
    2d2fb54 View commit details

Commits on Apr 15, 2024

  1. flake.lock: update

    fufexan committed Apr 15, 2024
    Copy the full SHA
    bb44921 View commit details

Commits on Apr 21, 2024

  1. Copy the full SHA
    9ace6f9 View commit details

Commits on Apr 25, 2024

  1. core: reset screenshot pointer aswell (#209)

    ensure the screenshot portal is destructed before the connection is
    down, otherwise it segfaults inside sdbus.
    gulafaran authored Apr 25, 2024
    Copy the full SHA
    0fe8404 View commit details

Commits on May 2, 2024

  1. Copy the full SHA
    12af841 View commit details
  2. Copy the full SHA
    ccabd97 View commit details
  3. Copy the full SHA
    1f228ba View commit details

Commits on May 15, 2024

  1. Copy the full SHA
    af7c87a View commit details

Commits on May 21, 2024

  1. core: Small fixes (#215)

    * fix build warnings
    
    * properly generate wayland protocols on rebuild
    
    * make systemd service installation optional
    cnt0 authored May 21, 2024
    Copy the full SHA
    91e48d6 View commit details

Commits on Jun 9, 2024

  1. Update README.md

    Fixed broken URL to wiki.
    maltbeverage authored and fufexan committed Jun 9, 2024
    Copy the full SHA
    7290782 View commit details

Commits on Jun 11, 2024

  1. screencopy: clamp the timer to a miminum of 6 milliseconds (#226)

    When the timer is less than 6 milliseconds, the screen copy portal would frequently fail to start working.
    Aqa-Ib authored Jun 11, 2024
    Copy the full SHA
    8f1ee9f View commit details

Commits on Jun 13, 2024

  1. props: bump version to 1.3.2

    vaxerski committed Jun 13, 2024
    Copy the full SHA
    24be4a2 View commit details

Commits on Jun 17, 2024

  1. Copy the full SHA
    c7894aa View commit details

Commits on Jul 2, 2024

  1. core: fix compilation with pw >= 1.1.82

    fixes #227
    vaxerski committed Jul 2, 2024
    Copy the full SHA
    c5b3093 View commit details

Commits on Jul 5, 2024

  1. flake.lock: update

    fufexan committed Jul 5, 2024
    Copy the full SHA
    bc7131c View commit details
  2. Copy the full SHA
    b9b97e5 View commit details

Commits on Jul 22, 2024

  1. Copy the full SHA
    0bb7094 View commit details
  2. props: bump version to 1.3.3

    vaxerski committed Jul 22, 2024
    Copy the full SHA
    663be9c View commit details

Commits on Jul 23, 2024

  1. global-shortcuts: fix crash by ignoring duplicate shortcuts (#241)

    * global shortcuts: fix crash by ignoring duplicate shortcuts
    
    hyprland_global_shortcuts_manager_v1_register_shortcut will cause an
    error if the (app_id, shortcut_id) combination has already been
    registered. Ignore shortcuts that have already been registered.
    
    When a shortcut is registered again it should also overwrite the
    session for the keybind to make the shortcut work after restarting
    an application, otherwise the key can't be used again.
    
    * Show warning if the shortcut has already been registered
    
    * Remove {} around short ifs
    dec05eba authored Jul 23, 2024
    Copy the full SHA
    3b8c781 View commit details
  2. Copy the full SHA
    5555f46 View commit details

Commits on Jul 28, 2024

  1. flake.lock: update

    nix/overlays: remove pipewire overlay (merged upstream)
    fufexan committed Jul 28, 2024
    Copy the full SHA
    0e2f3b9 View commit details

Commits on Jul 30, 2024

  1. CI: update actions

    nix/overlays: simplify overlay
    fufexan committed Jul 30, 2024
    Copy the full SHA
    7f2a77d View commit details

Commits on Aug 19, 2024

  1. screencopy: attempt retry when pw doesn't return buffers (#249)

    * portals: fix output screencopy not capturing after error
    
    * portals: limit amount of retries for screencopy
    
    * portals: change max retries count
    lennoxlotl authored Aug 19, 2024
    Copy the full SHA
    a08ecbb View commit details

Commits on Sep 1, 2024

  1. CMake: remove wayland-scanner from deps

    Removed because of error:
    
    > Imported target "PkgConfig::deps" includes non-existent path
    > "/nix/store/0ikl83z4h69imxkwsly3hcm424f7wi7j-wayland-scanner-1.23.0-dev/include"
    > in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
    > * The path was deleted, renamed, or moved to another location.
    > * An install or uninstall procedure did not complete successfully.
    > * The installation package was faulty and references files it does not
    > provide.
    fufexan committed Sep 1, 2024
    Copy the full SHA
    0dd9af6 View commit details
  2. flake.lock: update

    fufexan committed Sep 1, 2024
    Copy the full SHA
    fac807e View commit details
  3. Copy the full SHA
    8e5ca2a View commit details
  4. Copy the full SHA
    2425e8f View commit details
  5. README: add Nix warning

    fufexan committed Sep 1, 2024
    Copy the full SHA
    482b569 View commit details
  6. README: fix formatting

    fufexan committed Sep 1, 2024
    Copy the full SHA
    d4c2b98 View commit details
  7. Copy the full SHA
    11e15b4 View commit details

Commits on Sep 11, 2024

  1. Copy the full SHA
    e695669 View commit details

Commits on Sep 20, 2024

  1. core: Move to hyprwayland-scanner (#260)

    * move to hw-s
    * hyprland-share-picker: add missing sources to meson, format CMake
    * CMake: bump hw-s version
    * CMake: fix protocolnew external protos
    * CMake: get wayland.xml from wayland-scanner
    * Nix: add missing deps
    * Meson: use hw-s for protocols, add hyprutils
    
    ---------
    
    Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
    vaxerski and fufexan authored Sep 20, 2024
    Copy the full SHA
    eb3f3d9 View commit details
  2. version: bump to 1.3.4

    vaxerski committed Sep 20, 2024
    Copy the full SHA
    73b8c4f View commit details
  3. Copy the full SHA
    ac1b8c3 View commit details

Commits on Sep 21, 2024

  1. Copy the full SHA
    5d64be5 View commit details
  2. Copy the full SHA
    5e40936 View commit details
  3. screencopy/picker: add an option to allow restore token by default

    fixes #258
    
    screencopy:allow_token_by_default -> bool
    vaxerski committed Sep 21, 2024
    Copy the full SHA
    bab430b View commit details
15 changes: 5 additions & 10 deletions .github/workflows/nix-build.yaml
Original file line number Diff line number Diff line change
@@ -8,14 +8,9 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install nix
uses: cachix/install-nix-action@v17
with:
install_url: https://releases.nixos.org/nix/nix-2.10.3/install
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes

- uses: cachix/install-nix-action@v27
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build xdg-desktop-portal-hyprland
run: nix build --print-build-logs
run: nix build --print-build-logs --extra-substituters "https://hyprland.cachix.org"
19 changes: 13 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -51,14 +51,21 @@ Module.symvers
Mkfile.old
dkms.conf

# build folder
# Build folders
build/
build-*/
hyprland-share-picker/build/

.cache
.vscode/
# Generated code files
protocols/*.c*
protocols/*.h*

hyprland-share-picker/build/
# Nix build results
result
result-man

protocols/*.c
protocols/*.h
# Code editors
.vscode/

# MISCELLANEOUS
.cache
165 changes: 104 additions & 61 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -3,105 +3,148 @@ cmake_minimum_required(VERSION 3.19)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/VERSION VER)
string(STRIP ${VER} VER)

project(xdg-desktop-portal-hyprland
DESCRIPTION "An XDG-Destop-Portal backend for Hyprland (and wlroots)"
VERSION ${VER}
)
project(
xdg-desktop-portal-hyprland
DESCRIPTION "An XDG-Destop-Portal backend for Hyprland (and wlroots)"
VERSION ${VER})

set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
set(SYSTEMD_SERVICES
ON
CACHE BOOL "Install systemd service file")

if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
message(STATUS "Configuring XDPH in Debug with CMake")
add_compile_definitions(HYPRLAND_DEBUG)
message(STATUS "Configuring XDPH in Debug with CMake")
add_compile_definitions(HYPRLAND_DEBUG)
else()
add_compile_options(-O3)
message(STATUS "Configuring XDPH in Release with CMake")
add_compile_options(-O3)
message(STATUS "Configuring XDPH in Release with CMake")
endif()

include_directories(
.
"protocols/"
)
add_compile_definitions(XDPH_VERSION="${VER}")

include_directories(. "protocols/")

# 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)
configure_file(org.freedesktop.impl.portal.desktop.hyprland.service.in
org.freedesktop.impl.portal.desktop.hyprland.service @ONLY)
if(SYSTEMD_SERVICES)
configure_file(contrib/systemd/xdg-desktop-portal-hyprland.service.in
contrib/systemd/xdg-desktop-portal-hyprland.service @ONLY)
endif()

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 -Wno-address-of-temporary)
add_compile_options(
-Wall
-Wextra
-Wno-unused-parameter
-Wno-unused-value
-Wno-missing-field-initializers
-Wno-narrowing
-Wno-pointer-arith
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-fpermissive>
-Wno-address-of-temporary)

# dependencies
message(STATUS "Checking deps...")
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 hyprlang>=0.2.0)
pkg_check_modules(
deps
REQUIRED
IMPORTED_TARGET
wayland-client
wayland-protocols
libpipewire-0.3>=1.1.82
libspa-0.2
libdrm
gbm
hyprlang>=0.2.0
hyprutils>=0.2.6
hyprwayland-scanner>=0.4.2)

# check whether we can find sdbus-c++ through pkg-config
pkg_check_modules(SDBUS IMPORTED_TARGET sdbus-c++)
pkg_check_modules(SDBUS IMPORTED_TARGET sdbus-c++>=2.0.0)
if(NOT SDBUS_FOUND)
include_directories("subprojects/sdbus-cpp/include/")
add_subdirectory(subprojects/sdbus-cpp)
add_library(PkgConfig::SDBUS ALIAS sdbus-c++)
include_directories("subprojects/sdbus-cpp/include/")
add_subdirectory(subprojects/sdbus-cpp EXCLUDE_FROM_ALL)
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")
set(HYPRLAND_PROTOCOLS "${HYPRLAND_PROTOS_PREFIX}/share/hyprland-protocols")
else()
set(HYPRLAND_PROTOCOLS "subprojects/hyprland-protocols")
set(HYPRLAND_PROTOCOLS "${CMAKE_SOURCE_DIR}/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 PkgConfig::SDBUS 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)
message(STATUS "Found WaylandScanner at ${WaylandScanner}")
execute_process(
COMMAND pkg-config --variable=pkgdatadir wayland-protocols
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}")

function(protocol protoPath protoName external)
if (external)
execute_process(
COMMAND ${WaylandScanner} client-header ${protoPath} protocols/${protoName}-protocol.h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
execute_process(
COMMAND ${WaylandScanner} private-code ${protoPath} protocols/${protoName}-protocol.c
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(xdg-desktop-portal-hyprland PRIVATE protocols/${protoName}-protocol.c)
else()
execute_process(
COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/${protoPath} protocols/${protoName}-protocol.h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
execute_process(
COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/${protoPath} protocols/${protoName}-protocol.c
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(xdg-desktop-portal-hyprland PRIVATE protocols/${protoName}-protocol.c)
endif()
pkg_get_variable(WAYLAND_SCANNER_DIR wayland-scanner pkgdatadir)
message(STATUS "Found wayland-scanner at ${WAYLAND_SCANNER_DIR}")

function(protocolnew protoPath protoName external)
if(external)
set(path ${protoPath})
else()
set(path ${WAYLAND_PROTOCOLS_DIR}/${protoPath})
endif()
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/protocols/${protoName}.cpp
${CMAKE_SOURCE_DIR}/protocols/${protoName}.hpp
COMMAND hyprwayland-scanner --client ${path}/${protoName}.xml
${CMAKE_SOURCE_DIR}/protocols/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(xdg-desktop-portal-hyprland PRIVATE protocols/${protoName}.cpp
protocols/${protoName}.hpp)
endfunction()
function(protocolWayland)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/protocols/wayland.cpp
${CMAKE_SOURCE_DIR}/protocols/wayland.hpp
COMMAND hyprwayland-scanner --wayland-enums --client
${WAYLAND_SCANNER_DIR}/wayland.xml ${CMAKE_SOURCE_DIR}/protocols/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(xdg-desktop-portal-hyprland PRIVATE protocols/wayland.cpp
protocols/wayland.hpp)
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("${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)
protocolwayland()

protocolnew("${CMAKE_SOURCE_DIR}/protocols"
"wlr-foreign-toplevel-management-unstable-v1" true)
protocolnew("${CMAKE_SOURCE_DIR}/protocols" "wlr-screencopy-unstable-v1" true)
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-global-shortcuts-v1"
true)
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-toplevel-export-v1"
true)
protocolnew("stable/linux-dmabuf" "linux-dmabuf-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")
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")
if(SYSTEMD_SERVICES)
install(
FILES
${CMAKE_BINARY_DIR}/contrib/systemd/xdg-desktop-portal-hyprland.service
DESTINATION "lib/systemd/user")
endif()
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ First, make sure to install the required dependencies:
gbm
hyprland-protocols
hyprlang
hyprutils
hyprwayland-scanner
libdrm
libpipewire-0.3
libspa-0.2
@@ -24,11 +26,29 @@ Then run the build and install command:
```sh
git clone --recursive https://github.com/hyprwm/xdg-desktop-portal-hyprland
cd xdg-desktop-portal-hyprland/
cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -B build
cmake --install /usr
cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr -B build
cmake --build build
sudo cmake --install build
```

## Nix

> [!CAUTION]
> XDPH should not be used from this flake directly!
>
> Instead, use it from the [Hyprland flake](https://github.com/hyprwm/Hyprland).
There are two reasons for the above:

1. Hyprland depends on XDPH, but XDPH also depends on Hyprland. This results in
a cyclic dependency, which is a nightmare. To counter this, we use the
Nixpkgs Hyprland package in this flake, so that it can be later consumed by
the Hyprland flake while overriding the Hyprland package.
2. Even if you manually do all the overriding, you may still get it wrong and
lose out on the Cachix cache (which has XDPH as exposed by the Hyprland
flake).

## Running, FAQs, etc.

See
[the Hyprland wiki](https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal)
[the Hyprland wiki](https://wiki.hyprland.org/Hypr-Ecosystem/xdg-desktop-portal-hyprland/)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.9
Loading