Compare commits

...

72 Commits

Author SHA1 Message Date
l10n daemon script
08e2d13758 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-25 02:31:15 +00:00
Heiko Becker
4b7734a726 GIT_SILENT Upgrade release service version to 21.11.90. 2021-11-22 23:39:55 +01:00
Heiko Becker
6794b9d9fb Fix clean parallel build
The newly introduced krfb-virtualmonitor also needs
ui_connectionwidget.h (via rfbclient -> connectiondialog) and fails
with "krfb/connectiondialog.h:25:10: fatal error: ui_connectionwidget.h:
No such file or directory #include "ui_connectionwidget.h" when doing
a clean build with a high enough number of jobs.
Fix it by introducing a krfb_UI_SRCS variable, which is used by both
executable targets.
2021-11-16 22:25:56 +01:00
l10n daemon script
cf2d198c1f SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-14 02:27:52 +00:00
l10n daemon script
7285574c74 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-12 02:30:26 +00:00
l10n daemon script
899bc892c3 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-10 02:23:29 +00:00
Heiko Becker
4815017e04 GIT_SILENT Upgrade release service version to 21.11.80. 2021-11-08 20:22:43 +01:00
l10n daemon script
ba8a97b7c8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-07 01:13:33 +00:00
l10n daemon script
f7b690ea7d SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-04 01:17:08 +00:00
Aleix Pol
1d23966d79 pipewire: Support SPA_META_VideoDamage
Inform about the regions that changed so everything doesn't need to be
sent on every frame.
2021-11-03 14:28:54 +00:00
Aleix Pol
61d464676c pipewire: Support cursors 2021-11-03 14:28:54 +00:00
Aleix Pol
775d3c7a97 Let the framebuffer provide the cursor position
In the piperwire case, we get it through pipewire, not QCursor. Still
default to QCursor for xcb and qt backends.
2021-11-03 14:28:54 +00:00
l10n daemon script
18f98326d4 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-02 01:13:56 +00:00
l10n daemon script
0b65306f15 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-11-01 01:17:59 +00:00
Heiko Becker
4a2c13135d GIT_SILENT Update Appstream for new release
(cherry picked from commit 874c804ab8)
2021-10-31 11:32:38 +01:00
l10n daemon script
5860226875 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-10-31 01:13:15 +00:00
Yuri Chornoivan
f30d0b65e3 Fix minor typo 2021-10-30 19:16:40 +03:00
Aleix Pol
4707bde236 Introduce krfb-virtualmonitor
It implements a KWin protocol that is oriented towards serving a virtual
display specifically.
It requests KWin a stream that will act as a monitor that we can feed
into remote clients.
2021-10-29 14:05:34 +00:00
Aleix Pol
608762c7ac Allow passing plugin backends some arguments
WId is irrelevant on Wayland and it doesn't fully describe everything we
might be doing, we can pass a variant map to make sure all necessary
information is provided.
2021-10-29 14:05:34 +00:00
Laurent Montel
be01a1e42b GIT_SILENT: add missing override 2021-10-27 06:46:58 +02:00
Aleix Pol
00c3d1c2ed Add missing includes 2021-10-14 15:46:24 +02:00
Aleix Pol
a90970900a Fix API deprecation warning 2021-10-14 13:41:16 +00:00
Aleix Pol
d1e7614716 Also set the IPv6 port when setting the port
Otherwise we only use the requested port for IPv4 and IPv6 remains the
default.
2021-10-14 13:41:16 +00:00
Aleix Pol
2127fc927d Enable rfb logging together with the debug category of the app
So that if a user enables debug (it needs to be done explicitly as we
default to Info), they also get the underlying logs.
2021-10-14 13:41:16 +00:00
Aleix Pol
9d5d45c7af PendingRfbClient: Include its own QSocketNotifier
Instead of keeping it in its only subclass PendingInvitationsRfbClient.
The notifier is necessary for pending clients overall and entirely
unrelated to the task of PendingInvitationsRfbClient.
2021-10-14 13:41:16 +00:00
Aleix Pol
b4eccc2134 pipewire: Use C99
Reduces the amount of warnings we get
2021-10-14 13:41:16 +00:00
l10n daemon script
97cbf48059 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-10-12 01:17:15 +00:00
l10n daemon script
c8207581f4 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-10-11 01:18:41 +00:00
Nicolas Fella
4727061d74 Add Linux and FreeBSD CI 2021-10-07 13:22:55 +02:00
Heiko Becker
3bf587a097 GIT_SILENT Update Appstream for new release
(cherry picked from commit 13316b761d)
2021-10-05 00:29:55 +02:00
Laurent Montel
26c468009f GIT_SILENT: remove .arcconfig 2021-10-02 09:51:38 +02:00
Laurent Montel
fb909eadf4 Add .kde-ci.yml 2021-09-30 13:31:20 +02:00
l10n daemon script
f72674db18 GIT_SILENT made messages (after extraction) 2021-09-10 00:17:48 +00:00
Laurent Montel
df9e6d62d2 use nullptr 2021-08-31 08:46:39 +02:00
Laurent Montel
b55de9645e Use std::chrono_literals 2021-08-31 08:46:39 +02:00
Laurent Montel
a9241dfe88 We can use std::as_const 2021-08-31 08:46:39 +02:00
Laurent Montel
23c0218f3d GIT_SILENT: time to increase version 2021-08-31 08:46:39 +02:00
Heiko Becker
4a524c6f0a GIT_SILENT Update Appstream for new release
(cherry picked from commit 99ef2060a8)
2021-08-27 23:13:18 +02:00
Heiko Becker
cb86f9c018 GIT_SILENT Update Appstream for new release
(cherry picked from commit 08bac276d3)
2021-08-05 00:06:47 +02:00
l10n daemon script
0eaf1bc550 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-07-19 01:15:25 +00:00
l10n daemon script
cb7164d755 GIT_SILENT made messages (after extraction) 2021-07-19 00:17:20 +00:00
Albert Astals Cid
75bff9d5f9 GIT_SILENT Upgrade release service version to 21.11.70. 2021-07-10 20:21:28 +02:00
Laurent Montel
c729e9e048 Modernize code 2021-07-09 08:53:14 +02:00
Laurent Montel
45548e020a Add missing override + add nullptr 2021-07-09 08:53:14 +02:00
Laurent Montel
dc64af6f5e Remove code for old qt version 2021-07-09 08:53:14 +02:00
Laurent Montel
2af26baf56 GIT_SILENT: time to increase version 2021-07-09 08:53:14 +02:00
Laurent Montel
e07f2c1f11 GIT_SILENT: ignore file 2021-07-09 08:53:14 +02:00
Laurent Montel
e5e2b293e8 GIT_SILENT: add support for cmake preset support 2021-07-09 08:53:14 +02:00
Heiko Becker
6cb2b22bf6 GIT_SILENT Update Appstream for new release
(cherry picked from commit 464d1a60a1)
2021-07-05 21:21:15 +02:00
Friedrich W. H. Kossebau
0316c376f2 Port away from deprecated KDNSSD CamelCase include prefixes
GIT_SILENT
2021-06-21 15:37:01 +02:00
Aleix Pol
b8f972d59e Fix crash when the destination stride != source stride
When we allocate the locally mapped texture size, use the announced
stride (aka bytes per line) instead of the texture width. Otherwise we
might overflow and crash eventually.

