Skip to content
Merged

Glass #1109

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/treeland-archlinux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install graphics and wayland dependencies
run: |
# Core graphics and wayland dependencies (matching qwlroots and waylib builds)
pacman -S --noconfirm --noprogressbar pixman vulkan-headers wayland wayland-protocols wlr-protocols libxcb
pacman -S --noconfirm --noprogressbar pixman vulkan-headers wayland wayland-protocols wlr-protocols libxcb mesa
pacman -S --noconfirm --noprogressbar wlroots0.19 libinput pam systemd-libs jemalloc gcc-libs glibc
- name: Install additional waylib/qwlroots dependencies
Expand Down
2 changes: 2 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Build-Depends: cmake (>= 3.25.0),
libdrm-dev,
pkg-config,
qml6-module-qtquick-templates,
qml6-module-qtquick-effects,
qt6-base-dev (>= 6.8.0),
qt6-base-private-dev (>= 6.8.0),
qt6-base-dev-tools (>= 6.8.0),
Expand Down Expand Up @@ -50,6 +51,7 @@ Section: dde
Architecture: any
Multi-Arch: same
Depends: qml6-module-qtquick-layouts,
qml6-module-qtquick-effects,
qml6-module-qtquick-particles,
treeland-data (= ${source:Version}),
xwayland,
Expand Down
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ add_subdirectory(test_im_candidate_panel_tag)
add_subdirectory(test_im_candidate_panel_xprop)
add_subdirectory(test_input_manager)
add_subdirectory(test_keyboard_state_notify)
add_subdirectory(test_glass)
3 changes: 2 additions & 1 deletion examples/test_capture/capture.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
// SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "capture.h"

#include <private/qguiapplication_p.h>
#include <private/qwaylanddisplay_p.h>
#include <private/qwaylandintegration_p.h>

Check warning on line 8 in examples/test_capture/capture.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <private/qwaylandintegration_p.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QPointer>

Check warning on line 10 in examples/test_capture/capture.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPointer> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <unistd.h>

Check warning on line 11 in examples/test_capture/capture.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <unistd.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

inline QtWaylandClient::QWaylandIntegration *waylandIntegration()
{
Expand Down
99 changes: 99 additions & 0 deletions examples/test_glass/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Copyright (C) 2026 UnionTech Software Technology Co., Ltd.
# SPDX-License-Identifier: Apache-2.0 OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

find_package(Qt6 COMPONENTS Quick QuickControls2 ShaderTools REQUIRED)
qt_standard_project_setup(REQUIRES 6.4)

if(QT_KNOWN_POLICY_QTP0001) # this policy was introduced in Qt 6.5
qt_policy(SET QTP0001 NEW)
# the RESOURCE_PREFIX argument for qt_add_qml_module() defaults to ":/qt/qml/"
endif()
if(POLICY CMP0071)
# https://cmake.org/cmake/help/latest/policy/CMP0071.html
cmake_policy(SET CMP0071 NEW)
endif()

set(QML_IMPORT_PATH "${PROJECT_BINARY_DIR}/src/server;${QML_IMPORT_PATH}" CACHE STRING "For LSP" FORCE)

find_package(PkgConfig REQUIRED)
pkg_search_module(PIXMAN REQUIRED IMPORTED_TARGET pixman-1)
pkg_search_module(WAYLAND REQUIRED IMPORTED_TARGET wayland-server)

set(GLASS_LIQUIDGLASS_SHADER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../misc/shaders")
set(GLASS_EFFECT_QML "${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/qml/Effects/GlassEffect.qml")
set(GLASS_BLUR_QML "${CMAKE_CURRENT_SOURCE_DIR}/../../src/core/qml/Effects/Blur.qml")
set(LOCKSCREEN_ROUNDBLUR_QML "${CMAKE_CURRENT_SOURCE_DIR}/../../src/plugins/lockscreen/qml/RoundBlur.qml")
set_source_files_properties(${GLASS_EFFECT_QML}
PROPERTIES
QT_RESOURCE_ALIAS "GlassEffect.qml"
)
set_source_files_properties(${GLASS_BLUR_QML}
PROPERTIES
QT_RESOURCE_ALIAS "Blur.qml"
)
set_source_files_properties(${LOCKSCREEN_ROUNDBLUR_QML}
PROPERTIES
QT_RESOURCE_ALIAS "RoundBlur.qml"
)

# ── Stub Treeland QML module ─────────────────────────────────────────────
# Provides a minimal Helper singleton with default-valued glass config so
# the upstream Blur.qml / RoundBlur.qml — which read `Helper.config.*` and
# `import Treeland` — work inside the standalone demo without libtreeland.
qt_add_library(treeland_stub SHARED)
qt_add_qml_module(treeland_stub
URI Treeland
VERSION "2.0"
QML_FILES
${GLASS_EFFECT_QML}
${GLASS_BLUR_QML}
${LOCKSCREEN_ROUNDBLUR_QML}
SOURCES
helper.h
helper.cpp
)
qt_add_shaders(treeland_stub "treeland_stub_liquidglass_shaders"
PRECOMPILE
PREFIX
"/shaders"
BASE
${GLASS_LIQUIDGLASS_SHADER_DIR}
FILES
${GLASS_LIQUIDGLASS_SHADER_DIR}/liquidglass.vert
${GLASS_LIQUIDGLASS_SHADER_DIR}/liquidglass.frag
)
target_compile_definitions(treeland_stub PRIVATE WLR_USE_UNSTABLE)
target_link_libraries(treeland_stub PUBLIC
Qt6::Quick
waylibserver
PkgConfig::PIXMAN
PkgConfig::WAYLAND
)

# ── test_glass executable ────────────────────────────────────────────────
add_executable(test_glass
main.cpp
)
qt_add_qml_module(test_glass
URI GlassExample
VERSION "1.0"
QML_FILES
Main.qml
RESOURCES
assets/default-glass-background.jpg
)
target_compile_definitions(test_glass
PRIVATE
SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
$<$<BOOL:${START_DEMO}>:START_DEMO>
WLR_USE_UNSTABLE
)
target_link_libraries(test_glass
PRIVATE
Qt6::Quick
Qt6::QuickControls2
treeland_stub
PkgConfig::PIXMAN
PkgConfig::WAYLAND
)
install(TARGETS test_glass DESTINATION ${CMAKE_INSTALL_BINDIR})
Loading
Loading