2026-01-18 02:59:22 +00:00
|
|
|
# SPDX-FileCopyrightText: (C) 2024 Chris Rizzitello <sithlord48@gmail.com>
|
|
|
|
|
# SPDX-FileCopyrightText: (C) 2012 - 2024 Symless Ltd
|
|
|
|
|
# SPDX-FileCopyrightText: (C) 2009 - 2012 Nick Bolton
|
2025-01-24 00:11:17 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
2024-10-24 01:04:39 +00:00
|
|
|
|
2024-10-21 20:39:15 +00:00
|
|
|
if(UNIX AND NOT APPLE)
|
2024-12-02 01:21:22 +00:00
|
|
|
pkg_check_modules(LIBEI REQUIRED QUIET "libei-1.0 >= ${REQUIRED_LIBEI_VERSION}")
|
2024-10-21 20:39:15 +00:00
|
|
|
message(STATUS "libei version: ${LIBEI_VERSION}")
|
|
|
|
|
|
2024-12-02 01:21:22 +00:00
|
|
|
pkg_check_modules(LIBPORTAL REQUIRED QUIET "libportal >= ${REQUIRED_LIBPORTAL_VERSION}")
|
2024-10-21 20:39:15 +00:00
|
|
|
message(STATUS "libportal version: ${LIBPORTAL_VERSION}")
|
2026-02-02 01:10:24 +00:00
|
|
|
|
|
|
|
|
# Check if we have the restore ability in the IC portal
|
|
|
|
|
include(CMakePushCheckState)
|
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
|
cmake_push_check_state(RESET)
|
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${LIBPORTAL_INCLUDE_DIRS};${GLIB2_INCLUDE_DIRS}")
|
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};${LIBPORTAL_LINK_LIBRARIES};${GLIB2_LINK_LIBRARIES}")
|
|
|
|
|
check_symbol_exists(xdp_input_capture_session_get_restore_token "libportal/inputcapture.h" HAVE_IC_RESTORE)
|
feat: inputcapture clipboard support
Send the clipboard over the libportal InputCapture portal. Only built
if the installed libportal has clipboard support.
AI disclosure: Claude was used on both sides of this work.
- Peter Hutterer: "The second commit was purely written by Claude
after I stared at this for too long without seeing any hope of
getting started. Turns out Claude wrote something that at least
looks correct and it does work. It needs review but also needs
knowledge of deskflow's internals that I don't have..."
- Nick Bolton: Claude also assisted with the follow-up work listed
below (image copy/paste, session re-request, race fixes, size/mime
validation, and CMake detection).
Server side (Wayland host, Peter Hutterer):
- Initial scaffolding for inputcapture clipboard support, guarded so it
only builds when the portal exposes the clipboard API.
- Integrate clipboard data into the inputcapture session so the host
clipboard can be offered to the remote (the Claude-written commit
referenced above).
Client side (Wayland receiver, KoljaFrahm):
- Receive clipboard data from the server and feed it into the local
clipboard through libportal. Built on the reference code by Peter:
https://github.com/whot/libportal-clipboard-test/tree/main
Build integration and rebase (Chris Rizzitello, sithlord48):
- Add the original CMake check for libportal/clipboard.h to define
HAVE_LIBPORTAL_CLIPBOARD, and guard the libportal clipboard use on
it.
- Update the code style and rebase onto the updated input capture
session persistence: https://github.com/deskflow/deskflow/pull/9415
Image support and reliability fixes (Nick Bolton):
- Support image copy/paste in addition to text, so screenshots and
other image clipboard contents work both ways through inputcapture.
- Re-request the input capture session when it comes up without a
clipboard, so new testers with existing sessions can get clipboard
functionality without needing to clear the session.
- Defer clipboard reads until the input capture session is active,
avoiding races where reads happen before the portal is ready.
- Fix assorted style issues in original commit to match conventions.
- Check the configured clipboard size limit and validate incoming
mime types before forwarding inputcapture clipboard data.
- Switch the CMake clipboard probe to check_symbol_exists so detection
matches what the compiler actually sees in the headers.
Co-authored-by: Nick Bolton <nick@symless.com>
Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
Co-authored-by: Chris Rizzitello <sithlord48@gmail.com>
2026-02-05 04:01:33 +00:00
|
|
|
check_symbol_exists(xdp_session_request_clipboard "libportal/portal-helpers.h;libportal/clipboard.h" HAVE_LP_CLIPBOARD)
|
2026-02-02 01:10:24 +00:00
|
|
|
cmake_pop_check_state()
|
2024-10-21 20:39:15 +00:00
|
|
|
endif()
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(WIN32)
|
2024-10-24 01:04:39 +00:00
|
|
|
set(PLATFORM_SOURCES
|
|
|
|
|
IMSWindowsClipboardFacade.h
|
|
|
|
|
MSWindowsClipboard.cpp
|
|
|
|
|
MSWindowsClipboard.h
|
|
|
|
|
MSWindowsClipboardAnyTextConverter.cpp
|
|
|
|
|
MSWindowsClipboardAnyTextConverter.h
|
|
|
|
|
MSWindowsClipboardBitmapConverter.cpp
|
|
|
|
|
MSWindowsClipboardBitmapConverter.h
|
|
|
|
|
MSWindowsClipboardFacade.cpp
|
|
|
|
|
MSWindowsClipboardFacade.h
|
|
|
|
|
MSWindowsClipboardHTMLConverter.cpp
|
|
|
|
|
MSWindowsClipboardHTMLConverter.h
|
|
|
|
|
MSWindowsClipboardUTF16Converter.cpp
|
|
|
|
|
MSWindowsClipboardUTF16Converter.h
|
|
|
|
|
MSWindowsDebugOutputter.cpp
|
|
|
|
|
MSWindowsDebugOutputter.h
|
|
|
|
|
MSWindowsDesks.cpp
|
|
|
|
|
MSWindowsDesks.h
|
|
|
|
|
MSWindowsEventQueueBuffer.cpp
|
|
|
|
|
MSWindowsEventQueueBuffer.h
|
|
|
|
|
MSWindowsHook.cpp
|
|
|
|
|
MSWindowsHook.h
|
|
|
|
|
MSWindowsKeyState.cpp
|
|
|
|
|
MSWindowsKeyState.h
|
|
|
|
|
MSWindowsPowerManager.cpp
|
|
|
|
|
MSWindowsPowerManager.h
|
2025-02-13 17:37:58 +00:00
|
|
|
MSWindowsProcess.cpp
|
|
|
|
|
MSWindowsProcess.h
|
2024-10-24 01:04:39 +00:00
|
|
|
MSWindowsScreen.cpp
|
|
|
|
|
MSWindowsScreen.h
|
|
|
|
|
MSWindowsScreenSaver.cpp
|
|
|
|
|
MSWindowsScreenSaver.h
|
|
|
|
|
MSWindowsSession.cpp
|
|
|
|
|
MSWindowsSession.h
|
|
|
|
|
MSWindowsWatchdog.cpp
|
|
|
|
|
MSWindowsWatchdog.h
|
|
|
|
|
)
|
2024-07-02 10:23:56 +00:00
|
|
|
elseif(APPLE)
|
2024-10-24 01:04:39 +00:00
|
|
|
set(PLATFORM_SOURCES
|
|
|
|
|
IOSXKeyResource.cpp
|
|
|
|
|
IOSXKeyResource.h
|
|
|
|
|
OSXAutoTypes.h
|
|
|
|
|
OSXClipboard.cpp
|
|
|
|
|
OSXClipboard.h
|
|
|
|
|
OSXClipboardAnyBitmapConverter.cpp
|
|
|
|
|
OSXClipboardAnyBitmapConverter.h
|
|
|
|
|
OSXClipboardAnyTextConverter.cpp
|
|
|
|
|
OSXClipboardAnyTextConverter.h
|
|
|
|
|
OSXClipboardBMPConverter.cpp
|
|
|
|
|
OSXClipboardBMPConverter.h
|
|
|
|
|
OSXClipboardHTMLConverter.cpp
|
|
|
|
|
OSXClipboardHTMLConverter.h
|
|
|
|
|
OSXClipboardTextConverter.cpp
|
|
|
|
|
OSXClipboardTextConverter.h
|
|
|
|
|
OSXClipboardUTF8Converter.cpp
|
|
|
|
|
OSXClipboardUTF8Converter.h
|
|
|
|
|
OSXClipboardUTF16Converter.cpp
|
|
|
|
|
OSXClipboardUTF16Converter.h
|
2025-05-05 01:47:44 +00:00
|
|
|
OSXCocoaApp.h
|
|
|
|
|
OSXCocoaApp.m
|
2024-10-24 01:04:39 +00:00
|
|
|
OSXEventQueueBuffer.cpp
|
|
|
|
|
OSXEventQueueBuffer.h
|
|
|
|
|
OSXKeyState.cpp
|
|
|
|
|
OSXKeyState.h
|
|
|
|
|
OSXMediaKeySupport.h
|
|
|
|
|
OSXMediaKeySupport.m
|
|
|
|
|
OSXPasteboardPeeker.h
|
|
|
|
|
OSXPasteboardPeeker.m
|
|
|
|
|
OSXPowerManager.cpp
|
|
|
|
|
OSXPowerManager.h
|
|
|
|
|
OSXScreen.h
|
|
|
|
|
OSXScreen.mm
|
|
|
|
|
OSXScreenSaver.cpp
|
|
|
|
|
OSXScreenSaver.h
|
|
|
|
|
OSXScreenSaverControl.h
|
|
|
|
|
OSXScreenSaverUtil.h
|
|
|
|
|
OSXScreenSaverUtil.m
|
|
|
|
|
OSXUchrKeyResource.cpp
|
|
|
|
|
OSXUchrKeyResource.h
|
|
|
|
|
)
|
2024-07-02 10:23:56 +00:00
|
|
|
elseif(UNIX)
|
2024-10-24 01:04:39 +00:00
|
|
|
set(PLATFORM_SOURCES
|
2025-08-11 01:30:40 +00:00
|
|
|
XDGPortalRegistry.h
|
2025-09-12 15:22:42 +00:00
|
|
|
XDGPowerManager.cpp
|
|
|
|
|
XDGPowerManager.h
|
2025-11-13 16:05:52 +00:00
|
|
|
XDGKeyUtil.h
|
|
|
|
|
XDGKeyUtil.cpp
|
2024-10-24 01:04:39 +00:00
|
|
|
)
|
2025-11-13 16:48:30 +00:00
|
|
|
if (BUILD_X11_SUPPORT)
|
2025-12-30 16:29:12 +00:00
|
|
|
configure_file(XWindowsConfig.h.in XWindowsConfig.h @ONLY)
|
2025-11-13 16:48:30 +00:00
|
|
|
list(APPEND PLATFORM_SOURCES
|
|
|
|
|
XWindowsClipboard.cpp
|
|
|
|
|
XWindowsClipboard.h
|
|
|
|
|
XWindowsClipboardAnyBitmapConverter.cpp
|
|
|
|
|
XWindowsClipboardAnyBitmapConverter.h
|
|
|
|
|
XWindowsClipboardBMPConverter.cpp
|
|
|
|
|
XWindowsClipboardBMPConverter.h
|
|
|
|
|
XWindowsClipboardHTMLConverter.cpp
|
|
|
|
|
XWindowsClipboardHTMLConverter.h
|
|
|
|
|
XWindowsClipboardTextConverter.cpp
|
|
|
|
|
XWindowsClipboardTextConverter.h
|
|
|
|
|
XWindowsClipboardUCS2Converter.cpp
|
|
|
|
|
XWindowsClipboardUCS2Converter.h
|
|
|
|
|
XWindowsClipboardUTF8Converter.cpp
|
|
|
|
|
XWindowsClipboardUTF8Converter.h
|
|
|
|
|
XWindowsEventQueueBuffer.cpp
|
|
|
|
|
XWindowsEventQueueBuffer.h
|
|
|
|
|
XWindowsKeyState.cpp
|
|
|
|
|
XWindowsKeyState.h
|
|
|
|
|
XWindowsScreen.cpp
|
|
|
|
|
XWindowsScreen.h
|
|
|
|
|
XWindowsScreenSaver.cpp
|
|
|
|
|
XWindowsScreenSaver.h
|
|
|
|
|
XWindowsUtil.cpp
|
|
|
|
|
XWindowsUtil.h
|
2025-12-30 16:29:12 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/XWindowsConfig.h
|
2025-11-13 16:48:30 +00:00
|
|
|
)
|
|
|
|
|
endif()
|
2024-08-30 14:53:25 +00:00
|
|
|
|
|
|
|
|
if(LIBEI_FOUND)
|
2024-10-24 01:04:39 +00:00
|
|
|
list(APPEND PLATFORM_SOURCES
|
feat: inputcapture clipboard support
Send the clipboard over the libportal InputCapture portal. Only built
if the installed libportal has clipboard support.
AI disclosure: Claude was used on both sides of this work.
- Peter Hutterer: "The second commit was purely written by Claude
after I stared at this for too long without seeing any hope of
getting started. Turns out Claude wrote something that at least
looks correct and it does work. It needs review but also needs
knowledge of deskflow's internals that I don't have..."
- Nick Bolton: Claude also assisted with the follow-up work listed
below (image copy/paste, session re-request, race fixes, size/mime
validation, and CMake detection).
Server side (Wayland host, Peter Hutterer):
- Initial scaffolding for inputcapture clipboard support, guarded so it
only builds when the portal exposes the clipboard API.
- Integrate clipboard data into the inputcapture session so the host
clipboard can be offered to the remote (the Claude-written commit
referenced above).
Client side (Wayland receiver, KoljaFrahm):
- Receive clipboard data from the server and feed it into the local
clipboard through libportal. Built on the reference code by Peter:
https://github.com/whot/libportal-clipboard-test/tree/main
Build integration and rebase (Chris Rizzitello, sithlord48):
- Add the original CMake check for libportal/clipboard.h to define
HAVE_LIBPORTAL_CLIPBOARD, and guard the libportal clipboard use on
it.
- Update the code style and rebase onto the updated input capture
session persistence: https://github.com/deskflow/deskflow/pull/9415
Image support and reliability fixes (Nick Bolton):
- Support image copy/paste in addition to text, so screenshots and
other image clipboard contents work both ways through inputcapture.
- Re-request the input capture session when it comes up without a
clipboard, so new testers with existing sessions can get clipboard
functionality without needing to clear the session.
- Defer clipboard reads until the input capture session is active,
avoiding races where reads happen before the portal is ready.
- Fix assorted style issues in original commit to match conventions.
- Check the configured clipboard size limit and validate incoming
mime types before forwarding inputcapture clipboard data.
- Switch the CMake clipboard probe to check_symbol_exists so detection
matches what the compiler actually sees in the headers.
Co-authored-by: Nick Bolton <nick@symless.com>
Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
Co-authored-by: Chris Rizzitello <sithlord48@gmail.com>
2026-02-05 04:01:33 +00:00
|
|
|
EiClipboard.cpp
|
|
|
|
|
EiClipboard.h
|
2024-10-24 01:04:39 +00:00
|
|
|
EiEventQueueBuffer.cpp
|
|
|
|
|
EiEventQueueBuffer.h
|
|
|
|
|
EiKeyState.cpp
|
|
|
|
|
EiKeyState.h
|
|
|
|
|
EiScreen.cpp
|
|
|
|
|
EiScreen.h
|
|
|
|
|
)
|
2024-08-30 14:53:25 +00:00
|
|
|
# The Portal sources also require EI.
|
|
|
|
|
if(LIBPORTAL_FOUND)
|
2024-10-24 01:04:39 +00:00
|
|
|
list(APPEND PLATFORM_SOURCES
|
|
|
|
|
PortalInputCapture.cpp
|
|
|
|
|
PortalInputCapture.h
|
|
|
|
|
PortalRemoteDesktop.cpp
|
|
|
|
|
PortalRemoteDesktop.h
|
|
|
|
|
)
|
2026-05-19 19:01:38 +00:00
|
|
|
if(HAVE_LP_CLIPBOARD)
|
|
|
|
|
list(APPEND PLATFORM_SOURCES
|
|
|
|
|
PortalClipboard.cpp
|
|
|
|
|
PortalClipboard.h
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2024-08-30 14:53:25 +00:00
|
|
|
endif()
|
|
|
|
|
endif()
|
2012-06-10 16:50:54 +00:00
|
|
|
endif()
|
|
|
|
|
|
2024-10-24 01:04:39 +00:00
|
|
|
# wayland.h is included to check for wayland support
|
2025-11-05 20:53:29 +00:00
|
|
|
add_library(platform STATIC ${PLATFORM_SOURCES})
|
2024-10-24 01:04:39 +00:00
|
|
|
|
2013-09-24 16:29:51 +00:00
|
|
|
target_link_libraries(platform client ${libs})
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(UNIX)
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
platform
|
|
|
|
|
io
|
|
|
|
|
net
|
2024-09-17 19:00:25 +00:00
|
|
|
app
|
2024-07-02 10:23:56 +00:00
|
|
|
client
|
|
|
|
|
${libs})
|
2021-10-21 07:25:57 +00:00
|
|
|
|
2025-12-30 04:11:21 +00:00
|
|
|
if(APPLE)
|
|
|
|
|
find_library(COCOA_LIBRARY Cocoa)
|
|
|
|
|
target_link_libraries(platform ${COCOA_LIBRARY})
|
|
|
|
|
else()
|
2025-08-14 20:34:17 +00:00
|
|
|
if(${LIBXKBCOMMON_VERSION} VERSION_GREATER_EQUAL "1.10")
|
|
|
|
|
target_compile_definitions(platform PRIVATE HAVE_XKB_KEYMAP_MOD_GET_MASK=1)
|
|
|
|
|
endif()
|
2026-02-25 23:42:11 +00:00
|
|
|
target_compile_definitions(platform PUBLIC WINAPI_LIBEI WINAPI_LIBPORTAL)
|
2026-02-02 01:10:24 +00:00
|
|
|
if (HAVE_IC_RESTORE)
|
|
|
|
|
target_compile_definitions(platform PUBLIC HAVE_LIBPORTAL_INPUTCAPTURE_RESTORE)
|
|
|
|
|
endif()
|
feat: inputcapture clipboard support
Send the clipboard over the libportal InputCapture portal. Only built
if the installed libportal has clipboard support.
AI disclosure: Claude was used on both sides of this work.
- Peter Hutterer: "The second commit was purely written by Claude
after I stared at this for too long without seeing any hope of
getting started. Turns out Claude wrote something that at least
looks correct and it does work. It needs review but also needs
knowledge of deskflow's internals that I don't have..."
- Nick Bolton: Claude also assisted with the follow-up work listed
below (image copy/paste, session re-request, race fixes, size/mime
validation, and CMake detection).
Server side (Wayland host, Peter Hutterer):
- Initial scaffolding for inputcapture clipboard support, guarded so it
only builds when the portal exposes the clipboard API.
- Integrate clipboard data into the inputcapture session so the host
clipboard can be offered to the remote (the Claude-written commit
referenced above).
Client side (Wayland receiver, KoljaFrahm):
- Receive clipboard data from the server and feed it into the local
clipboard through libportal. Built on the reference code by Peter:
https://github.com/whot/libportal-clipboard-test/tree/main
Build integration and rebase (Chris Rizzitello, sithlord48):
- Add the original CMake check for libportal/clipboard.h to define
HAVE_LIBPORTAL_CLIPBOARD, and guard the libportal clipboard use on
it.
- Update the code style and rebase onto the updated input capture
session persistence: https://github.com/deskflow/deskflow/pull/9415
Image support and reliability fixes (Nick Bolton):
- Support image copy/paste in addition to text, so screenshots and
other image clipboard contents work both ways through inputcapture.
- Re-request the input capture session when it comes up without a
clipboard, so new testers with existing sessions can get clipboard
functionality without needing to clear the session.
- Defer clipboard reads until the input capture session is active,
avoiding races where reads happen before the portal is ready.
- Fix assorted style issues in original commit to match conventions.
- Check the configured clipboard size limit and validate incoming
mime types before forwarding inputcapture clipboard data.
- Switch the CMake clipboard probe to check_symbol_exists so detection
matches what the compiler actually sees in the headers.
Co-authored-by: Nick Bolton <nick@symless.com>
Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
Co-authored-by: Chris Rizzitello <sithlord48@gmail.com>
2026-02-05 04:01:33 +00:00
|
|
|
if (HAVE_LP_CLIPBOARD)
|
|
|
|
|
target_compile_definitions(platform PUBLIC HAVE_LIBPORTAL_CLIPBOARD)
|
|
|
|
|
endif()
|
2025-12-30 04:11:21 +00:00
|
|
|
target_include_directories(platform PUBLIC ${LIBEI_INCLUDE_DIRS} ${LIBPORTAL_INCLUDE_DIRS})
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
platform
|
|
|
|
|
Qt6::DBus
|
feat: inputcapture clipboard support
Send the clipboard over the libportal InputCapture portal. Only built
if the installed libportal has clipboard support.
AI disclosure: Claude was used on both sides of this work.
- Peter Hutterer: "The second commit was purely written by Claude
after I stared at this for too long without seeing any hope of
getting started. Turns out Claude wrote something that at least
looks correct and it does work. It needs review but also needs
knowledge of deskflow's internals that I don't have..."
- Nick Bolton: Claude also assisted with the follow-up work listed
below (image copy/paste, session re-request, race fixes, size/mime
validation, and CMake detection).
Server side (Wayland host, Peter Hutterer):
- Initial scaffolding for inputcapture clipboard support, guarded so it
only builds when the portal exposes the clipboard API.
- Integrate clipboard data into the inputcapture session so the host
clipboard can be offered to the remote (the Claude-written commit
referenced above).
Client side (Wayland receiver, KoljaFrahm):
- Receive clipboard data from the server and feed it into the local
clipboard through libportal. Built on the reference code by Peter:
https://github.com/whot/libportal-clipboard-test/tree/main
Build integration and rebase (Chris Rizzitello, sithlord48):
- Add the original CMake check for libportal/clipboard.h to define
HAVE_LIBPORTAL_CLIPBOARD, and guard the libportal clipboard use on
it.
- Update the code style and rebase onto the updated input capture
session persistence: https://github.com/deskflow/deskflow/pull/9415
Image support and reliability fixes (Nick Bolton):
- Support image copy/paste in addition to text, so screenshots and
other image clipboard contents work both ways through inputcapture.
- Re-request the input capture session when it comes up without a
clipboard, so new testers with existing sessions can get clipboard
functionality without needing to clear the session.
- Defer clipboard reads until the input capture session is active,
avoiding races where reads happen before the portal is ready.
- Fix assorted style issues in original commit to match conventions.
- Check the configured clipboard size limit and validate incoming
mime types before forwarding inputcapture clipboard data.
- Switch the CMake clipboard probe to check_symbol_exists so detection
matches what the compiler actually sees in the headers.
Co-authored-by: Nick Bolton <nick@symless.com>
Co-authored-by: KoljaFrahm <GitHub.Kolja@dfgh.net>
Co-authored-by: Chris Rizzitello <sithlord48@gmail.com>
2026-02-05 04:01:33 +00:00
|
|
|
Qt6::Gui
|
2025-12-30 04:11:21 +00:00
|
|
|
${LIBXKBCOMMON_LINK_LIBRARIES}
|
|
|
|
|
${GLIB2_LINK_LIBRARIES} ${LIBM_LIBRARIES}
|
|
|
|
|
${LIBEI_LINK_LIBRARIES} ${LIBPORTAL_LINK_LIBRARIES})
|
2024-07-02 10:23:56 +00:00
|
|
|
endif()
|
2012-06-10 16:50:54 +00:00
|
|
|
endif()
|