BUG: 438815
2021-06-17 21:03:56 +02:00
l10n daemon script
073cec3dc3 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-06-16 01:23:07 +00:00
l10n daemon script
58088b6ca0 GIT_SILENT made messages (after extraction) 2021-06-16 00:18:37 +00:00
Heiko Becker
a4cc0e8e7b GIT_SILENT Update Appstream for new release
(cherry picked from commit d04a36023a)
2021-06-05 23:20:56 +02:00
Ömer Fadıl Usta
3a1a5ad7a2 Add missing check for HAVE_DMA_BUF 2021-06-03 09:15:48 +00:00
Ömer Fadıl Usta
8e667abe69 Fix typo on epoxy variablename revert ifdef back to if 2021-06-03 09:05:48 +00:00
Ömer Fadıl Usta
2e82546012 Fix cmakedefine parts and increase cmake version 2021-06-03 07:30:29 +00:00
Ömer Fadıl Usta
6f342f45ae fix HAVE_DMA_BUF definition 2021-06-03 00:45:07 +00:00
Jan Grulich
acc70e4cee PipeWire support improvements 2021-06-02 12:25:00 +00:00
Alexander Lohnau
4d84d14070 Clean up ServiceType property usage for JSON based plugins
Task: https://phabricator.kde.org/T14483
2021-05-22 14:17:40 +00:00
Alexander Lohnau
adc8b8069c Remove obsolete desktop file
These files already have a JSON equivalent in the source dir.
2021-05-22 14:17:40 +00:00
Alexander Lohnau
218f0e20f6 Use separate install dir for different plugins
The service types are deprecated and not needed anymore when using the
JSON metadata. Instead install the different plugin types into dedicated
dirs, this way there is not additional filtering needed.
2021-05-22 14:17:40 +00:00
Jan Grulich
4f2861415a Revert "Improve PipeWire code"
This reverts commit eb1dc503bd.

Revert "Add dma-buf defines to build dma-buf support everywhere"

This reverts commit 8f0de62401.

Revert "Drop support for PipeWire 0.2"

This reverts commit 028ac099ea.

