Skip to content

Commit 3e14aad

Browse files
committed
wayland/screencopy: add screencopy
1 parent 918dd23 commit 3e14aad

33 files changed

+2964
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ boption(HYPRLAND_IPC " Hyprland IPC" ON REQUIRES HYPRLAND)
5656
boption(HYPRLAND_GLOBAL_SHORTCUTS " Hyprland Global Shortcuts" ON REQUIRES HYPRLAND)
5757
boption(HYPRLAND_FOCUS_GRAB " Hyprland Focus Grabbing" ON REQUIRES HYPRLAND)
5858
boption(HYPRLAND_SURFACE_EXTENSIONS " Hyprland Surface Extensions" ON REQUIRES HYPRLAND)
59+
boption(SCREENCOPY " Screencopy" ON REQUIRES WAYLAND)
60+
boption(SCREENCOPY_ICC " Image Copy Capture" ON REQUIRES WAYLAND)
61+
boption(SCREENCOPY_WLR " Wlroots Screencopy" ON REQUIRES WAYLAND)
62+
boption(SCREENCOPY_HYPRLAND_TOPLEVEL " Hyprland Toplevel Export" ON REQUIRES WAYLAND)
5963
boption(X11 "X11" ON)
6064
boption(I3 "I3/Sway" ON)
6165
boption(I3_IPC " I3/Sway IPC" ON REQUIRES I3)
@@ -70,7 +74,7 @@ boption(SERVICE_NOTIFICATIONS "Notifications" ON)
7074
include(cmake/install-qml-module.cmake)
7175
include(cmake/util.cmake)
7276

73-
add_compile_options(-Wall -Wextra)
77+
add_compile_options(-Wall -Wextra -Wno-vla-cxx-extension)
7478

7579
# pipewire defines this, breaking PCH
7680
add_compile_definitions(_REENTRANT)

src/wayland/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ if (WAYLAND_TOPLEVEL_MANAGEMENT)
103103
list(APPEND WAYLAND_MODULES Quickshell.Wayland._ToplevelManagement)
104104
endif()
105105

106+
if (SCREENCOPY)
107+
add_subdirectory(buffer)
108+
add_subdirectory(screencopy)
109+
list(APPEND WAYLAND_MODULES Quickshell.Wayland._Screencopy)
110+
endif()
111+
112+
106113
if (HYPRLAND)
107114
add_subdirectory(hyprland)
108115
endif()

src/wayland/buffer/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
find_package(PkgConfig REQUIRED)
2+
pkg_check_modules(dmabuf-deps REQUIRED IMPORTED_TARGET libdrm gbm egl)
3+
4+
qt_add_library(quickshell-wayland-buffer STATIC
5+
manager.cpp
6+
dmabuf.cpp
7+
shm.cpp
8+
)
9+
10+
wl_proto(wlp-linux-dmabuf linux-dmabuf-v1 "${WAYLAND_PROTOCOLS}/stable/linux-dmabuf")
11+
12+
target_link_libraries(quickshell-wayland-buffer PRIVATE
13+
Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
14+
PkgConfig::dmabuf-deps
15+
wlp-linux-dmabuf
16+
)
17+
18+
qs_pch(quickshell-wayland-buffer SET large)

0 commit comments

Comments
 (0)