mirror of
https://github.com/KDE/krfb
synced 2026-07-02 16:01:17 -07:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef32c9266a | ||
|
|
4019201f13 | ||
|
|
b6cb83d274 | ||
|
|
65490c66a2 | ||
|
|
efc7c65e02 | ||
|
|
fa7bbbc872 | ||
|
|
50a682df39 | ||
|
|
1d5bf08467 | ||
|
|
87efd2b64c | ||
|
|
7a239faa7b | ||
|
|
fbfc193c6d | ||
|
|
39b068b143 | ||
|
|
941ade4b4e | ||
|
|
af461a8bad | ||
|
|
08e2d13758 | ||
|
|
4b7734a726 | ||
|
|
6794b9d9fb | ||
|
|
cf2d198c1f | ||
|
|
7285574c74 | ||
|
|
899bc892c3 | ||
|
|
4815017e04 | ||
|
|
ba8a97b7c8 | ||
|
|
f7b690ea7d | ||
|
|
1d23966d79 | ||
|
|
61d464676c | ||
|
|
775d3c7a97 | ||
|
|
18f98326d4 | ||
|
|
0b65306f15 | ||
|
|
4a2c13135d | ||
|
|
5860226875 | ||
|
|
f30d0b65e3 | ||
|
|
4707bde236 | ||
|
|
608762c7ac | ||
|
|
be01a1e42b | ||
|
|
00c3d1c2ed | ||
|
|
a90970900a | ||
|
|
d1e7614716 | ||
|
|
2127fc927d | ||
|
|
9d5d45c7af | ||
|
|
b4eccc2134 | ||
|
|
97cbf48059 | ||
|
|
c8207581f4 | ||
|
|
4727061d74 | ||
|
|
3bf587a097 | ||
|
|
26c468009f | ||
|
|
fb909eadf4 | ||
|
|
f72674db18 | ||
|
|
df9e6d62d2 | ||
|
|
b55de9645e | ||
|
|
a9241dfe88 | ||
|
|
23c0218f3d | ||
|
|
4a524c6f0a | ||
|
|
cb86f9c018 | ||
|
|
0eaf1bc550 | ||
|
|
cb7164d755 | ||
|
|
75bff9d5f9 | ||
|
|
c729e9e048 | ||
|
|
45548e020a | ||
|
|
dc64af6f5e | ||
|
|
2af26baf56 | ||
|
|
e07f2c1f11 | ||
|
|
e5e2b293e8 | ||
|
|
6cb2b22bf6 | ||
|
|
0316c376f2 | ||
|
|
b8f972d59e | ||
|
|
073cec3dc3 | ||
|
|
58088b6ca0 | ||
|
|
a4cc0e8e7b | ||
|
|
3a1a5ad7a2 | ||
|
|
8e667abe69 | ||
|
|
2e82546012 | ||
|
|
6f342f45ae | ||
|
|
acc70e4cee | ||
|
|
4d84d14070 | ||
|
|
adc8b8069c | ||
|
|
218f0e20f6 | ||
|
|
4f2861415a | ||
|
|
eb1dc503bd | ||
|
|
8f0de62401 | ||
|
|
028ac099ea | ||
|
|
5e18689b8e | ||
|
|
68866dc4fa | ||
|
|
15f5654e5b | ||
|
|
76e36c0761 | ||
|
|
0afcfc82b9 | ||
|
|
730e4d74a8 |
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"phabricator.uri" : "https://phabricator.kde.org/"
|
||||
}
|
||||
26
.gitignore
vendored
Normal file
26
.gitignore
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# Ignore the following files
|
||||
*~
|
||||
*.[oa]
|
||||
*.diff
|
||||
*.kate-swp
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
*.kdevelop.pcs
|
||||
*.moc
|
||||
*.moc.cpp
|
||||
*.orig
|
||||
*.user
|
||||
.*.swp
|
||||
.swp.*
|
||||
Doxyfile
|
||||
Makefile
|
||||
/build*/
|
||||
.cmake/
|
||||
CMakeLists.txt.user*
|
||||
*.unc-backup*
|
||||
.clang-format
|
||||
/compile_commands.json
|
||||
.clangd
|
||||
.cache
|
||||
.idea
|
||||
/cmake-build*
|
||||
6
.gitlab-ci.yml
Normal file
6
.gitlab-ci.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
include:
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
|
||||
21
.kde-ci.yml
Normal file
21
.kde-ci.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
Dependencies:
|
||||
- 'on': ['@all']
|
||||
'require':
|
||||
'frameworks/extra-cmake-modules': '@stable'
|
||||
'frameworks/ki18n': '@stable'
|
||||
'frameworks/kconfig': '@stable'
|
||||
'frameworks/kcoreaddons': '@stable'
|
||||
'frameworks/kcrash': '@stable'
|
||||
'frameworks/kdbusaddons': '@stable'
|
||||
'frameworks/kdnssd': '@stable'
|
||||
'frameworks/kdoctools': '@stable'
|
||||
'frameworks/knotifications': '@stable'
|
||||
'frameworks/kwallet': '@stable'
|
||||
'frameworks/kwidgetsaddons': '@stable'
|
||||
'frameworks/kwindowsystem': '@stable'
|
||||
'frameworks/kxmlgui': '@stable'
|
||||
'frameworks/kwayland': '@stable'
|
||||
'libraries/plasma-wayland-protocols': '@latest' # can be switched to @stable when 1.5.0 is released
|
||||
@@ -1,15 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# KDE Application Version, managed by release script
|
||||
set (RELEASE_SERVICE_VERSION_MAJOR "21")
|
||||
set (RELEASE_SERVICE_VERSION_MINOR "03")
|
||||
set (RELEASE_SERVICE_VERSION_MICRO "70")
|
||||
set (RELEASE_SERVICE_VERSION_MINOR "12")
|
||||
set (RELEASE_SERVICE_VERSION_MICRO "3")
|
||||
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
|
||||
|
||||
project(krfb VERSION ${RELEASE_SERVICE_VERSION})
|
||||
|
||||
set(QT_MIN_VERSION 5.12.0)
|
||||
set(KF5_MIN_VERSION 5.68.0)
|
||||
set(QT_MIN_VERSION 5.15.0)
|
||||
set(KF5_MIN_VERSION 5.85.0)
|
||||
|
||||
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${ECM_MODULE_PATH})
|
||||
@@ -38,6 +38,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
||||
DocTools
|
||||
Notifications
|
||||
Wallet
|
||||
Wayland
|
||||
WidgetsAddons
|
||||
WindowSystem
|
||||
XmlGui
|
||||
@@ -77,12 +78,43 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
|
||||
|
||||
find_package(LibVNCServer REQUIRED)
|
||||
|
||||
find_package(PipeWire)
|
||||
set_package_properties(PipeWire PROPERTIES
|
||||
|
||||
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
|
||||
add_feature_info(PipeWire PipeWire_FOUND "Required for pipewire screencast plugin")
|
||||
find_package(PlasmaWaylandProtocols 1.5.0)
|
||||
|
||||
if(PipeWire_FOUND AND PlasmaWaylandProtocols_FOUND)
|
||||
find_package(QtWaylandScanner REQUIRED)
|
||||
find_package(Qt5WaylandClient)
|
||||
find_package(Qt5XkbCommonSupport)
|
||||
find_package(Wayland REQUIRED COMPONENTS Client)
|
||||
endif()
|
||||
|
||||
find_package(gbm)
|
||||
set_package_properties(gbm PROPERTIES
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required for pipewire screencast plugin"
|
||||
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
|
||||
)
|
||||
|
||||
find_package(EGL)
|
||||
set_package_properties(EGL PROPERTIES
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
|
||||
)
|
||||
|
||||
find_package(epoxy)
|
||||
set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy"
|
||||
URL "https://github.com/anholt/libepoxy"
|
||||
TYPE OPTIONAL
|
||||
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
|
||||
)
|
||||
|
||||
if(EGL_FOUND AND gbm_FOUND AND epoxy_FOUND)
|
||||
set (HAVE_DMA_BUF TRUE)
|
||||
else()
|
||||
set (HAVE_DMA_BUF FALSE)
|
||||
endif()
|
||||
|
||||
ecm_setup_version(PROJECT
|
||||
VARIABLE_PREFIX KRFB
|
||||
VERSION_HEADER "krfb_version.h")
|
||||
|
||||
128
CMakePresets.json
Normal file
128
CMakePresets.json
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"version": 2,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "dev",
|
||||
"displayName": "Build as debug",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"displayName": "Build with Asan support.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-asan",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dev-clang",
|
||||
"displayName": "dev-clang",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-clang",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
},
|
||||
"environment": {
|
||||
"CXX": "clang++",
|
||||
"CCACHE_DISABLE": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "unity",
|
||||
"displayName": "Build with CMake unity support.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-unity",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"CMAKE_UNITY_BUILD": "ON",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Build as release mode.",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-release",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "profile",
|
||||
"displayName": "profile",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-profile",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "clazy",
|
||||
"displayName": "clazy",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-clazy",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
},
|
||||
"environment": {
|
||||
"CXX": "clazy",
|
||||
"CCACHE_DISABLE": "ON"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "dev",
|
||||
"configurePreset": "dev"
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"configurePreset": "release"
|
||||
},
|
||||
{
|
||||
"name": "dev-clang",
|
||||
"configurePreset": "dev-clang"
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"configurePreset": "asan"
|
||||
},
|
||||
{
|
||||
"name": "unity",
|
||||
"configurePreset": "unity"
|
||||
},
|
||||
{
|
||||
"name": "clazy",
|
||||
"configurePreset": "clazy",
|
||||
"environment": {
|
||||
"CLAZY_CHECKS" : "level0,level1,detaching-member,ifndef-define-typo,isempty-vs-count,qrequiredresult-candidates,reserve-candidates,signal-with-return-value,unneeded-cast,function-args-by-ref,function-args-by-value,returning-void-expression,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch,old-style-connect,qstring-allocations,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,qstring-varargs,level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
|
||||
"CCACHE_DISABLE" : "ON"
|
||||
}
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
{
|
||||
"name": "dev",
|
||||
"configurePreset": "dev",
|
||||
"output": {"outputOnFailure": true},
|
||||
"execution": {"noTestsAction": "error", "stopOnFailure": false}
|
||||
},
|
||||
{
|
||||
"name": "asan",
|
||||
"configurePreset": "asan",
|
||||
"output": {"outputOnFailure": true},
|
||||
"execution": {"noTestsAction": "error", "stopOnFailure": true}
|
||||
}
|
||||
]
|
||||
}
|
||||
2
CMakePresets.json.license
Normal file
2
CMakePresets.json.license
Normal file
@@ -0,0 +1,2 @@
|
||||
# SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
@@ -1,122 +0,0 @@
|
||||
#.rst:
|
||||
# FindPipeWire
|
||||
# -------
|
||||
#
|
||||
# Try to find PipeWire on a Unix system.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``PipeWire_FOUND``
|
||||
# True if (the requested version of) PipeWire is available
|
||||
# ``PipeWire_VERSION``
|
||||
# The version of PipeWire
|
||||
# ``PipeWire_LIBRARIES``
|
||||
# This can be passed to target_link_libraries() instead of the ``PipeWire::PipeWire``
|
||||
# target
|
||||
# ``PipeWire_INCLUDE_DIRS``
|
||||
# This should be passed to target_include_directories() if the target is not
|
||||
# used for linking
|
||||
# ``PipeWire_DEFINITIONS``
|
||||
# This should be passed to target_compile_options() if the target is not
|
||||
# used for linking
|
||||
#
|
||||
# If ``PipeWire_FOUND`` is TRUE, it will also define the following imported target:
|
||||
#
|
||||
# ``PipeWire::PipeWire``
|
||||
# The PipeWire library
|
||||
#
|
||||
# In general we recommend using the imported target, as it is easier to use.
|
||||
# Bear in mind, however, that if the target is in the link interface of an
|
||||
# exported library, it must be made available by the package config file.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||
# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
# Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_search_module(PKG_PipeWire QUIET libpipewire-0.3 libpipewire-0.2)
|
||||
pkg_search_module(PKG_Spa QUIET libspa-0.2 libspa-0.1)
|
||||
|
||||
set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS}" "${PKG_Spa_CFLAGS}")
|
||||
set(PipeWire_VERSION "${PKG_PipeWire_VERSION}")
|
||||
|
||||
find_path(PipeWire_INCLUDE_DIRS
|
||||
NAMES
|
||||
pipewire/pipewire.h
|
||||
HINTS
|
||||
${PKG_PipeWire_INCLUDE_DIRS}
|
||||
${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3
|
||||
)
|
||||
|
||||
find_path(Spa_INCLUDE_DIRS
|
||||
NAMES
|
||||
spa/param/props.h
|
||||
HINTS
|
||||
${PKG_Spa_INCLUDE_DIRS}
|
||||
${PKG_Spa_INCLUDE_DIRS}/spa-0.2
|
||||
)
|
||||
|
||||
find_library(PipeWire_LIBRARIES
|
||||
NAMES
|
||||
pipewire-0.3
|
||||
pipewire-0.2
|
||||
HINTS
|
||||
${PKG_PipeWire_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PipeWire
|
||||
FOUND_VAR
|
||||
PipeWire_FOUND
|
||||
REQUIRED_VARS
|
||||
PipeWire_LIBRARIES
|
||||
PipeWire_INCLUDE_DIRS
|
||||
Spa_INCLUDE_DIRS
|
||||
VERSION_VAR
|
||||
PipeWire_VERSION
|
||||
)
|
||||
|
||||
if(PipeWire_FOUND AND NOT TARGET PipeWire::PipeWire)
|
||||
add_library(PipeWire::PipeWire UNKNOWN IMPORTED)
|
||||
set_target_properties(PipeWire::PipeWire PROPERTIES
|
||||
IMPORTED_LOCATION "${PipeWire_LIBRARIES}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS};${Spa_INCLUDE_DIRS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(PipeWire PROPERTIES
|
||||
URL "https://www.pipewire.org"
|
||||
DESCRIPTION "PipeWire - multimedia processing"
|
||||
)
|
||||
104
cmake/modules/Findgbm.cmake
Normal file
104
cmake/modules/Findgbm.cmake
Normal file
@@ -0,0 +1,104 @@
|
||||
#.rst:
|
||||
# Findgbm
|
||||
# -------
|
||||
#
|
||||
# Try to find gbm on a Unix system.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``gbm_FOUND``
|
||||
# True if (the requested version of) gbm is available
|
||||
# ``gbm_VERSION``
|
||||
# The version of gbm
|
||||
# ``gbm_LIBRARIES``
|
||||
# This can be passed to target_link_libraries() instead of the ``gbm::gbm``
|
||||
# target
|
||||
# ``gbm_INCLUDE_DIRS``
|
||||
# This should be passed to target_include_directories() if the target is not
|
||||
# used for linking
|
||||
# ``gbm_DEFINITIONS``
|
||||
# This should be passed to target_compile_options() if the target is not
|
||||
# used for linking
|
||||
#
|
||||
# If ``gbm_FOUND`` is TRUE, it will also define the following imported target:
|
||||
#
|
||||
# ``gbm::gbm``
|
||||
# The gbm library
|
||||
#
|
||||
# In general we recommend using the imported target, as it is easier to use.
|
||||
# Bear in mind, however, that if the target is in the link interface of an
|
||||
# exported library, it must be made available by the package config file.
|
||||
|
||||
#=============================================================================
|
||||
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
|
||||
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#=============================================================================
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
||||
message(FATAL_ERROR "CMake 2.8.12 is required by Findgbm.cmake")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake")
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PKG_gbm QUIET gbm)
|
||||
|
||||
set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER})
|
||||
set(gbm_VERSION ${PKG_gbm_VERSION})
|
||||
|
||||
find_path(gbm_INCLUDE_DIR
|
||||
NAMES
|
||||
gbm.h
|
||||
HINTS
|
||||
${PKG_gbm_INCLUDE_DIRS}
|
||||
)
|
||||
find_library(gbm_LIBRARY
|
||||
NAMES
|
||||
gbm
|
||||
HINTS
|
||||
${PKG_gbm_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(gbm
|
||||
FOUND_VAR
|
||||
gbm_FOUND
|
||||
REQUIRED_VARS
|
||||
gbm_LIBRARY
|
||||
gbm_INCLUDE_DIR
|
||||
VERSION_VAR
|
||||
gbm_VERSION
|
||||
)
|
||||
|
||||
if(gbm_FOUND AND NOT TARGET gbm::gbm)
|
||||
add_library(gbm::gbm UNKNOWN IMPORTED)
|
||||
set_target_properties(gbm::gbm PROPERTIES
|
||||
IMPORTED_LOCATION "${gbm_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${gbm_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${gbm_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(gbm_LIBRARY gbm_INCLUDE_DIR)
|
||||
|
||||
# compatibility variables
|
||||
set(gbm_LIBRARIES ${gbm_LIBRARY})
|
||||
set(gbm_INCLUDE_DIRS ${gbm_INCLUDE_DIR})
|
||||
set(gbm_VERSION_STRING ${gbm_VERSION})
|
||||
|
||||
else()
|
||||
message(STATUS "Findgbm.cmake cannot find gbm on Windows systems.")
|
||||
set(gbm_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(gbm PROPERTIES
|
||||
URL "https://www.mesa3d.org"
|
||||
DESCRIPTION "Mesa gbm library."
|
||||
)
|
||||
@@ -15,4 +15,4 @@ target_link_libraries (krfb_events_x11
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
install (TARGETS krfb_events_x11 DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb)
|
||||
install (TARGETS krfb_events_x11 DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events)
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Comment=X11 XFakeInput based event handler for KRfb
|
||||
Comment[ca]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
|
||||
Comment[ca@valencia]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
|
||||
Comment[da]=X11 XFakeInput baseret hændelseshåndtering til KRfb
|
||||
Comment[de]=Ereignis-Modul basierend auf X11 XFakeInput für KRfb
|
||||
Comment[el]=Χειριστής γεγονότων με βάση το X11 XFakeInput για το KRfb
|
||||
Comment[en_GB]=X11 XFakeInput based event handler for KRfb
|
||||
Comment[es]=Gestor de eventos basado en XFakeInput de X11 para KRfb
|
||||
Comment[et]=KRfb X11 XFakeInput'i põhine sündmuste käitleja
|
||||
Comment[eu]=KRfb-rako «X11 XFakeInput»en oinarritutako gertaera maneiatzailea
|
||||
Comment[fi]=KRfb:n X11 XFakeInput -pohjainen tapahtumakäsittelijä
|
||||
Comment[fr]=Gestionnaire d'évènements utilisant XFakeInput de X11 pour KRfb
|
||||
Comment[gl]=Xestor de eventos para KRfb baseado no XFakeInput de X11
|
||||
Comment[ia]=Maneator de evento de X11 basate sur XFakeInput per KRfb
|
||||
Comment[it]=Gestore eventi basato su XFakeInput di X11 per KRfb
|
||||
Comment[ko]=X11 XFakeInput 기반 KRfb 이벤트 핸들러
|
||||
Comment[nl]=Op X11 XFakeInput gebaseerde behandelaar van gebeurtenis voor KRfb
|
||||
Comment[nn]=X11 XFakeInput-basert hendingshandtering for KRfb
|
||||
Comment[pl]=Obsługa wydarzeń X11 oparta na XFakeInput dla KRfb
|
||||
Comment[pt]=Tratamento de eventos baseado no XFakeInput do X11 para o KRfb
|
||||
Comment[pt_BR]=Manipulador de eventos baseado no XFakeInput do X11 para o KRfb
|
||||
Comment[sk]=X11 Spracovateľ udalostí založený na XFakeInput pre KRfb
|
||||
Comment[sl]=Upravljalnik dogodkov za KRfb na podlagi X11 XFakeInput
|
||||
Comment[sv]=Händelsehanterare för Krfb baserad på X11 XFakeInput
|
||||
Comment[uk]=Обробник подій для KRfb на основі XFakeInput X11
|
||||
Comment[x-test]=xxX11 XFakeInput based event handler for KRfbxx
|
||||
Comment[zh_CN]=基于 X11 XFakeInput 的 KRfb 事件处理器
|
||||
Comment[zh_TW]=KRfb 基於 X11 XFakeInput 的事件處理器
|
||||
Name=X11 XFakeInput based event handler for KRfb
|
||||
Name[ca]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
|
||||
Name[ca@valencia]=Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb
|
||||
Name[da]=X11 XFakeInput baseret hændelseshåndtering til KRfb
|
||||
Name[de]=Ereignis-Modul basierend auf X11 XFakeInput für KRfb
|
||||
Name[el]=Χειριστής γεγονότων με βάση το X11 XFakeInput για το KRfb
|
||||
Name[en_GB]=X11 XFakeInput based event handler for KRfb
|
||||
Name[es]=Gestor de eventos basado en XFakeInput de X11 para KRfb
|
||||
Name[et]=KRfb X11 XFakeInput'i põhine sündmuste käitleja
|
||||
Name[eu]=KRfb-rako «X11 XFakeInput»en oinarritutako gertaera maneiatzailea
|
||||
Name[fi]=KRfb:n X11 XFakeInput -pohjainen tapahtumakäsittelijä
|
||||
Name[fr]=Gestionnaire d'évènements utilisant XFakeInput de X11 pour KRfb
|
||||
Name[gl]=Xestor de eventos para KRfb baseado no XFakeInput de X11
|
||||
Name[ia]=Maneator de evento de X11 basate sur XFakeInput per KRfb
|
||||
Name[it]=Gestore eventi basato su XFakeInput di X11 per KRfb
|
||||
Name[ko]=X11 XFakeInput 기반 KRfb 이벤트 핸들러
|
||||
Name[nl]=Op X11 XFakeInput gebaseerde behandelaar van gebeurtenis voor KRfb
|
||||
Name[nn]=X11 XFakeInput-basert hendingshandtering for KRfb
|
||||
Name[pl]=Obsługa wydarzeń X11 oparta na XFakeInput dla KRfb
|
||||
Name[pt]=Tratamento de eventos baseado no XFakeInput do X11 para o KRfb
|
||||
Name[pt_BR]=Manipulador de eventos baseado no XFakeInput do X11 para o KRfb
|
||||
Name[sk]=X11 Spracovateľ udalostí založený na XFakeInput pre KRfb
|
||||
Name[sl]=Upravljalnik dogodkov za KRfb na podlagi X11 XFakeInput
|
||||
Name[sv]=Händelsehanterare för Krfb baserad på X11 XFakeInput
|
||||
Name[uk]=Обробник подій для KRfb на основі XFakeInput X11
|
||||
Name[x-test]=xxX11 XFakeInput based event handler for KRfbxx
|
||||
Name[zh_CN]=基于 X11 XFakeInput 的 KRfb 事件处理器
|
||||
Name[zh_TW]=KRfb 基於 X11 XFakeInput 的事件處理器
|
||||
Type=Service
|
||||
ServiceTypes=krfb/events
|
||||
|
||||
X-KDE-Library=krfb_events_x11
|
||||
X-KDE-PluginInfo-Name=x11
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=https://www.kde.org
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
@@ -60,9 +60,6 @@
|
||||
"Name[x-test]": "xxX11 Event handler for KRfbxx",
|
||||
"Name[zh_CN]": "X11 KRfb 事件处理器",
|
||||
"Name[zh_TW]": "KRfb 的 X11 事件處理器",
|
||||
"ServiceTypes": [
|
||||
"krfb/events"
|
||||
],
|
||||
"Version": "0.1",
|
||||
"Website": "http://www.kde.org"
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class X11EventsPlugin : public EventsPlugin
|
||||
Q_OBJECT
|
||||
public:
|
||||
X11EventsPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~X11EventsPlugin() = default;
|
||||
~X11EventsPlugin() override = default;
|
||||
|
||||
EventHandler *eventHandler() override;
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ target_link_libraries (krfb_events_xdp
|
||||
)
|
||||
|
||||
install (TARGETS krfb_events_xdp
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events
|
||||
)
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Comment=Xdg-desktop-portal based event handler for KRfb
|
||||
Comment[ca]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
|
||||
Comment[ca@valencia]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
|
||||
Comment[da]=Xdg-desktop-portal baseret hændelseshåndtering til KRfb
|
||||
Comment[de]=Ereignis-Modul basierend auf Xdg-desktop-portal für KRfb
|
||||
Comment[el]=Χειριστής γεγονότων με βάση το xdg-desktop-portal για το KRfb
|
||||
Comment[en_GB]=Xdg-desktop-portal based event handler for KRfb
|
||||
Comment[es]=Gestor de eventos basado en Xdg-desktop-portal para KRfb
|
||||
Comment[et]=KRfb Xdg-desktop-portal'i põhine sündmuste käitleja
|
||||
Comment[eu]=KRfb-rako «xdg-desktop-portal»en oinarritutako maneiatzailea
|
||||
Comment[fi]=KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä
|
||||
Comment[fr]=Gestionnaire d'évènements utilisant Xdg-desktop-portal pour KRfb
|
||||
Comment[gl]=Xestor de eventos para KRfb baseado en Xdg-desktop-portal
|
||||
Comment[ia]=Maneator de evento basate sur Xdg-desktop-portal per KRfb
|
||||
Comment[it]=Gestore eventi basato su xdg-desktop-portal per KRfb
|
||||
Comment[ko]=Xdg-desktop-portal 기반 KRfb 이벤트 핸들러
|
||||
Comment[nl]=Op Xdg-desktop-portal gebaseerde behandelaar van gebeurtenis voor KRfb
|
||||
Comment[nn]=Xdg-desktop-portal-basert hendingshandtering for KRfb
|
||||
Comment[pl]=Obsługa wydarzeń oparta na Xdg-desktop-portal dla KRfb
|
||||
Comment[pt]=Tratamento de eventos baseado no Xdg-desktop-portal para o KRfb
|
||||
Comment[pt_BR]=Manipulador de eventos baseado no xdg-desktop-portal para o KRfb
|
||||
Comment[sk]=Obsluha udalostí založená na Xdg-desktop-portal pre KRfb
|
||||
Comment[sl]=Upravljalnik dogodkov za KRfb na podlagi namiznega portala Xdg
|
||||
Comment[sv]=Händelsehanterare för Krfb baserad på xdg-desktop-portal
|
||||
Comment[uk]=Обробник подій для KRfb на основі Xdg-desktop-portal
|
||||
Comment[x-test]=xxXdg-desktop-portal based event handler for KRfbxx
|
||||
Comment[zh_CN]=基于 xdg-desktop-portal 的 KRfb 事件处理器
|
||||
Comment[zh_TW]=KRfb 基於 Xdg-desktop-portal 的事件處理器
|
||||
Name=Xdg-desktop-portal based event handler for KRfb
|
||||
Name[ca]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
|
||||
Name[ca@valencia]=Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb
|
||||
Name[da]=Xdg-desktop-portal baseret hændelseshåndtering til KRfb
|
||||
Name[de]=Ereignis-Modul basierend auf Xdg-desktop-portal für KRfb
|
||||
Name[el]=Χειριστής γεγονότων με βάση το xdg-desktop-portal για το KRfb
|
||||
Name[en_GB]=Xdg-desktop-portal based event handler for KRfb
|
||||
Name[es]=Gestor de eventos basado en Xdg-desktop-portal para KRfb
|
||||
Name[et]=KRfb Xdg-desktop-portal'i põhine sündmuste käitleja
|
||||
Name[eu]=KRfb-rako «xdg-desktop-portal»en oinarritutako maneiatzailea
|
||||
Name[fi]=KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä
|
||||
Name[fr]=Gestionnaire d'évènements utilisant Xdg-desktop-portal pour KRfb
|
||||
Name[gl]=Xestor de eventos para KRfb baseado en Xdg-desktop-portal
|
||||
Name[ia]=Mneator de evento basate sur Xdg-desktop-portal per KRfb
|
||||
Name[it]=Gestore eventi basato su xdg-desktop-portal per KRfb
|
||||
Name[ko]=Xdg-desktop-portal 기반 KRfb 이벤트 핸들러
|
||||
Name[nl]=Op Xdg-desktop-portal gebaseerde behandelaar van gebeurtenis voor KRfb
|
||||
Name[nn]=Xdg-desktop-portal-basert hendingshandtering for KRfb
|
||||
Name[pl]=Obsługa wydarzeń oparta na Xdg-desktop-portal dla KRfb
|
||||
Name[pt]=Tratamento de eventos baseado no Xdg-desktop-portal para o KRfb
|
||||
Name[pt_BR]=Manipulador de eventos baseado no xdg-desktop-portal para o KRfb
|
||||
Name[sk]=Obsluha udalostí založená na Xdg-desktop-portal pre KRfb
|
||||
Name[sl]=Upravljalnik dogodkov za KRfb na podlagi namiznega portala Xdg
|
||||
Name[sv]=Händelsehanterare för Krfb baserad på xdg-desktop-portal
|
||||
Name[uk]=Обробник подій для KRfb на основі Xdg-desktop-portal
|
||||
Name[x-test]=xxXdg-desktop-portal based event handler for KRfbxx
|
||||
Name[zh_CN]=基于 xdg-desktop-portal 的 KRfb 事件处理器
|
||||
Name[zh_TW]=KRfb 基於 Xdg-desktop-portal 的事件處理器
|
||||
Type=Service
|
||||
ServiceTypes=krfb/events
|
||||
|
||||
X-KDE-Library=krfb_events_xdp
|
||||
X-KDE-PluginInfo-Name=xdp
|
||||
X-KDE-PluginInfo-Version=0.1
|
||||
X-KDE-PluginInfo-Website=https://www.kde.org
|
||||
X-KDE-PluginInfo-License=GPL
|
||||
X-KDE-PluginInfo-EnabledByDefault=true
|
||||
|
||||
@@ -60,9 +60,6 @@
|
||||
"Name[x-test]": "xxXdg-desktop-portal Event handler for KRfbxx",
|
||||
"Name[zh_CN]": "xdg-desktop-portal KRfb 事件处理器",
|
||||
"Name[zh_TW]": "KRfb 的 Xdg-desktop-portal 事件處理器",
|
||||
"ServiceTypes": [
|
||||
"krfb/events"
|
||||
],
|
||||
"Version": "0.1",
|
||||
"Website": "http://www.kde.org"
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class XdpEventsPlugin : public EventsPlugin
|
||||
Q_OBJECT
|
||||
public:
|
||||
XdpEventsPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~XdpEventsPlugin() = default;
|
||||
~XdpEventsPlugin() override = default;
|
||||
|
||||
EventHandler *eventHandler() override;
|
||||
|
||||
|
||||
@@ -5,8 +5,14 @@ include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||
set (krfb_framebuffer_pw_SRCS
|
||||
pw_framebuffer.cpp
|
||||
pw_framebufferplugin.cpp
|
||||
|
||||
screencasting.cpp
|
||||
)
|
||||
|
||||
ecm_add_qtwayland_client_protocol(krfb_framebuffer_pw_SRCS
|
||||
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/screencast.xml
|
||||
BASENAME zkde-screencast-unstable-v1
|
||||
)
|
||||
|
||||
ecm_qt_declare_logging_category(krfb_framebuffer_pw_SRCS
|
||||
HEADER krfb_fb_pipewire_debug.h
|
||||
@@ -32,22 +38,26 @@ add_library(krfb_framebuffer_pw
|
||||
MODULE
|
||||
${krfb_framebuffer_pw_SRCS}
|
||||
)
|
||||
set_property(TARGET krfb_framebuffer_pw PROPERTY C_STANDARD 99)
|
||||
|
||||
|
||||
check_include_file("linux/dma-buf.h" HAVE_LINUX_DMABUF_H)
|
||||
if (HAVE_LINUX_DMABUF_H)
|
||||
target_compile_definitions(krfb_framebuffer_pw PRIVATE -DHAVE_LINUX_DMABUF_H)
|
||||
endif ()
|
||||
|
||||
target_link_libraries (krfb_framebuffer_pw
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::DBus
|
||||
KF5::CoreAddons
|
||||
krfbprivate
|
||||
PipeWire::PipeWire
|
||||
target_link_libraries(krfb_framebuffer_pw
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::DBus
|
||||
KF5::CoreAddons
|
||||
KF5::WaylandClient
|
||||
Wayland::Client
|
||||
krfbprivate
|
||||
PkgConfig::PipeWire
|
||||
)
|
||||
|
||||
if (HAVE_DMA_BUF)
|
||||
target_link_libraries(krfb_framebuffer_pw
|
||||
${epoxy_LIBRARIES}
|
||||
gbm::gbm
|
||||
)
|
||||
endif()
|
||||
|
||||
install (TARGETS krfb_framebuffer_pw
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||
)
|
||||
|
||||
@@ -64,9 +64,6 @@
|
||||
"Name[x-test]": "xxPipeWire Framebuffer for KRfbxx",
|
||||
"Name[zh_CN]": "KRfb 的 PipeWire 帧缓冲机制",
|
||||
"Name[zh_TW]": "KRfb 的 PipeWire Framebuffer",
|
||||
"ServiceTypes": [
|
||||
"krfb/framebuffer"
|
||||
],
|
||||
"Version": "0.1",
|
||||
"Website": "http://www.kde.org"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,15 +24,18 @@ class PWFrameBuffer: public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef struct {
|
||||
using Stream = struct {
|
||||
uint nodeId;
|
||||
QVariantMap map;
|
||||
} Stream;
|
||||
typedef QList<Stream> Streams;
|
||||
};
|
||||
using Streams = QList<Stream>;
|
||||
|
||||
PWFrameBuffer(WId winid, QObject *parent = nullptr);
|
||||
virtual ~PWFrameBuffer() override;
|
||||
|
||||
void initDBus();
|
||||
void startVirtualMonitor(const QString &name, const QSize &resolution, qreal dpr);
|
||||
|
||||
int depth() override;
|
||||
int height() override;
|
||||
int width() override;
|
||||
@@ -40,6 +43,7 @@ public:
|
||||
void getServerFormat(rfbPixelFormat &format) override;
|
||||
void startMonitor() override;
|
||||
void stopMonitor() override;
|
||||
QPoint cursorPosition() override;
|
||||
|
||||
QVariant customProperty(const QString &property) const override;
|
||||
|
||||
|
||||
@@ -36,10 +36,18 @@ PWFrameBufferPlugin::~PWFrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id)
|
||||
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
//NOTE WId is irrelevant in Wayland
|
||||
|
||||
auto pwfb = new PWFrameBuffer(id);
|
||||
if (args.contains(QLatin1String("name"))) {
|
||||
pwfb->startVirtualMonitor(args[QStringLiteral("name")].toString(), args[QStringLiteral("resolution")].toSize(), args[QStringLiteral("scale")].toDouble());
|
||||
} else {
|
||||
// D-Bus is most important in XDG-Desktop-Portals init chain, no toys for us if something is wrong with XDP
|
||||
// PipeWire connectivity is initialized after D-Bus session is started
|
||||
pwfb->initDBus();
|
||||
}
|
||||
|
||||
// sanity check for dbus/wayland/pipewire errors
|
||||
if (!pwfb->isValid()) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
PWFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~PWFrameBufferPlugin() override;
|
||||
|
||||
FrameBuffer *frameBuffer(WId id) override;
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(PWFrameBufferPlugin)
|
||||
|
||||
136
framebuffers/pipewire/screencasting.cpp
Normal file
136
framebuffers/pipewire/screencasting.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
#include "screencasting.h"
|
||||
#include "qwayland-zkde-screencast-unstable-v1.h"
|
||||
#include <KWayland/Client/output.h>
|
||||
#include <KWayland/Client/plasmawindowmanagement.h>
|
||||
#include <KWayland/Client/registry.h>
|
||||
#include <QDebug>
|
||||
#include <QRect>
|
||||
|
||||
using namespace KWayland::Client;
|
||||
|
||||
class ScreencastingStreamPrivate : public QtWayland::zkde_screencast_stream_unstable_v1
|
||||
{
|
||||
public:
|
||||
ScreencastingStreamPrivate(ScreencastingStream *q)
|
||||
: q(q)
|
||||
{
|
||||
}
|
||||
~ScreencastingStreamPrivate()
|
||||
{
|
||||
close();
|
||||
q->deleteLater();
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_created(uint32_t node) override
|
||||
{
|
||||
m_nodeId = node;
|
||||
Q_EMIT q->created(node);
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_closed() override
|
||||
{
|
||||
Q_EMIT q->closed();
|
||||
}
|
||||
|
||||
void zkde_screencast_stream_unstable_v1_failed(const QString &error) override
|
||||
{
|
||||
Q_EMIT q->failed(error);
|
||||
}
|
||||
|
||||
uint m_nodeId = 0;
|
||||
QPointer<ScreencastingStream> q;
|
||||
};
|
||||
|
||||
ScreencastingStream::ScreencastingStream(QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ScreencastingStreamPrivate(this))
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingStream::~ScreencastingStream() = default;
|
||||
|
||||
quint32 ScreencastingStream::nodeId() const
|
||||
{
|
||||
return d->m_nodeId;
|
||||
}
|
||||
|
||||
class ScreencastingPrivate : public QtWayland::zkde_screencast_unstable_v1
|
||||
{
|
||||
public:
|
||||
ScreencastingPrivate(Registry *registry, int id, int version, Screencasting *q)
|
||||
: QtWayland::zkde_screencast_unstable_v1(*registry, id, version)
|
||||
, q(q)
|
||||
{
|
||||
}
|
||||
|
||||
ScreencastingPrivate(::zkde_screencast_unstable_v1 *screencasting, Screencasting *q)
|
||||
: QtWayland::zkde_screencast_unstable_v1(screencasting)
|
||||
, q(q)
|
||||
{
|
||||
}
|
||||
|
||||
~ScreencastingPrivate()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
Screencasting *const q;
|
||||
};
|
||||
|
||||
Screencasting::Screencasting(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
Screencasting::Screencasting(Registry *registry, int id, int version, QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(new ScreencastingPrivate(registry, id, version, this))
|
||||
{
|
||||
}
|
||||
|
||||
Screencasting::~Screencasting() = default;
|
||||
|
||||
ScreencastingStream *Screencasting::createOutputStream(Output *output, CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->setObjectName(output->model());
|
||||
stream->d->init(d->stream_output(*output, mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
ScreencastingStream *Screencasting::createWindowStream(PlasmaWindow *window, CursorMode mode)
|
||||
{
|
||||
auto stream = createWindowStream(QString::fromUtf8(window->uuid()), mode);
|
||||
stream->setObjectName(window->appId());
|
||||
return stream;
|
||||
}
|
||||
|
||||
ScreencastingStream *Screencasting::createWindowStream(const QString &uuid, CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->d->init(d->stream_window(uuid, mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
ScreencastingStream * Screencasting::createVirtualMonitorStream(const QString& name, const QSize& resolution, qreal dpr, Screencasting::CursorMode mode)
|
||||
{
|
||||
auto stream = new ScreencastingStream(this);
|
||||
stream->d->init(d->stream_virtual_output(name, resolution.width(), resolution.height(), wl_fixed_from_double(dpr), mode));
|
||||
return stream;
|
||||
}
|
||||
|
||||
void Screencasting::setup(::zkde_screencast_unstable_v1 *screencasting)
|
||||
{
|
||||
d.reset(new ScreencastingPrivate(screencasting, this));
|
||||
}
|
||||
|
||||
void Screencasting::destroy()
|
||||
{
|
||||
d.reset(nullptr);
|
||||
}
|
||||
78
framebuffers/pipewire/screencasting.h
Normal file
78
framebuffers/pipewire/screencasting.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <QVector>
|
||||
#include <optional>
|
||||
|
||||
struct zkde_screencast_unstable_v1;
|
||||
|
||||
namespace KWayland
|
||||
{
|
||||
namespace Client
|
||||
{
|
||||
class PlasmaWindow;
|
||||
class Registry;
|
||||
class Output;
|
||||
}
|
||||
}
|
||||
|
||||
class ScreencastingPrivate;
|
||||
class ScreencastingSourcePrivate;
|
||||
class ScreencastingStreamPrivate;
|
||||
class ScreencastingStream : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScreencastingStream(QObject *parent);
|
||||
~ScreencastingStream() override;
|
||||
|
||||
quint32 nodeId() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void created(quint32 nodeid);
|
||||
void failed(const QString &error);
|
||||
void closed();
|
||||
|
||||
private:
|
||||
friend class Screencasting;
|
||||
QScopedPointer<ScreencastingStreamPrivate> d;
|
||||
};
|
||||
|
||||
class Screencasting : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Screencasting(QObject *parent = nullptr);
|
||||
explicit Screencasting(KWayland::Client::Registry *registry, int id, int version, QObject *parent = nullptr);
|
||||
~Screencasting() override;
|
||||
|
||||
enum CursorMode {
|
||||
Hidden = 1,
|
||||
Embedded = 2,
|
||||
Metadata = 4,
|
||||
};
|
||||
Q_ENUM(CursorMode);
|
||||
|
||||
ScreencastingStream *createOutputStream(KWayland::Client::Output *output, CursorMode mode);
|
||||
ScreencastingStream *createWindowStream(KWayland::Client::PlasmaWindow *window, CursorMode mode);
|
||||
ScreencastingStream *createWindowStream(const QString &uuid, CursorMode mode);
|
||||
ScreencastingStream *createVirtualMonitorStream(const QString &name, const QSize &resolution, qreal dpr, CursorMode mode);
|
||||
|
||||
void setup(zkde_screencast_unstable_v1 *screencasting);
|
||||
void destroy();
|
||||
|
||||
Q_SIGNALS:
|
||||
void initialized();
|
||||
void removed();
|
||||
void sourcesChanged();
|
||||
|
||||
private:
|
||||
QScopedPointer<ScreencastingPrivate> d;
|
||||
};
|
||||
@@ -28,5 +28,5 @@ target_link_libraries (krfb_framebuffer_qt
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_qt
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||
)
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"Id": "qt",
|
||||
"License": "GPL",
|
||||
"Name": "Qt Framebuffer for KRfb",
|
||||
"Name[ca@valencia]": "«Framebuffer» de les Qt per al KRfb.",
|
||||
"Name[ca]": "«Framebuffer» de les Qt per al KRfb.",
|
||||
"Name[ca@valencia]": "«Framebuffer» de les Qt per al KRfb",
|
||||
"Name[ca]": "«Framebuffer» de les Qt per al KRfb",
|
||||
"Name[cs]": "Qt Framebuffer pro KRfb",
|
||||
"Name[da]": "Qt-framebuffer til KRfb",
|
||||
"Name[de]": "Qt-Framebuffer für KRfb",
|
||||
@@ -75,9 +75,6 @@
|
||||
"Name[x-test]": "xxQt Framebuffer for KRfbxx",
|
||||
"Name[zh_CN]": "KRfb 的 Qt 帧缓冲",
|
||||
"Name[zh_TW]": "Krfb 的 Qt Framebuffer",
|
||||
"ServiceTypes": [
|
||||
"krfb/framebuffer"
|
||||
],
|
||||
"Version": "0.1",
|
||||
"Website": "https://www.kde.org"
|
||||
}
|
||||
|
||||
@@ -26,11 +26,7 @@ QtFrameBuffer::QtFrameBuffer(WId id, QObject *parent)
|
||||
if (screen) {
|
||||
primaryScreen = screen;
|
||||
fbImage = screen->grabWindow(win).toImage();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
fb = new char[fbImage.sizeInBytes()];
|
||||
#else
|
||||
fb = new char[fbImage.byteCount()];
|
||||
#endif
|
||||
} else {
|
||||
fb = nullptr;
|
||||
primaryScreen = nullptr;
|
||||
@@ -108,11 +104,7 @@ void QtFrameBuffer::updateFrameBuffer()
|
||||
tiles.append(img.rect());
|
||||
#endif
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
memcpy(fb, img.bits(), static_cast<size_t>(img.sizeInBytes()));
|
||||
#else
|
||||
memcpy(fb, img.bits(), img.byteCount());
|
||||
#endif
|
||||
fbImage = img;
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,9 @@ QtFrameBufferPlugin::~QtFrameBufferPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id)
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
return new QtFrameBuffer(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
QtFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~QtFrameBufferPlugin() override;
|
||||
|
||||
FrameBuffer *frameBuffer(WId id) override;
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QtFrameBufferPlugin)
|
||||
|
||||
@@ -32,5 +32,5 @@ target_link_libraries (krfb_framebuffer_xcb
|
||||
)
|
||||
|
||||
install (TARGETS krfb_framebuffer_xcb
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb
|
||||
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
|
||||
)
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"Id": "xcb",
|
||||
"License": "GPL",
|
||||
"Name": "X11 Framebuffer for KRfb",
|
||||
"Name[ca@valencia]": "«Framebuffer» de l'X11 per al KRfb.",
|
||||
"Name[ca]": "«Framebuffer» de l'X11 per al KRfb.",
|
||||
"Name[ca@valencia]": "«Framebuffer» de l'X11 per al KRfb",
|
||||
"Name[ca]": "«Framebuffer» de l'X11 per al KRfb",
|
||||
"Name[cs]": "X11 Framebuffer pro KRfb",
|
||||
"Name[da]": "X11-framebuffer til KRfb",
|
||||
"Name[de]": "X11-Framebuffer für KRfb",
|
||||
@@ -75,9 +75,6 @@
|
||||
"Name[x-test]": "xxX11 Framebuffer for KRfbxx",
|
||||
"Name[zh_CN]": "XRfb 的 X11 帧缓冲",
|
||||
"Name[zh_TW]": "KRfb 的 X11 Framebuffer",
|
||||
"ServiceTypes": [
|
||||
"krfb/framebuffer"
|
||||
],
|
||||
"Version": "0.1",
|
||||
"Website": "https://www.kde.org"
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ QList<QRect> XCBFrameBuffer::modifiedTiles() {
|
||||
} else {
|
||||
// not using shared memory
|
||||
// will use just xcb_image_get() and copy pixels
|
||||
for (const QRect& r : qAsConst(tiles)) {
|
||||
for (const QRect& r : std::as_const(tiles)) {
|
||||
// I did not find XGetSubImage() analog in XCB!!
|
||||
// need function that copies pixels from one image to another
|
||||
xcb_image_t *damagedImage = xcb_image_get(
|
||||
|
||||
@@ -37,8 +37,9 @@ XCBFrameBufferPlugin::~XCBFrameBufferPlugin()
|
||||
}
|
||||
|
||||
|
||||
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(WId id)
|
||||
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
return new XCBFrameBuffer(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
XCBFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~XCBFrameBufferPlugin() override;
|
||||
|
||||
FrameBuffer *frameBuffer(WId id) override;
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(XCBFrameBufferPlugin)
|
||||
|
||||
@@ -78,7 +78,7 @@ kconfig_add_kcfg_files (krfb_SRCS
|
||||
krfbconfig.kcfgc
|
||||
)
|
||||
|
||||
ki18n_wrap_ui (krfb_SRCS
|
||||
ki18n_wrap_ui (krfb_UI_SRCS
|
||||
ui/configtcp.ui
|
||||
ui/configsecurity.ui
|
||||
ui/configframebuffer.ui
|
||||
@@ -92,6 +92,7 @@ qt5_add_resources(krfb_SRCS
|
||||
|
||||
add_executable (krfb
|
||||
${krfb_SRCS}
|
||||
${krfb_UI_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries (krfb
|
||||
@@ -123,6 +124,41 @@ install (TARGETS krfb
|
||||
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
#################################
|
||||
kconfig_add_kcfg_files (krfbvm_SRCS
|
||||
krfbconfig.kcfgc
|
||||
)
|
||||
|
||||
ecm_qt_declare_logging_category(krfbvm_SRCS
|
||||
HEADER krfbdebug.h
|
||||
IDENTIFIER KRFB
|
||||
CATEGORY_NAME krfb.krfb
|
||||
DESCRIPTION "KRFB Application"
|
||||
EXPORT KRFB
|
||||
)
|
||||
|
||||
add_executable(krfb-virtualmonitor main-virtualmonitor.cpp ${krfbvm_SRCS} ${krfb_UI_SRCS}
|
||||
rfbserver.cpp rfbclient.cpp rfbservermanager.cpp eventsmanager.cpp framebuffermanager.cpp sockethelpers.cpp)
|
||||
target_link_libraries(krfb-virtualmonitor
|
||||
krfbprivate
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
KF5::ConfigGui
|
||||
KF5::CoreAddons
|
||||
KF5::I18n
|
||||
KF5::Notifications
|
||||
KF5::WindowSystem
|
||||
)
|
||||
|
||||
install (TARGETS krfb-virtualmonitor
|
||||
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
configure_file(org.kde.krfb.virtualmonitor.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.krfb.virtualmonitor.desktop @ONLY)
|
||||
install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.krfb.virtualmonitor.desktop
|
||||
DESTINATION ${KDE_INSTALL_APPDIR}
|
||||
)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install (PROGRAMS org.kde.krfb.desktop
|
||||
|
||||
@@ -9,3 +9,6 @@
|
||||
|
||||
/* Define if XShm is available */
|
||||
#cmakedefine HAVE_XSHM 1
|
||||
|
||||
/* Define if DMA-BUF support is available */
|
||||
#cmakedefine01 HAVE_DMA_BUF
|
||||
|
||||
@@ -37,9 +37,9 @@ ConnectionDialog<UI>::ConnectionDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setWindowTitle(i18n("New Connection"));
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
|
||||
QWidget *mainWidget = new QWidget(this);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
|
||||
auto mainWidget = new QWidget(this);
|
||||
auto mainLayout = new QVBoxLayout;
|
||||
setLayout(mainLayout);
|
||||
mainLayout->addWidget(mainWidget);
|
||||
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
|
||||
|
||||
@@ -36,7 +36,7 @@ class KRFBPRIVATE_EXPORT EventHandler : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EventHandler(QObject *parent = nullptr);
|
||||
virtual ~EventHandler() = default;
|
||||
~EventHandler() override = default;
|
||||
virtual void handleKeyboard(bool down, rfbKeySym key) = 0;
|
||||
virtual void handlePointer(int buttonMask, int x, int y) = 0;
|
||||
|
||||
|
||||
@@ -64,9 +64,7 @@ void EventsManager::loadPlugins()
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb"), [](const KPluginMetaData & md) {
|
||||
return md.serviceTypes().contains(QStringLiteral("krfb/events"));
|
||||
});
|
||||
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/events"));
|
||||
|
||||
QVectorIterator<KPluginMetaData> i(plugins);
|
||||
i.toBack();
|
||||
|
||||
@@ -43,7 +43,7 @@ class KRFBPRIVATE_EXPORT EventsManager : public QObject
|
||||
public:
|
||||
static EventsManager *instance();
|
||||
|
||||
virtual ~EventsManager();
|
||||
~EventsManager() override;
|
||||
|
||||
QSharedPointer<EventHandler> eventHandler();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class KRFBPRIVATE_EXPORT EventsPlugin : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
EventsPlugin(QObject *parent, const QVariantList &args);
|
||||
virtual ~EventsPlugin();
|
||||
~EventsPlugin() override;
|
||||
|
||||
virtual EventHandler *eventHandler() = 0;
|
||||
};
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
#include "framebuffer.h"
|
||||
|
||||
#include <config-krfb.h>
|
||||
|
||||
#include <X11/Xutil.h>
|
||||
#include <QCursor>
|
||||
|
||||
|
||||
FrameBuffer::FrameBuffer(WId id, QObject *parent)
|
||||
@@ -73,3 +72,8 @@ void FrameBuffer::startMonitor()
|
||||
void FrameBuffer::stopMonitor()
|
||||
{
|
||||
}
|
||||
|
||||
QPoint FrameBuffer::cursorPosition()
|
||||
{
|
||||
return QCursor::pos();
|
||||
}
|
||||
|
||||
@@ -42,10 +42,12 @@ public:
|
||||
virtual int depth();
|
||||
virtual void startMonitor();
|
||||
virtual void stopMonitor();
|
||||
virtual QPoint cursorPosition();
|
||||
|
||||
virtual void getServerFormat(rfbPixelFormat &format);
|
||||
|
||||
virtual QVariant customProperty(const QString &property) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void frameBufferChanged();
|
||||
|
||||
|
||||
@@ -63,9 +63,7 @@ void FrameBufferManager::loadPlugins()
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb"), [](const KPluginMetaData & md) {
|
||||
return md.serviceTypes().contains(QStringLiteral("krfb/framebuffer"));
|
||||
});
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
|
||||
|
||||
QVectorIterator<KPluginMetaData> i(plugins);
|
||||
i.toBack();
|
||||
@@ -95,7 +93,7 @@ void FrameBufferManager::loadPlugins()
|
||||
}
|
||||
}
|
||||
|
||||
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
|
||||
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
@@ -120,7 +118,7 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
|
||||
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
|
||||
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id));
|
||||
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id, args));
|
||||
|
||||
if (frameBuffer) {
|
||||
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
~FrameBufferManager() override;
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(WId id);
|
||||
QSharedPointer<FrameBuffer> frameBuffer(WId id, const QVariantMap &args);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(FrameBufferManager)
|
||||
|
||||
@@ -34,10 +34,10 @@ class KRFBPRIVATE_EXPORT FrameBufferPlugin : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
explicit FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~FrameBufferPlugin() override;
|
||||
|
||||
virtual FrameBuffer *frameBuffer(WId id) = 0;
|
||||
virtual FrameBuffer *frameBuffer(WId id, const QVariantMap &args) = 0;
|
||||
};
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -52,10 +52,6 @@ PendingInvitationsRfbClient::PendingInvitationsRfbClient(rfbClientPtr client, QO
|
||||
d(new Private(client))
|
||||
{
|
||||
d->client->clientGoneHook = clientGoneHookNoop;
|
||||
d->notifier = new QSocketNotifier(client->sock, QSocketNotifier::Read, this);
|
||||
d->notifier->setEnabled(true);
|
||||
connect(d->notifier, &QSocketNotifier::activated,
|
||||
this, &PendingInvitationsRfbClient::onSocketActivated);
|
||||
}
|
||||
|
||||
PendingInvitationsRfbClient::~PendingInvitationsRfbClient()
|
||||
@@ -90,39 +86,6 @@ void PendingInvitationsRfbClient::processNewClient()
|
||||
}
|
||||
}
|
||||
|
||||
void PendingInvitationsRfbClient::onSocketActivated()
|
||||
{
|
||||
//Process not only one, but all pending messages.
|
||||
//poll() idea/code copied from vino:
|
||||
// Copyright (C) 2003 Sun Microsystems, Inc.
|
||||
// License: GPL v2 or later
|
||||
struct pollfd pollfd = { d->client->sock, POLLIN|POLLPRI, 0 };
|
||||
|
||||
while(poll(&pollfd, 1, 0) == 1) {
|
||||
|
||||
if(d->client->state == rfbClientRec::RFB_INITIALISATION) {
|
||||
d->notifier->setEnabled(false);
|
||||
//Client is Authenticated
|
||||
processNewClient();
|
||||
break;
|
||||
}
|
||||
rfbProcessClientMessage(d->client);
|
||||
|
||||
//This is how we handle disconnection.
|
||||
//if rfbProcessClientMessage() finds out that it can't read the socket,
|
||||
//it closes it and sets it to -1. So, we just have to check this here
|
||||
//and call rfbClientConnectionGone() if necessary. This will call
|
||||
//the clientGoneHook which in turn will remove this RfbClient instance
|
||||
//from the server manager and will call deleteLater() to delete it
|
||||
if (d->client->sock == -1) {
|
||||
qCDebug(KRFB) << "disconnected from socket signal";
|
||||
d->notifier->setEnabled(false);
|
||||
rfbClientConnectionGone(d->client);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool PendingInvitationsRfbClient::checkPassword(const QByteArray & encryptedPassword)
|
||||
{
|
||||
qCDebug(KRFB) << "about to start authentication";
|
||||
|
||||
@@ -37,7 +37,6 @@ public:
|
||||
|
||||
protected Q_SLOTS:
|
||||
void processNewClient() override;
|
||||
virtual void onSocketActivated();
|
||||
bool checkPassword(const QByteArray & encryptedPassword) override;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "invitationsrfbserver.h"
|
||||
#include "invitationsrfbclient.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "rfbservermanager.h"
|
||||
#include "krfbdebug.h"
|
||||
#include <QTimer>
|
||||
#include <QApplication>
|
||||
@@ -33,7 +32,13 @@
|
||||
#include <KStringHandler>
|
||||
#include <KWallet/KWallet>
|
||||
|
||||
#include <dnssd/publicservice.h>
|
||||
#include <kdnssd_version.h>
|
||||
#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
|
||||
#include <KDNSSD/PublicService>
|
||||
#else
|
||||
#include <DNSSD/PublicService>
|
||||
#endif
|
||||
|
||||
using KWallet::Wallet;
|
||||
|
||||
// used for KWallet folder name
|
||||
@@ -172,7 +177,7 @@ void InvitationsRfbServer::walletOpened(bool opened)
|
||||
if (m_wallet->readPassword(QStringLiteral("desktopSharingPassword"), desktopPassword) == 0 &&
|
||||
!desktopPassword.isEmpty()) {
|
||||
m_desktopPassword = desktopPassword;
|
||||
emit passwordChanged(m_desktopPassword);
|
||||
Q_EMIT passwordChanged(m_desktopPassword);
|
||||
}
|
||||
|
||||
if(m_wallet->readPassword(QStringLiteral("unattendedAccessPassword"), unattendedPassword) == 0 &&
|
||||
@@ -189,7 +194,7 @@ void InvitationsRfbServer::walletOpened(bool opened)
|
||||
"desktopPassword", QString()));
|
||||
if(!desktopPassword.isEmpty()) {
|
||||
m_desktopPassword = desktopPassword;
|
||||
emit passwordChanged(m_desktopPassword);
|
||||
Q_EMIT passwordChanged(m_desktopPassword);
|
||||
}
|
||||
|
||||
unattendedPassword = KStringHandler::obscure(krfbConfig.readEntry(
|
||||
|
||||
@@ -3,8 +3,8 @@ Type=ServiceType
|
||||
X-KDE-ServiceType=krfb/events
|
||||
|
||||
Comment=Event plugins for KRfb
|
||||
Comment[ca]=Connectors d'esdeveniments per al KRfb.
|
||||
Comment[ca@valencia]=Connectors d'esdeveniments per al KRfb.
|
||||
Comment[ca]=Connectors d'esdeveniments per al KRfb
|
||||
Comment[ca@valencia]=Connectors d'esdeveniments per al KRfb
|
||||
Comment[cs]=Moduly událostí pro KRfb
|
||||
Comment[da]=Hændelses-plugins til KRfb
|
||||
Comment[de]=Ereignis-Module für KRfb
|
||||
@@ -24,6 +24,7 @@ Comment[nn]=Hendingstillegg for KRfb
|
||||
Comment[pl]=Wtyczki wydarzeń dla KRfb
|
||||
Comment[pt]='Plugins' de eventos para o KRfb
|
||||
Comment[pt_BR]=Plugins de evento para o KRfb
|
||||
Comment[ro]=Extensii de evenimente pentru KRfb
|
||||
Comment[sk]=Doplnky udalostí pre KRfb
|
||||
Comment[sl]=Vstavki dogodkov za KRFB
|
||||
Comment[sv]=Händelseinsticksprogram för Krfb
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Description": "Events plugins for KRfb",
|
||||
"Description[ca@valencia]": "Connectors d'esdeveniments per al KRfb.",
|
||||
"Description[ca]": "Connectors d'esdeveniments per al KRfb.",
|
||||
"Description[ca@valencia]": "Connectors d'esdeveniments per al KRfb",
|
||||
"Description[ca]": "Connectors d'esdeveniments per al KRfb",
|
||||
"Description[cs]": "Moduly událostí pro KRfb",
|
||||
"Description[da]": "Hændelses-plugins til KRfb",
|
||||
"Description[de]": "Ereignis-Module für KRfb",
|
||||
|
||||
@@ -5,8 +5,8 @@ X-KDE-ServiceType=krfb/framebuffer
|
||||
Comment=Frame Buffer plugins for KRfb
|
||||
Comment[bg]=Приставки за фреймбуфер за KRfb
|
||||
Comment[bs]=Priključci framebafera za KRfb
|
||||
Comment[ca]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb.
|
||||
Comment[ca]=Connectors de «framebuffer» per al KRfb
|
||||
Comment[ca@valencia]=Connectors de «framebuffer» per al KRfb
|
||||
Comment[cs]=Moduly Frame bufferu pro KRfb
|
||||
Comment[da]=Framebuffer-plugins til KRfb
|
||||
Comment[de]=Framebuffer-Module für KRfb
|
||||
@@ -38,6 +38,7 @@ Comment[pa]=KRfb ਲਈ ਫਰੇਮ ਬਫ਼ਰ ਪਲੱਗਇਨ
|
||||
Comment[pl]=Wtyczki buforów ramek dla KRfb
|
||||
Comment[pt]='Plugins' do 'Framebuffer' para o KRfb
|
||||
Comment[pt_BR]=Plugins de framebuffers para o KRfb
|
||||
Comment[ro]=Extensii de tampon de cadre pentru KRfb
|
||||
Comment[ru]=Модуль буфера кадров для KRfb
|
||||
Comment[si]=KRfb සඳහා රාමු බෆර ප්ලගින
|
||||
Comment[sk]=Frame Buffer modul pre KRfb
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"KPlugin": {
|
||||
"Description": "Frame Buffer plugins for KRfb",
|
||||
"Description[ca@valencia]": "Connectors de «Frame Buffer» per al KRfb.",
|
||||
"Description[ca]": "Connectors de «Frame Buffer» per al KRfb.",
|
||||
"Description[ca@valencia]": "Connectors de «Frame Buffer» per al KRfb",
|
||||
"Description[ca]": "Connectors de «Frame Buffer» per al KRfb",
|
||||
"Description[cs]": "Moduly Frame bufferu pro KRfb",
|
||||
"Description[da]": "Framebuffer-plugins til KRfb",
|
||||
"Description[de]": "Framebuffer-Module für KRfb",
|
||||
|
||||
@@ -518,7 +518,7 @@ Name[nds]=Leeg Passwoort
|
||||
Name[nl]=Ongeldig wachtwoord
|
||||
Name[nn]=Ugyldig passord
|
||||
Name[pa]=ਗਲਤ ਪਾਸਵਰਡ
|
||||
Name[pl]=Błędne hasło
|
||||
Name[pl]=Nieprawidłowe hasło
|
||||
Name[pt]=Senha Inválida
|
||||
Name[pt_BR]=Senha inválida
|
||||
Name[ro]=Parolă nevalidă
|
||||
@@ -589,7 +589,7 @@ Comment[nl]=Ongeldig wachtwoord
|
||||
Comment[nn]=Passordet var ugyldig
|
||||
Comment[oc]=Mot de pas invalid
|
||||
Comment[pa]=ਗਲਤ ਪਾਸਵਰਡ
|
||||
Comment[pl]=Błędne hasło
|
||||
Comment[pl]=Nieprawidłowe hasło
|
||||
Comment[pt]=A senha é inválida
|
||||
Comment[pt_BR]=Senha inválida
|
||||
Comment[ro]=Parolă nevalidă
|
||||
|
||||
173
krfb/main-virtualmonitor.cpp
Normal file
173
krfb/main-virtualmonitor.cpp
Normal file
@@ -0,0 +1,173 @@
|
||||
/* This file is part of the KDE project
|
||||
Copyright (C) 2021 Aleix Pol Gonzalez <aleixpol@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 3 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QCommandLineOption>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <KNotification>
|
||||
#include <KLocalizedString>
|
||||
#include <KWindowSystem>
|
||||
#include <KAboutData>
|
||||
#include "sockethelpers.h"
|
||||
#include "krfb_version.h"
|
||||
#include "rfbserver.h"
|
||||
#include <signal.h>
|
||||
#include "rfbservermanager.h"
|
||||
|
||||
class VirtualMonitorRfbClient : public RfbClient
|
||||
{
|
||||
public:
|
||||
explicit VirtualMonitorRfbClient(rfbClientPtr client, QObject *parent = nullptr)
|
||||
: RfbClient(client, parent)
|
||||
{}
|
||||
};
|
||||
|
||||
class PendingVirtualMonitorRfbClient : public PendingRfbClient
|
||||
{
|
||||
public:
|
||||
explicit PendingVirtualMonitorRfbClient(rfbClientPtr client, QObject *parent = nullptr)
|
||||
: PendingRfbClient(client, parent)
|
||||
{}
|
||||
~PendingVirtualMonitorRfbClient() override {}
|
||||
|
||||
static QByteArray password;
|
||||
|
||||
protected:
|
||||
void processNewClient() override {
|
||||
qDebug() << "new client!";
|
||||
const QString host = peerAddress(m_rfbClient->sock) + QLatin1Char(':') + QString::number(peerPort(m_rfbClient->sock));
|
||||
|
||||
KNotification::event(QStringLiteral("NewConnectionAutoAccepted"),
|
||||
i18n("Creating a Virtual Monitor from %1", host));
|
||||
}
|
||||
bool checkPassword(const QByteArray & encryptedPassword) override {
|
||||
bool b = vncAuthCheckPassword(password, encryptedPassword);
|
||||
if (b) {
|
||||
QTimer::singleShot(0, this, [this] {
|
||||
accept(new VirtualMonitorRfbClient(m_rfbClient, parent()));
|
||||
});
|
||||
}
|
||||
return b;
|
||||
}
|
||||
};
|
||||
|
||||
QByteArray PendingVirtualMonitorRfbClient::password;
|
||||
|
||||
class VirtualMonitorRfbServer : public RfbServer
|
||||
{
|
||||
public:
|
||||
PendingRfbClient *newClient(rfbClientPtr client) {
|
||||
qDebug() << "new client request";
|
||||
return new PendingVirtualMonitorRfbClient(client, this);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
KLocalizedString::setApplicationDomain("krfb");
|
||||
|
||||
KAboutData aboutData(QStringLiteral("krfb-virtualmonitor"),
|
||||
i18n("Remote Virtual Monitor"),
|
||||
QStringLiteral(KRFB_VERSION_STRING),
|
||||
i18n("Offer a Virtual Monitor that can be accessed remotely"),
|
||||
KAboutLicense::GPL,
|
||||
i18n("(c) 2009-2010, Collabora Ltd.\n"
|
||||
"(c) 2007, Alessandro Praduroux\n"
|
||||
"(c) 2001-2003, Tim Jansen\n"
|
||||
"(c) 2001, Johannes E. Schindelin\n"
|
||||
"(c) 2000-2001, Const Kaplinsky\n"
|
||||
"(c) 2000, Tridia Corporation\n"
|
||||
"(c) 1999, AT&T Laboratories Boston\n"));
|
||||
aboutData.addAuthor(QStringLiteral("Aleix Pol i Gonzalez"), i18n("Virtual Monitor implementation"), QStringLiteral("aleixpol@kde.org"));
|
||||
aboutData.addAuthor(i18n("George Kiagiadakis"), QString(), QStringLiteral("george.kiagiadakis@collabora.co.uk"));
|
||||
aboutData.addAuthor(i18n("Alessandro Praduroux"), i18n("KDE4 porting"), QStringLiteral("pradu@pradu.it"));
|
||||
aboutData.addAuthor(i18n("Tim Jansen"), i18n("Original author"), QStringLiteral("tim@tjansen.de"));
|
||||
aboutData.addCredit(i18n("Johannes E. Schindelin"),
|
||||
i18n("libvncserver"));
|
||||
aboutData.addCredit(i18n("Const Kaplinsky"),
|
||||
i18n("TightVNC encoder"));
|
||||
aboutData.addCredit(i18n("Tridia Corporation"),
|
||||
i18n("ZLib encoder"));
|
||||
aboutData.addCredit(i18n("AT&T Laboratories Boston"),
|
||||
i18n("original VNC encoders and "
|
||||
"protocol design"));
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
|
||||
QCommandLineParser parser;
|
||||
aboutData.setupCommandLine(&parser);
|
||||
const QCommandLineOption resolutionOption({ QStringLiteral("resolution") }, i18n("Logical resolution of the new monitor"), i18n("resolution"));
|
||||
parser.addOption(resolutionOption);
|
||||
const QCommandLineOption nameOption({ QStringLiteral("name") }, i18n("Name of the monitor"), i18n("name"));
|
||||
parser.addOption(nameOption);
|
||||
const QCommandLineOption passwordOption({ QStringLiteral("password") }, i18n("Password for the client to connect to it"), i18n("password"));
|
||||
parser.addOption(passwordOption);
|
||||
const QCommandLineOption scaleOption({ QStringLiteral("scale") }, i18n("The device-pixel-ratio of the device, the scaling factor"), i18n("dpr"), QStringLiteral("1"));
|
||||
parser.addOption(scaleOption);
|
||||
const QCommandLineOption portOption({ QStringLiteral("port") }, i18n("The port we will be listening to"), i18n("number"), QStringLiteral("9999"));
|
||||
parser.addOption(portOption);
|
||||
|
||||
parser.process(app);
|
||||
aboutData.processCommandLine(&parser);
|
||||
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (!KWindowSystem::isPlatformWayland()) {
|
||||
qCritical() << "Virtual Monitors are only supported on Wayland";
|
||||
return 1;
|
||||
}
|
||||
if (!parser.isSet(nameOption)) {
|
||||
qCritical() << "error: please define --name";
|
||||
return 2;
|
||||
} else {
|
||||
if (!parser.isSet(passwordOption)) {
|
||||
qCritical() << "error: please define --password";
|
||||
return 3;
|
||||
}
|
||||
if (!parser.isSet(resolutionOption)) {
|
||||
qCritical() << "error: please define --resolution";
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
if (!parser.isSet(portOption)) {
|
||||
qCritical() << "error: please define --port";
|
||||
return 5;
|
||||
}
|
||||
const QString res = parser.value(resolutionOption);
|
||||
const auto resSplit = res.split(QLatin1Char('x'));
|
||||
if (resSplit.size() != 2) {
|
||||
qCritical() << "error: the resolution should be formatted as WIDTHxHEIGHT (e.g. --resolution 1920x1080)";
|
||||
return 6;
|
||||
}
|
||||
|
||||
|
||||
if (parser.isSet(nameOption)) {
|
||||
RfbServerManager::s_pluginArgs = {
|
||||
{ QStringLiteral("name"), parser.value(nameOption) },
|
||||
{ QStringLiteral("resolution"), QSize(resSplit[0].toInt(), resSplit[1].toInt()) },
|
||||
{ QStringLiteral("scale"), parser.value(scaleOption).toDouble() },
|
||||
};
|
||||
}
|
||||
|
||||
VirtualMonitorRfbServer server;
|
||||
server.setPasswordRequired(true);
|
||||
server.setListeningPort(parser.value(portOption).toInt());
|
||||
PendingVirtualMonitorRfbClient::password = parser.value(passwordOption).toUtf8();
|
||||
|
||||
sigset_t sigs;
|
||||
sigemptyset(&sigs);
|
||||
sigaddset(&sigs, SIGPIPE);
|
||||
sigprocmask(SIG_BLOCK, &sigs, nullptr);
|
||||
server.start();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
class TCP: public QWidget, public Ui::TCP
|
||||
{
|
||||
public:
|
||||
TCP(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
explicit TCP(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
class Security: public QWidget, public Ui::Security
|
||||
{
|
||||
public:
|
||||
Security(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
explicit Security(QWidget *parent = nullptr) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
walletWarning = new KMessageWidget(this);
|
||||
walletWarning->setText(i18n("Storing passwords in config file is insecure!"));
|
||||
@@ -83,10 +83,7 @@ public:
|
||||
}
|
||||
|
||||
void fillFrameBuffersCombo() {
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(
|
||||
QStringLiteral("krfb"), [](const KPluginMetaData & md) {
|
||||
return md.serviceTypes().contains(QStringLiteral("krfb/framebuffer"));
|
||||
});
|
||||
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
|
||||
QSet<QString> unique;
|
||||
QVectorIterator<KPluginMetaData> i(plugins);
|
||||
i.toBack();
|
||||
@@ -110,7 +107,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
m_passwordLineEdit->setVisible(false);
|
||||
m_passwordLineEdit->setAlignment(Qt::AlignHCenter);
|
||||
|
||||
QWidget *mainWidget = new QWidget;
|
||||
auto mainWidget = new QWidget;
|
||||
m_ui.setupUi(mainWidget);
|
||||
m_ui.krfbIconLabel->setPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(128));
|
||||
m_ui.enableUnattendedCheckBox->setChecked(
|
||||
@@ -255,7 +252,7 @@ void MainWindow::showConfiguration()
|
||||
return;
|
||||
}
|
||||
|
||||
KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), KrfbConfig::self());
|
||||
auto dialog = new KConfigDialog(this, QStringLiteral("settings"), KrfbConfig::self());
|
||||
dialog->addPage(new TCP, i18n("Network"), QStringLiteral("network-wired"));
|
||||
dialog->addPage(new Security, i18n("Security"), QStringLiteral("security-high"));
|
||||
dialog->addPage(new ConfigFramebuffer, i18n("Screen capture"), QStringLiteral("video-display"));
|
||||
|
||||
@@ -43,7 +43,7 @@ class MainWindow : public KXmlGuiWindow
|
||||
private:
|
||||
Ui::MainWidget m_ui;
|
||||
bool m_passwordEditable;
|
||||
QLineEdit *m_passwordLineEdit;
|
||||
QLineEdit *m_passwordLineEdit = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<name xml:lang="pl">Krfb</name>
|
||||
<name xml:lang="pt">Krfb</name>
|
||||
<name xml:lang="pt-BR">Krfb</name>
|
||||
<name xml:lang="ro">Krfb</name>
|
||||
<name xml:lang="ru">Krfb</name>
|
||||
<name xml:lang="sk">Krfb</name>
|
||||
<name xml:lang="sl">Krfb</name>
|
||||
@@ -43,11 +44,14 @@
|
||||
<summary xml:lang="ca">Comparteix l'escriptori amb un altre ordinador a través de VNC</summary>
|
||||
<summary xml:lang="ca-valencia">Comparteix l'escriptori amb un altre ordinador a través de VNC</summary>
|
||||
<summary xml:lang="cs">Sdílejte své pracovní prostředí na jiný počítač pomocí VNC</summary>
|
||||
<summary xml:lang="da">Del dit skrivebord til en anden computer via VNC</summary>
|
||||
<summary xml:lang="de">Verbindung Ihrer Arbeitsfläche zu anderen Rechnern über VNC</summary>
|
||||
<summary xml:lang="el">Μοιραστείτε την επιφάνεια εργασίας σας με άλλον υπολογιστή μέσω VNC</summary>
|
||||
<summary xml:lang="en-GB">Share your desktop to another computer via VNC</summary>
|
||||
<summary xml:lang="es">Compartir su escritorio con otro equipo usando VNC</summary>
|
||||
<summary xml:lang="et">Oma töölaua jagamine VNC kaudu teise arvutisse</summary>
|
||||
<summary xml:lang="eu">Partekatu zure mahaigaina beste ordenagailu batekin VNC erabiliz</summary>
|
||||
<summary xml:lang="fi">Jaa työpöytä toiselle koneelle VNC:n kautta</summary>
|
||||
<summary xml:lang="fr">Partager votre bureau avec un autre ordinateur grâce à « VNC »</summary>
|
||||
<summary xml:lang="ia">Compartir tu scriptorio a un altere computator via VNC</summary>
|
||||
<summary xml:lang="id">Bagikan desktopmu ke komputer lainnya via VNC</summary>
|
||||
@@ -58,10 +62,12 @@
|
||||
<summary xml:lang="pl">Udostępnij swój pulpit innemu komputerowi przez VNC</summary>
|
||||
<summary xml:lang="pt">Partilhar o seu ecrã com outro computador por VNC</summary>
|
||||
<summary xml:lang="pt-BR">Compartilhar sua área de trabalho com outro computador via VNC</summary>
|
||||
<summary xml:lang="ro">Partajați-vă biroul cu alt calculator prin VNC</summary>
|
||||
<summary xml:lang="sl">Deli namizje z drugim računalnikom prek VNC</summary>
|
||||
<summary xml:lang="sv">Dela ditt skrivbord med en annan dator via VNC</summary>
|
||||
<summary xml:lang="uk">Надайте вашу стільницю у спільне користування з іншим комп'ютером за допомогою VNC</summary>
|
||||
<summary xml:lang="x-test">xxShare your desktop to another computer via VNCxx</summary>
|
||||
<summary xml:lang="zh-CN">通过 VNC 分享您的桌面到另一台电脑</summary>
|
||||
<description>
|
||||
<p>Krfb Desktop Sharing is a server application that allows you to share your current session with a user on another machine, who can use a VNC client to view or even control the desktop.</p>
|
||||
<p xml:lang="ca">El Krfb és una aplicació de servidor que permet compartir la vostra sessió actual amb un usuari en una altra màquina, la qual pot emprar un client VNC per a veure o controlar l'escriptori.</p>
|
||||
@@ -76,6 +82,7 @@
|
||||
<p xml:lang="fi">Krfb-työpöytäjako on palvelinsovellus, jolla voit jakaa nykyisen istuntosi toisen koneen käyttäjälle, joka voi VNC-asiakkaalla nähdä tai jopa hallita työpöytääsi.</p>
|
||||
<p xml:lang="fr">Le partage de bureau Krfb est une application de serveur qui vous permet de partager votre session courante avec un utilisateur sur une autre machine, qui peut utiliser un client VNC pour afficher et même contrôler le bureau.</p>
|
||||
<p xml:lang="gl">Krfb é unha aplicación de servidor que permite compartir a sesión actual cun usuario que está noutro equipo, que pode usar un cliente VNC para ver ou mesmo controlar o escritorio.</p>
|
||||
<p xml:lang="ia">Krfb Desktop Sharing es un application de servitor que te permitte compartir tu session currente con un usator sur un altere machina,le qual pote usar un cliente VNC per vider o anque controlar le scriptorio.</p>
|
||||
<p xml:lang="id">Krfb Desktop Sharing adalah aplikasi server yang memungkinkan kamu untuk berbagi sesimu saat ini dengan pengguna di mesin lain, yang bisa menggunakan klien VNC untuk menampilkan atau bahkan mengendalikan desktop.</p>
|
||||
<p xml:lang="it">Condivisione del desktop Krfb è un'applicazione server che permette di condividere la sessione attuale con un utente su un'altra macchina, che potrà usare un client VNC per visualizzare ed anche controllare il desktop.</p>
|
||||
<p xml:lang="ko">Krfb 데스크톱 공유는 현재 세션을 다른 머신의 사용자와 VNC를 통해서 공유하거나 원격 제어를 요청할 수 있는 서버 프로그램입니다.</p>
|
||||
@@ -127,6 +134,7 @@
|
||||
<caption xml:lang="pl">Udostępnienie pulpitu przy użyciu Krfb</caption>
|
||||
<caption xml:lang="pt">Partilha do ecrã com o Krfb</caption>
|
||||
<caption xml:lang="pt-BR">Compartilhando a área de trabalho com o Krfb</caption>
|
||||
<caption xml:lang="ro">Partajarea biroului cu Krfb</caption>
|
||||
<caption xml:lang="ru">Общий доступ к рабочему столу с использованием Krfb</caption>
|
||||
<caption xml:lang="sk">Zdieľanie pracovnej plochy s Krfb</caption>
|
||||
<caption xml:lang="sl">Deljenje namizij s Krfb</caption>
|
||||
@@ -143,9 +151,9 @@
|
||||
</provides>
|
||||
<project_group>KDE</project_group>
|
||||
<releases>
|
||||
<release version="20.12.3" date="2021-03-04"/>
|
||||
<release version="20.12.2" date="2021-02-04"/>
|
||||
<release version="20.12.1" date="2021-01-07"/>
|
||||
<release version="20.12.0" date="2020-12-10"/>
|
||||
<release version="21.12.3" date="2022-03-03"/>
|
||||
<release version="21.12.2" date="2022-02-03"/>
|
||||
<release version="21.12.1" date="2022-01-06"/>
|
||||
<release version="21.12.0" date="2021-12-09"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
||||
@@ -84,6 +84,8 @@ GenericName[el]=Κοινή χρήση επιφάνειας εργασίας (VNC
|
||||
GenericName[en_GB]=Desktop Sharing (VNC)
|
||||
GenericName[es]=Escritorio compartido (VNC)
|
||||
GenericName[et]=Töölaua jagamine (VNC)
|
||||
GenericName[eu]=Mahaigaina partekatzea (VNC)
|
||||
GenericName[fi]=Työpöydän jakaminen (VNC)
|
||||
GenericName[fr]=Partage de bureaux (VNC)
|
||||
GenericName[ia]=Compartir de scriptorio (VNC)
|
||||
GenericName[it]=Condivisione del desktop (VNC)
|
||||
@@ -93,10 +95,12 @@ GenericName[nn]=Skrivebordsdeling (VNC)
|
||||
GenericName[pl]=Współdzielenie pulpitu (VNC)
|
||||
GenericName[pt]=Partilha do Ecrã (VNC)
|
||||
GenericName[pt_BR]=Compartilhamento de ambiente de trabalho (VNC)
|
||||
GenericName[ro]=Partajare birou (VNC)
|
||||
GenericName[sl]=Souporaba namizja (VNC)
|
||||
GenericName[sv]=Skrivbordsdelning (VNC)
|
||||
GenericName[uk]=Спільні стільниці (VNC)
|
||||
GenericName[x-test]=xxDesktop Sharing (VNC)xx
|
||||
GenericName[zh_CN]=桌面共享 (VNC)
|
||||
Comment=Desktop Sharing
|
||||
Comment[af]=Werkskerm Deeling
|
||||
Comment[ar]=مشاركة سطح المكتب
|
||||
|
||||
50
krfb/org.kde.krfb.virtualmonitor.desktop.cmake
Normal file
50
krfb/org.kde.krfb.virtualmonitor.desktop.cmake
Normal file
@@ -0,0 +1,50 @@
|
||||
# KDE Config File
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=@CMAKE_INSTALL_PREFIX@/bin/krfb-virtualmonitor
|
||||
Icon=krfb
|
||||
Terminal=false
|
||||
Name=KRFBs Virtual Monitor
|
||||
Name[ca]=Monitor virtual del Krfb
|
||||
Name[ca@valencia]=Monitor virtual del Krfb
|
||||
Name[el]=Εικονική οθόνη του KRFB
|
||||
Name[en_GB]=KRFBs Virtual Monitor
|
||||
Name[es]=Monitor virtual de KRFB
|
||||
Name[fi]=KRFB:n virtuaalinäyttö
|
||||
Name[fr]=Moniteur virtuel « Krfb »
|
||||
Name[ia]=Virtual Monitor de KRFB
|
||||
Name[it]=Monitor virtuale di KRFB
|
||||
Name[ko]=KRFBs 가상 모니터
|
||||
Name[nl]=Virtuele monitor van KRFB
|
||||
Name[pl]=Monitor wirtualny KRFB
|
||||
Name[pt]=Monitor Virtual do KRFB
|
||||
Name[pt_BR]=Monitor virtual do KRFB
|
||||
Name[ro]=Monitor virtual KRFB
|
||||
Name[sl]=Navidezni monitor KRFB
|
||||
Name[sv]=Krfb:s virtuella bildskärm
|
||||
Name[uk]=Віртуальний монітор KRFB
|
||||
Name[x-test]=xxKRFBs Virtual Monitorxx
|
||||
Name[zh_CN]=KRBs 虚拟监视器
|
||||
Comment=Remote Virtual Monitor
|
||||
Comment[ca]=Monitor virtual remot
|
||||
Comment[ca@valencia]=Monitor virtual remot
|
||||
Comment[el]=Απομακρυσμένη εικονική οθόνη
|
||||
Comment[en_GB]=Remote Virtual Monitor
|
||||
Comment[es]=Monitor virtual remoto
|
||||
Comment[fi]=Virtuaalinen etänäyttö
|
||||
Comment[fr]=Moniteur virtuel distant
|
||||
Comment[ia]=Monitor Virtual Remote
|
||||
Comment[it]=Monitor virtuale remoto
|
||||
Comment[ko]=원격 가상 모니터
|
||||
Comment[nl]=Virtual Monitor op afstand
|
||||
Comment[pl]=Zdalny monitor wirtualny
|
||||
Comment[pt]=Monitor Virtual Remoto
|
||||
Comment[pt_BR]=Monitor virtual remoto
|
||||
Comment[ro]=Monitor virtual distant
|
||||
Comment[sl]=Oddaljeni navidezni monitor
|
||||
Comment[sv]=Virtuell fjärrbildskärm
|
||||
Comment[uk]=Віддалений віртуальний монітор
|
||||
Comment[x-test]=xxRemote Virtual Monitorxx
|
||||
Comment[zh_CN]=远程虚拟监视器
|
||||
NoDisplay=true
|
||||
X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <QSocketNotifier>
|
||||
#include <poll.h>
|
||||
#include <strings.h> //for bzero()
|
||||
#include "krfbdebug.h"
|
||||
|
||||
struct RfbClient::Private
|
||||
{
|
||||
@@ -170,8 +171,13 @@ void RfbClient::update()
|
||||
|
||||
PendingRfbClient::PendingRfbClient(rfbClientPtr client, QObject *parent)
|
||||
: QObject(parent), m_rfbClient(client)
|
||||
, m_notifier(new QSocketNotifier(client->sock, QSocketNotifier::Read, this))
|
||||
{
|
||||
m_rfbClient->clientData = this;
|
||||
|
||||
m_notifier->setEnabled(true);
|
||||
connect(m_notifier, &QSocketNotifier::activated,
|
||||
this, &PendingRfbClient::onSocketActivated);
|
||||
}
|
||||
|
||||
PendingRfbClient::~PendingRfbClient()
|
||||
@@ -230,3 +236,35 @@ bool PendingRfbClient::vncAuthCheckPassword(const QByteArray& password, const QB
|
||||
rfbEncryptBytes(challenge, passwd);
|
||||
return memcmp(challenge, encryptedPassword.constData(), encryptedPassword.size()) == 0;
|
||||
}
|
||||
|
||||
void PendingRfbClient::onSocketActivated()
|
||||
{
|
||||
//Process not only one, but all pending messages.
|
||||
//poll() idea/code copied from vino:
|
||||
// Copyright (C) 2003 Sun Microsystems, Inc.
|
||||
// License: GPL v2 or later
|
||||
struct pollfd pollfd = { m_rfbClient->sock, POLLIN|POLLPRI, 0 };
|
||||
|
||||
while(poll(&pollfd, 1, 0) == 1) {
|
||||
if(m_rfbClient->state == rfbClientRec::RFB_INITIALISATION) {
|
||||
m_notifier->setEnabled(false);
|
||||
//Client is Authenticated
|
||||
processNewClient();
|
||||
break;
|
||||
}
|
||||
rfbProcessClientMessage(m_rfbClient);
|
||||
|
||||
//This is how we handle disconnection.
|
||||
//if rfbProcessClientMessage() finds out that it can't read the socket,
|
||||
//it closes it and sets it to -1. So, we just have to check this here
|
||||
//and call rfbClientConnectionGone() if necessary. This will call
|
||||
//the clientGoneHook which in turn will remove this RfbClient instance
|
||||
//from the server manager and will call deleteLater() to delete it
|
||||
if (m_rfbClient->sock == -1) {
|
||||
qCDebug(KRFB) << "disconnected from socket signal";
|
||||
m_notifier->setEnabled(false);
|
||||
rfbClientConnectionGone(m_rfbClient);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include "rfb.h"
|
||||
#include <QObject>
|
||||
|
||||
class QSocketNotifier;
|
||||
|
||||
class RfbClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -104,6 +106,11 @@ protected:
|
||||
bool vncAuthCheckPassword(const QByteArray & password, const QByteArray & encryptedPassword) const;
|
||||
|
||||
rfbClientPtr m_rfbClient;
|
||||
|
||||
private:
|
||||
void onSocketActivated();
|
||||
|
||||
QSocketNotifier *const m_notifier;
|
||||
};
|
||||
|
||||
#endif // RFBCLIENT_H
|
||||
|
||||
@@ -117,6 +117,7 @@ bool RfbServer::start()
|
||||
}
|
||||
|
||||
d->screen->port = listeningPort();
|
||||
d->screen->ipv6port = listeningPort();
|
||||
|
||||
// Disable/Enable password checking
|
||||
if (passwordRequired()) {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "framebuffermanager.h"
|
||||
#include "sockethelpers.h"
|
||||
#include "krfbconfig.h"
|
||||
#include "krfbdebug.h"
|
||||
#include <QTimer>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
@@ -33,6 +34,9 @@
|
||||
#include <KLocalizedString>
|
||||
#include <KUser>
|
||||
#include <KNotification>
|
||||
#include <chrono>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
static const char *cur =
|
||||
" "
|
||||
@@ -116,11 +120,12 @@ QSharedPointer<FrameBuffer> RfbServerManager::framebuffer() const
|
||||
return d->fb;
|
||||
}
|
||||
|
||||
QVariantMap RfbServerManager::s_pluginArgs;
|
||||
|
||||
void RfbServerManager::init()
|
||||
{
|
||||
//qDebug();
|
||||
|
||||
d->fb = FrameBufferManager::instance()->frameBuffer(QApplication::desktop()->winId());
|
||||
d->fb = FrameBufferManager::instance()->frameBuffer(QApplication::desktop()->winId(), s_pluginArgs);
|
||||
d->myCursor = rfbMakeXCursor(19, 19, (char *) cur, (char *) mask);
|
||||
d->myCursor->cleanup = false;
|
||||
d->desktopName = QStringLiteral("%1@%2 (shared desktop)") //FIXME check if we can use utf8
|
||||
@@ -133,7 +138,7 @@ void RfbServerManager::init()
|
||||
|
||||
void RfbServerManager::updateFrameBuffer()
|
||||
{
|
||||
Q_FOREACH(RfbServer *server, d->servers) {
|
||||
for (RfbServer *server : std::as_const(d->servers)) {
|
||||
server->updateFrameBuffer(d->fb->data(), d->fb->width(), d->fb->height(), d->fb->depth());
|
||||
}
|
||||
}
|
||||
@@ -141,9 +146,9 @@ void RfbServerManager::updateFrameBuffer()
|
||||
void RfbServerManager::updateScreens()
|
||||
{
|
||||
QList<QRect> rects = d->fb->modifiedTiles();
|
||||
QPoint currentCursorPos = QCursor::pos();
|
||||
const QPoint currentCursorPos = d->fb->cursorPosition();
|
||||
|
||||
for (RfbServer* server : qAsConst(d->servers)) {
|
||||
for (RfbServer* server : std::as_const(d->servers)) {
|
||||
server->updateScreen(rects);
|
||||
server->updateCursorPosition(currentCursorPos);
|
||||
}
|
||||
@@ -199,7 +204,7 @@ rfbScreenInfoPtr RfbServerManager::newScreen()
|
||||
|
||||
//qDebug() << "bpp: " << bpp;
|
||||
|
||||
rfbLogEnable(0);
|
||||
rfbLogEnable(KRFB().isDebugEnabled());
|
||||
|
||||
screen = rfbGetScreen(nullptr, nullptr, w, h, 8, 3, bpp);
|
||||
screen->paddedWidthInBytes = d->fb->paddedWidth();
|
||||
@@ -217,7 +222,7 @@ void RfbServerManager::addClient(RfbClient* cc)
|
||||
if (d->clients.size() == 0) {
|
||||
//qDebug() << "Starting framebuffer monitor";
|
||||
d->fb->startMonitor();
|
||||
d->rfbUpdateTimer.start(50);
|
||||
d->rfbUpdateTimer.start(50ms);
|
||||
}
|
||||
d->clients.insert(cc);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "rfb.h"
|
||||
#include "framebuffer.h"
|
||||
#include <QObject>
|
||||
#include <QVariantMap>
|
||||
|
||||
class RfbClient;
|
||||
struct RfbServerManagerStatic;
|
||||
@@ -35,6 +36,7 @@ public:
|
||||
static RfbServerManager *instance();
|
||||
|
||||
QSharedPointer<FrameBuffer> framebuffer() const;
|
||||
static QVariantMap s_pluginArgs;
|
||||
Q_SIGNALS:
|
||||
void clientConnected(RfbClient *cc);
|
||||
void clientDisconnected(RfbClient *cc);
|
||||
|
||||
@@ -41,11 +41,11 @@ public:
|
||||
virtual ~ClientActions();
|
||||
|
||||
private:
|
||||
QMenu *m_menu;
|
||||
QAction *m_title;
|
||||
QAction *m_disconnectAction;
|
||||
QAction *m_enableControlAction;
|
||||
QAction *m_separator;
|
||||
QMenu *m_menu = nullptr;
|
||||
QAction *m_title = nullptr;
|
||||
QAction *m_disconnectAction = nullptr;
|
||||
QAction *m_enableControlAction = nullptr;
|
||||
QAction *m_separator = nullptr;
|
||||
};
|
||||
|
||||
ClientActions::ClientActions(RfbClient* client, QMenu* menu, QAction* before)
|
||||
|
||||
Reference in New Issue
Block a user