These were accidentally pushed without review. They were meant
to be pushed to my fork instead.
2021-05-21 14:12:23 +02:00
Jan Grulich
eb1dc503bd Improve PipeWire code
- add support for VideoCrop metadata
- add support for memptr buffer type
2021-05-21 14:09:10 +02:00
Jan Grulich
8f0de62401 Add dma-buf defines to build dma-buf support everywhere 2021-05-21 09:31:51 +02:00
Jan Grulich
028ac099ea Drop support for PipeWire 0.2 2021-05-21 09:22:45 +02:00
l10n daemon script
5e18689b8e GIT_SILENT made messages (after extraction) 2021-05-10 00:20:04 +00:00
Heiko Becker
68866dc4fa GIT_SILENT Update Appstream for new release
(cherry picked from commit 4a36c727c2)
2021-05-07 20:36:21 +02:00
l10n daemon script
15f5654e5b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-04-25 01:20:50 +00:00
l10n daemon script
76e36c0761 GIT_SILENT made messages (after extraction) 2021-04-25 00:18:35 +00:00
Heiko Becker
0afcfc82b9 GIT_SILENT Update Appstream for new release
(cherry picked from commit 5959b4690d)
2021-04-14 17:25:03 +02:00
Albert Astals Cid
730e4d74a8 GIT_SILENT Upgrade release service version to 21.07.70. 2021-03-13 22:21:04 +01:00
66 changed files with 1404 additions and 767 deletions

View File

@@ -1,3 +0,0 @@
{
"phabricator.uri" : "https://phabricator.kde.org/"
}

26
.gitignore vendored Normal file
View 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
View 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
View 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

View File

@@ -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 "11")
set (RELEASE_SERVICE_VERSION_MICRO "90")
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
View 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}
}
]
}

View File

@@ -0,0 +1,2 @@
# SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
# SPDX-License-Identifier: BSD-3-Clause

View File

@@ -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
View 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."
)

View File

@@ -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)

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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;

View File

@@ -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
)

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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;

View File

@@ -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
)

View File

@@ -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

View File

@@ -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;

View File

@@ -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()) {

View File

@@ -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)

View 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);
}

View 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;
};

View File

@@ -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
)

View File

@@ -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"
}

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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
)

View File

@@ -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"
}

View File

@@ -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(

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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

View File

@@ -9,3 +9,6 @@
/* Define if XShm is available */
#cmakedefine HAVE_XSHM 1
/* Define if DMA-BUF support is available */
#cmakedefine01 HAVE_DMA_BUF

View File

@@ -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);

View File

@@ -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;

View File

@@ -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();

View File

@@ -43,7 +43,7 @@ class KRFBPRIVATE_EXPORT EventsManager : public QObject
public:
static EventsManager *instance();
virtual ~EventsManager();
~EventsManager() override;
QSharedPointer<EventHandler> eventHandler();

View File

@@ -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;
};

View File

@@ -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();
}

View File

@@ -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();

View File

@@ -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());

View File

@@ -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)

View File

@@ -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

View File

@@ -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";

View File

@@ -37,7 +37,6 @@ public:
protected Q_SLOTS:
void processNewClient() override;
virtual void onSocketActivated();
bool checkPassword(const QByteArray & encryptedPassword) override;
private Q_SLOTS:

View File

@@ -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(

View File

@@ -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

View File

@@ -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",

View File

@@ -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

View File

@@ -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",

View 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();
}

View File

@@ -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"));

View File

@@ -43,7 +43,7 @@ class MainWindow : public KXmlGuiWindow
private:
Ui::MainWidget m_ui;
bool m_passwordEditable;
QLineEdit *m_passwordLineEdit;
QLineEdit *m_passwordLineEdit = nullptr;
};
#endif

View File

@@ -43,11 +43,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>
@@ -62,6 +65,7 @@
<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 +80,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>
@@ -143,9 +148,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.08.3" date="2021-11-04"/>
<release version="21.08.2" date="2021-10-07"/>
<release version="21.08.1" date="2021-09-02"/>
<release version="21.08.0" date="2021-08-12"/>
</releases>
</component>

View File

@@ -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)
@@ -97,6 +99,7 @@ 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]=مشاركة سطح المكتب

View File

@@ -0,0 +1,42 @@
# 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[es]=Monitor virtual de KRFB
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[sl]=Navidezni monitor KRFB
Name[sv]=Krfb:s virtuella bildskärm
Name[uk]=Віртуальний монітор KRFB
Name[x-test]=xxKRFBs Virtual Monitorxx
Comment=Remote Virtual Monitor
Comment[ca]=Monitor virtual remot
Comment[ca@valencia]=Monitor virtual remot
Comment[el]=Απομακρυσμένη εικονική οθόνη
Comment[es]=Monitor virtual remoto
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[sl]=Oddaljeni navidezni monitor
Comment[sv]=Virtuell fjärrbildskärm
Comment[uk]=Віддалений віртуальний монітор
Comment[x-test]=xxRemote Virtual Monitorxx
NoDisplay=true
X-KDE-Wayland-Interfaces=zkde_screencast_unstable_v1

View File

@@ -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;
}
}
}

View File

@@ -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

View File

@@ -117,6 +117,7 @@ bool RfbServer::start()
}
d->screen->port = listeningPort();
d->screen->ipv6port = listeningPort();
// Disable/Enable password checking
if (passwordRequired()) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)