1
0
mirror of https://github.com/KDE/krfb synced 2026-07-02 00:01:18 -07:00

Compare commits

...

110 Commits

Author SHA1 Message Date
Nicolas Fella
52c5d2248f Fix nativeEventFilter signature when building against Qt6 2022-08-03 21:22:51 +02:00
Nicolas Fella
0ff18b64bc Fix includes for QX11Info when using Qt6 2022-08-03 21:20:32 +02:00
Nicolas Fella
7c367c0fac Adapt build system for building against Qt6 2022-08-03 21:19:35 +02:00
Nicolas Fella
6a4a925a2e Use correct KWallet include 2022-08-03 21:15:07 +02:00
Nicolas Fella
7b3a50e9bf Remove unused include 2022-08-03 21:14:34 +02:00
Friedrich W. H. Kossebau
5173e7ff29 Port away from deprecated KMessageBox::about()
GIT_SILENT
2022-07-16 01:03:44 +02:00
Friedrich W. H. Kossebau
745a5d53f2 Use ECMDeprecationSettings
GIT_SILENT
2022-07-16 01:01:12 +02:00
Friedrich W. H. Kossebau
ce0d6fe648 Adapt min Qt version to one implied by current min KF version
GIT_SILENT
2022-07-16 00:59:26 +02:00
Friedrich W. H. Kossebau
42ed3c5707 Remove definitions duplicated from KDE_COMPILERSETTINGS_LEVEL 5.91
GIT_SILENT
2022-07-16 00:58:55 +02:00
Albert Astals Cid
2cd15b6313 GIT_SILENT Upgrade release service version to 22.11.70. 2022-07-13 00:04:53 +02:00
l10n daemon script
d1d085008a 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"
2022-07-06 01:45:10 +00:00
l10n daemon script
00725ca11b GIT_SILENT made messages (after extraction) 2022-07-06 00:45:53 +00:00
Heiko Becker
e3e1571cea GIT_SILENT Update Appstream for new release
(cherry picked from commit cc61c6a8b3)
2022-07-01 21:16:16 +02:00
l10n daemon script
b9dd0ac0d6 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"
2022-06-30 01:44:45 +00:00
l10n daemon script
9dfca797dd GIT_SILENT made messages (after extraction) 2022-06-30 00:45:07 +00:00
Laurent Montel
720478a317 Add missing override 2022-06-28 22:30:15 +02:00
l10n daemon script
60161dacf8 GIT_SILENT made messages (after extraction) 2022-06-25 00:48:43 +00:00
Laurent Montel
18591e967c Remove extra ';' 2022-06-23 06:48:58 +02:00
l10n daemon script
4d65b52b47 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"
2022-06-22 01:43:36 +00:00
l10n daemon script
44336093da 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"
2022-06-13 02:27:19 +00:00
l10n daemon script
df10a81baa GIT_SILENT made messages (after extraction) 2022-06-13 01:02:08 +00:00
l10n daemon script
172229294c 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"
2022-06-07 02:13:20 +00:00
l10n daemon script
3d614c2bd6 GIT_SILENT made messages (after extraction) 2022-06-07 00:53:24 +00:00
Heiko Becker
58d47d3947 GIT_SILENT Update Appstream for new release
(cherry picked from commit ff6b291d50)
2022-06-04 10:53:24 +02:00
l10n daemon script
a03b8db322 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"
2022-05-28 02:14:23 +00:00
Albert Astals Cid
ea5d2f40bc Add ki18n_install and kdoctools_install 2022-05-22 00:58:20 +02:00
Nicolas Fella
22420a22af Raise window when activating running instance 2022-05-15 19:26:42 +02:00
Heiko Becker
6f1d60b3ba GIT_SILENT Update Appstream for new release
(cherry picked from commit d4d400624c)
2022-05-07 12:02:15 +02:00
Laurent Montel
8365e97f9a Remove duplicate header between header cpp file 2022-05-05 07:04:45 +02:00
Antonio Rojas
f1da76277e Remove %i parameter from Exec line
It breaks launching the application on Wayland
2022-05-02 18:11:02 +02:00
l10n daemon script
ba4329d9b7 GIT_SILENT made messages (after extraction) 2022-05-01 00:49:09 +00:00
l10n daemon script
17d3f53561 GIT_SILENT made messages (after extraction) 2022-04-25 00:45:49 +00:00
Alexander Lohnau
fbf4fcbce0 Derive plugin id from filename, clean up json files
We ignore the name/description and only display the id in the ui.
To make sure the is are the same, the OUTPUT_NAME cmake target property is set.
Otherwise, we would need a json file with the KPlugin object and then the id in it, which is
unnecessary work for sth. that can be done in a single line.

Having the file base name and id differ is also discouraged, see https://phabricator.kde.org/T14499
2022-04-23 19:18:18 +00:00
Alexander Lohnau
5158d14147 Simplify iterator usage and make it with rest of KDE code consistent 2022-04-23 19:18:18 +00:00
Alexander Lohnau
c7ee6f1e0e Drop empty deconstructors of plugins
We have one defined in the base class, consequently we do not violate the rule of life when removing the empty ones
2022-04-23 19:18:18 +00:00
Alexander Lohnau
0d8cc44ec2 Simplify plugin declaration using K_PLUGIN_CLASS_WITH_JSON
This way we do not need to take care of setting the factory name and typing out the registration manually
2022-04-23 19:18:18 +00:00
Alexander Lohnau
d7c559b017 Clean up plugin loading code
- We do not need to manually check for duplicates
- Improve the error message while at it
- Remove the internal utility-method since the code is super small now
2022-04-23 19:18:18 +00:00
l10n daemon script
fcebbfb2d4 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"
2022-04-20 01:41:07 +00:00
l10n daemon script
d45679bdbd 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"
2022-04-19 01:44:50 +00:00
Alexander Lohnau
a58c787986 Clean up unneeded json/desktop files
Converting a servicetype to json does not make sense and we do not use the file anywhere.
With us also not using KServiceTypeTrader for the plugin loading, we can get rid of the servicetype desktop files.
2022-04-18 09:28:16 +02:00
Heiko Becker
96f164c67d GIT_SILENT Update Appstream for new release
(cherry picked from commit b2e736c21a)
2022-04-12 23:57:07 +02:00
l10n daemon script
9b634ae795 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"
2022-04-01 01:58:36 +00:00
l10n daemon script
a80f5f140d GIT_SILENT made messages (after extraction) 2022-04-01 00:51:17 +00:00
Andreas Sturmlechner
4a6970d684 Make KF5Wayland optional behind existing DISABLE_PIPEWIRE
We have an option so let's be consistent.

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
2022-03-24 20:41:36 +03:00
Albert Astals Cid
e2f3910f7a GIT_SILENT Upgrade release service version to 22.07.70. 2022-03-12 13:18:43 +01:00
Aleix Pol
c14d37e56f virtualmonitor: Return 1 if it failed to start 2022-03-08 02:24:19 +00:00
l10n daemon script
2d391672e5 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"
2022-03-05 01:43:41 +00:00
Heiko Becker
64252e52f6 GIT_SILENT Update Appstream for new release
(cherry picked from commit ef32c9266a)
2022-02-27 19:36:20 +01:00
l10n daemon script
a4fed2f0d5 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"
2022-02-27 01:52:27 +00:00
l10n daemon script
70488a7b59 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"
2022-02-17 01:51:20 +00:00
Laurent Montel
78205f9116 Make it compile without deprecated methods 2022-02-12 10:52:31 +01:00
l10n daemon script
59db6f6b7b GIT_SILENT made messages (after extraction) 2022-02-06 00:47:00 +00:00
Heiko Becker
18e76cfc0c GIT_SILENT Update Appstream for new release
(cherry picked from commit fa7bbbc872)
2022-01-29 00:24:20 +01:00
Luke Dashjr
1222c2067c Add CMake option DISABLE_PIPEWIRE to skip dependency check 2022-01-24 01:35:21 +00:00
Alexey Minnekhanov
25f5492f33 Port away from deprecated methods
Fixes thigs like:
warning: ‘static QVector<KPluginMetaData> KPluginLoader::findPlugins(
  const QString&, std::function<bool(const KPluginMetaData&)>)’
  is deprecated: Since 5.86.
  Use KPluginMetaData::findPlugins instead [-Wdeprecated-declarations]
2022-01-11 22:43:59 +00:00
Jan Grulich
96eb21da35 PipeWire fb: process cursor metadata even for empty buffer
It is possible to have zero data in the buffer, but have the
buffer to carry metadata about the mouse cursor. In that case
we should try to process the cursor metadata before we discard
the buffer for not having any data.
2022-01-05 11:39:29 +01:00
Heiko Becker
cf5f045cab GIT_SILENT Update Appstream for new release
(cherry picked from commit 1d5bf08467)
2022-01-03 22:55:25 +01:00
l10n daemon script
dce8e6dc85 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"
2022-01-02 01:56:58 +00:00
l10n daemon script
1e5ff7f93a 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-12-31 01:40:11 +00:00
Nicolas Fella
6bec921ec0 Remove dead CMake code 2021-12-29 01:44:42 +01:00
Alexey Minnekhanov
b13a8e9613 fix build warning in VirtualMonitorRfbServer
mark VirtualMonitorRfbServer:newClient() as oveeride

fixes warning:
krfb/main-virtualmonitor.cpp:67:23: warning:
 ‘virtual PendingRfbClient* VirtualMonitorRfbServer::newClient(rfbClientPtr)’
 can be marked override [-Wsuggest-override]
   67 |     PendingRfbClient *newClient(rfbClientPtr client) {
      |                       ^~~~~~~~~
2021-12-24 02:00:50 +03:00
Albert Astals Cid
8a1261191f GIT_SILENT Update Appstream for new release
(cherry picked from commit 39b068b143)
2021-12-09 17:31:10 +01:00
l10n daemon script
dddb12708d 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-26 01:25:48 +00:00
l10n daemon script
384cfdcbed 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 01:30:05 +00:00
l10n daemon script
9b26c11c2f GIT_SILENT made messages (after extraction) 2021-11-21 00:27:53 +00:00
Heiko Becker
2c6cb1e6f5 Merge remote-tracking branch 'origin/release/21.12' 2021-11-17 09:19:01 +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
a0fd0c3a31 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 01:28:24 +00:00
l10n daemon script
6a01a98c9f 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-13 01:25:23 +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
l10n daemon script
30455f6308 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-09 01:21:09 +00:00
Heiko Becker
cbafc2fdad GIT_SILENT Upgrade release service version to 22.03.70. 2021-11-08 20:54:20 +01: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
61 changed files with 901 additions and 843 deletions

View File

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

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.16)
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "07")
set (RELEASE_SERVICE_VERSION_MAJOR "22")
set (RELEASE_SERVICE_VERSION_MINOR "11")
set (RELEASE_SERVICE_VERSION_MICRO "70")
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.15.0)
set(KF5_MIN_VERSION 5.83.0)
set(QT_MIN_VERSION 5.15.2)
set(KF5_MIN_VERSION 5.91.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})
@@ -21,12 +21,17 @@ include(ECMInstallIcons)
include(ECMAddAppIcon)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(FeatureSummary)
include(CheckIncludeFile)
check_include_file("linux/input.h" HAVE_LINUX_INPUT_H)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Widgets X11Extras)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Widgets)
if(QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5X11Extras REQUIRED)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
I18n
@@ -60,17 +65,9 @@ if(WIN32)
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
endif(WIN32)
add_definitions(
-DQT_DEPRECATED_WARNINGS
-DQT_DISABLE_DEPRECATED_BEFORE=0x050600
-DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_TO_ASCII
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_STRICT_ITERATORS
-DQT_NO_URL_CAST_FROM_STRING
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
ecm_set_disabled_deprecation_versions(
QT 5.15.2
KF 5.91
)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
@@ -78,8 +75,20 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
find_package(LibVNCServer REQUIRED)
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
option(DISABLE_PIPEWIRE "Disable PipeWire support." OFF)
if(NOT DISABLE_PIPEWIRE)
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
endif()
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(KF5Wayland ${KF5_MIN_VERSION})
find_package(QtWaylandScanner REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}WaylandClient)
find_package(Qt${QT_MAJOR_VERSION}XkbCommonSupport)
find_package(Wayland REQUIRED COMPONENTS Client)
endif()
find_package(gbm)
set_package_properties(gbm PROPERTIES
@@ -115,18 +124,15 @@ include_directories ("${CMAKE_CURRENT_BINARY_DIR}/krfb"
"${CMAKE_CURRENT_SOURCE_DIR}/krfb/ui"
)
if(Q_WS_X11)
if(NOT X11_XTest_FOUND)
message(FATAL_ERROR "krfb requires the libXtst (https://xorg.freedesktop.org) to be built")
endif(NOT X11_XTest_FOUND)
endif(Q_WS_X11)
add_subdirectory(events)
add_subdirectory(krfb)
add_subdirectory(framebuffers)
add_subdirectory(doc)
add_subdirectory(icons)
ki18n_install(po)
kdoctools_install(po)
ecm_qt_install_logging_categories(
EXPORT KRFB
FILE krfb.categories

View File

@@ -14,5 +14,6 @@ target_link_libraries (krfb_events_x11
KF5::CoreAddons
krfbprivate
)
set_target_properties(krfb_events_x11 PROPERTIES OUTPUT_NAME x11)
install (TARGETS krfb_events_x11 DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events)

View File

@@ -1,66 +0,0 @@
{
"Encoding": "UTF-8",
"KPlugin": {
"Description": "X11 XFakeInput based event handler for KRfb",
"Description[ca@valencia]": "Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb",
"Description[ca]": "Gestor d'esdeveniments basat en «XFakeInput» de l'X11 per al KRfb",
"Description[da]": "X11 XFakeInput baseret hændelseshåndtering til KRfb",
"Description[de]": "Ereignis-Modul basierend auf X11 XFakeInput für KRfb",
"Description[el]": "Χειριστής γεγονότων με βάση το X11 XFakeInput για το KRfb",
"Description[en_GB]": "X11 XFakeInput based event handler for KRfb",
"Description[es]": "Gestor de eventos basado en XFakeInput de X11 para KRfb",
"Description[et]": "KRfb X11 XFakeInput'i põhine sündmuste käitleja",
"Description[eu]": "KRfb-rako «X11 XFakeInput»en oinarritutako gertaera maneiatzailea",
"Description[fi]": "KRfb:n X11 XFakeInput -pohjainen tapahtumakäsittelijä",
"Description[fr]": "Gestionnaire d'évènements utilisant XFakeInput de X11 pour KRfb",
"Description[gl]": "Xestor de eventos para KRfb baseado no XFakeInput de X11",
"Description[ia]": "Maneator de evento de X11 basate sur XFakeInput per KRfb",
"Description[it]": "Gestore eventi basato su XFakeInput di X11 per KRfb",
"Description[ko]": "X11 XFakeInput 기반 KRfb 이벤트 핸들러",
"Description[nl]": "Op X11 XFakeInput gebaseerde behandelaar van gebeurtenis voor KRfb",
"Description[nn]": "X11 XFakeInput-basert hendingshandtering for KRfb",
"Description[pl]": "Obsługa wydarzeń X11 oparta na XFakeInput dla KRfb",
"Description[pt]": "Tratamento de eventos baseado no XFakeInput do X11 para o KRfb",
"Description[pt_BR]": "Manipulador de eventos baseado no XFakeInput do X11 para o KRfb",
"Description[sk]": "X11 Spracovateľ udalostí založený na XFakeInput pre KRfb",
"Description[sl]": "Upravljavec dogodkov za KRfb na osnovi X11 XFakeInput",
"Description[sv]": "Händelsehanterare för KRfb baserad på X11 XFakeInput",
"Description[uk]": "Обробник подій для KRfb на основі XFakeInput X11",
"Description[x-test]": "xxX11 XFakeInput based event handler for KRfbxx",
"Description[zh_CN]": "基于 X11 XFakeInput 的 KRfb 事件处理器",
"Description[zh_TW]": "KRfb 基於 X11 XFakeInput 的事件處理器",
"EnabledByDefault": true,
"Id": "x11",
"License": "GPL",
"Name": "X11 Event handler for KRfb",
"Name[ca@valencia]": "Gestor d'esdeveniments de l'X11 per al KRfb",
"Name[ca]": "Gestor d'esdeveniments de l'X11 per al KRfb",
"Name[da]": "X11 hændelseshåndtering til KRfb",
"Name[de]": "Ereignis-Modul basierend auf X11 für KRfb",
"Name[el]": "Χειριστής γεγονότων X11 για το KRfb",
"Name[en_GB]": "X11 Event handler for KRfb",
"Name[es]": "Gestor de eventos de X11 para KRfb",
"Name[et]": "KRfb X11 sündmuste käitleja",
"Name[eu]": "KRfb-rako X11 gertaera maneiatzailea",
"Name[fi]": "KRfb:n X11-tapahtumakäsittelijä",
"Name[fr]": "Gestionnaire d'évènements X11 pour KRfb",
"Name[gl]": "Xestor de eventos de X11 para KRfb",
"Name[ia]": "Manipulator de evento de X11 per KRfb",
"Name[it]": "Gestore eventi X11 per KRfb",
"Name[ko]": "KRfb X11 이벤트 핸들러",
"Name[nl]": "Op X11 behandelaar van gebeurtenis voor KRfb",
"Name[nn]": "X11-hendingshandsamar for KRfb",
"Name[pl]": "Obsługa wydarzeń X11 dla KRfb",
"Name[pt]": "Tratamento de eventos do X11 para o KRfb",
"Name[pt_BR]": "Manipulador de eventos do X11 para o KRfb",
"Name[sk]": "X11 Obsluha udalostí pre KRfb",
"Name[sl]": "Upravljavec dogodkov za KRfb na osnovi X11",
"Name[sv]": "X11-händelsehanterare för Krfb",
"Name[uk]": "Обробник подій для KRfb на основі X11",
"Name[x-test]": "xxX11 Event handler for KRfbxx",
"Name[zh_CN]": "X11 KRfb 事件处理器",
"Name[zh_TW]": "KRfb 的 X11 事件處理器",
"Version": "0.1",
"Website": "http://www.kde.org"
}
}

View File

@@ -22,7 +22,6 @@
#include "x11events.h"
#include <QApplication>
#include <QX11Info>
#include <QDesktopWidget>
#include <QGlobalStatic>
@@ -30,7 +29,11 @@
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <QtGui/private/qtx11extras_p.h>
#endif
enum {
LEFTSHIFT = 1,

View File

@@ -22,10 +22,14 @@
#include "x11events.h"
#include <KPluginFactory>
#include <QX11Info>
K_PLUGIN_FACTORY_WITH_JSON(X11EventsPluginFactory, "krfb_events_x11.json",
registerPlugin<X11EventsPlugin>();)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <QtGui/private/qtx11extras_p.h>
#endif
K_PLUGIN_CLASS(X11EventsPlugin)
X11EventsPlugin::X11EventsPlugin(QObject *parent, const QVariantList &args)
: EventsPlugin(parent, args)

View File

@@ -31,7 +31,6 @@ class X11EventsPlugin : public EventsPlugin
Q_OBJECT
public:
X11EventsPlugin(QObject *parent, const QVariantList &args);
virtual ~X11EventsPlugin() = default;
EventHandler *eventHandler() override;

View File

@@ -7,7 +7,7 @@ set (krfb_events_xdp_SRCS
xdpeventsplugin.cpp
)
qt5_add_dbus_interface(
qt_add_dbus_interface(
krfb_events_xdp_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
xdp_dbus_remotedesktop_interface
@@ -18,9 +18,10 @@ add_library (krfb_events_xdp MODULE ${krfb_events_xdp_SRCS})
target_link_libraries (krfb_events_xdp
KF5::CoreAddons
KF5::I18n
Qt5::DBus
Qt::DBus
krfbprivate
)
set_target_properties(krfb_events_xdp PROPERTIES OUTPUT_NAME xdp)
install (TARGETS krfb_events_xdp
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events

View File

@@ -1,66 +0,0 @@
{
"Encoding": "UTF-8",
"KPlugin": {
"Description": "Xdg-desktop-portal based event handler for KRfb",
"Description[ca@valencia]": "Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb",
"Description[ca]": "Gestor d'esdeveniments basat en «Xdg-desktop-portal» per al KRfb",
"Description[da]": "Xdg-desktop-portal baseret hændelseshåndtering til KRfb",
"Description[de]": "Ereignis-Modul basierend auf Xdg-desktop-portal für KRfb",
"Description[el]": "Χειριστής γεγονότων με βάση το xdg-desktop-portal για το KRfb",
"Description[en_GB]": "Xdg-desktop-portal based event handler for KRfb",
"Description[es]": "Gestor de eventos basado en Xdg-desktop-portal para KRfb",
"Description[et]": "KRfb Xdg-desktop-portal'i põhine sündmuste käitleja",
"Description[eu]": "KRfb-rako «xdg-desktop-portal»en oinarritutako maneiatzailea",
"Description[fi]": "KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä",
"Description[fr]": "Gestionnaire d'évènements utilisant Xdg-desktop-portal pour KRfb",
"Description[gl]": "Xestor de eventos para KRfb baseado en Xdg-desktop-portal",
"Description[ia]": "Maneator de evento basate sur Xdg-desktop-portal per KRfb",
"Description[it]": "Gestore eventi basato su xdg-desktop-portal per KRfb",
"Description[ko]": "Xdg-desktop-portal 기반 KRfb 이벤트 핸들러",
"Description[nl]": "Op Xdg-desktop-portal gebaseerde behandelaar van gebeurtenis voor KRfb",
"Description[nn]": "Xdg-desktop-portal-basert hendingshandtering for KRfb",
"Description[pl]": "Obsługa wydarzeń oparta na Xdg-desktop-portal dla KRfb",
"Description[pt]": "Tratamento de eventos baseado no Xdg-desktop-portal para o KRfb",
"Description[pt_BR]": "Manipulador de eventos baseado no xdg-desktop-portal para o KRfb",
"Description[sk]": "Obsluha udalostí založená na Xdg-desktop-portal pre KRfb",
"Description[sl]": "Upravljavec dogodkov, na osnovi portala Xdg-desktop za KRfb",
"Description[sv]": "Händelsehanterare för KRfb baserad på xdg-desktop-portal",
"Description[uk]": "Обробник подій для KRfb на основі Xdg-desktop-portal",
"Description[x-test]": "xxXdg-desktop-portal based event handler for KRfbxx",
"Description[zh_CN]": "基于 xdg-desktop-portal 的 KRfb 事件处理器",
"Description[zh_TW]": "KRfb 基於 Xdg-desktop-portal 的事件處理器",
"EnabledByDefault": true,
"Id": "xdp",
"License": "GPL",
"Name": "Xdg-desktop-portal Event handler for KRfb",
"Name[ca@valencia]": "Gestor d'esdeveniments «Xdg-desktop-portal» per al KRfb",
"Name[ca]": "Gestor d'esdeveniments «Xdg-desktop-portal» per al KRfb",
"Name[da]": "Xdg-desktop-portal 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 Event handler for KRfb",
"Name[es]": "Gestor de eventos de Xdg-desktop-portal para KRfb",
"Name[et]": "KRfb Xdg-desktop-portal'i sündmuste käitleja",
"Name[eu]": "KRfb-rako «xdg-desktop-portal» gertaera maneiatzailea",
"Name[fi]": "KRfb:n XDG-desktop-portal-pohjainen tapahtumakäsittelijä",
"Name[fr]": "Gestionnaire d'évènements Xdg-desktop-portal pour KRfb",
"Name[gl]": "Xestor de eventos de Xdg-desktop-portal para KRfb",
"Name[ia]": "Maneator de evento basate sur Xdg-desktop-portal per KRfb",
"Name[it]": "Gestore eventi xdg-desktop-portal per KRfb",
"Name[ko]": "KRfb Xdg-desktop-portal 이벤트 핸들러",
"Name[nl]": "Op Xdg-desktop-portal behandelaar van gebeurtenis voor KRfb",
"Name[nn]": "Xdg-desktop-portal-hendingshandtering for KRfb",
"Name[pl]": "Obsługa wydarzeń Xdg-desktop-portal dla KRfb",
"Name[pt]": "Tratamento de eventos do Xdg-desktop-portal para o KRfb",
"Name[pt_BR]": "Manipulador de eventos xdg-desktop-portal para o KRfb",
"Name[sk]": "Xdg-desktop-portal Obsluha udalostí pre KRfb",
"Name[sl]": "Upravljavec dogodkov za KRfb na osnovi portala Xdg-desktop",
"Name[sv]": "Xdg-desktop-portal händelsehanterare för Krfb",
"Name[uk]": "Обробник подій для KRfb на основі Xdg-desktop-portal",
"Name[x-test]": "xxXdg-desktop-portal Event handler for KRfbxx",
"Name[zh_CN]": "xdg-desktop-portal KRfb 事件处理器",
"Name[zh_TW]": "KRfb 的 Xdg-desktop-portal 事件處理器",
"Version": "0.1",
"Website": "http://www.kde.org"
}
}

View File

@@ -27,7 +27,6 @@
#include <linux/input.h>
#include <QApplication>
#include <QDesktopWidget>
#include <QGlobalStatic>
class EventData

View File

@@ -25,8 +25,7 @@
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(XdpEventsPluginFactory, "krfb_events_xdp.json",
registerPlugin<XdpEventsPlugin>();)
K_PLUGIN_CLASS(XdpEventsPlugin)
XdpEventsPlugin::XdpEventsPlugin(QObject *parent, const QVariantList &args)
: EventsPlugin(parent, args)

View File

@@ -33,7 +33,6 @@ class XdpEventsPlugin : public EventsPlugin
Q_OBJECT
public:
XdpEventsPlugin(QObject *parent, const QVariantList &args);
virtual ~XdpEventsPlugin() = 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
@@ -16,13 +22,13 @@ ecm_qt_declare_logging_category(krfb_framebuffer_pw_SRCS
EXPORT KRFB
)
qt5_add_dbus_interface(
qt_add_dbus_interface(
krfb_framebuffer_pw_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_screencast_interface.xml
xdp_dbus_screencast_interface
)
qt5_add_dbus_interface(
qt_add_dbus_interface(
krfb_framebuffer_pw_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
xdp_dbus_remotedesktop_interface
@@ -32,12 +38,15 @@ add_library(krfb_framebuffer_pw
MODULE
${krfb_framebuffer_pw_SRCS}
)
set_property(TARGET krfb_framebuffer_pw PROPERTY C_STANDARD 99)
target_link_libraries(krfb_framebuffer_pw
Qt5::Core
Qt5::Gui
Qt5::DBus
Qt::Core
Qt::Gui
Qt::DBus
KF5::CoreAddons
KF5::WaylandClient
Wayland::Client
krfbprivate
PkgConfig::PipeWire
)
@@ -49,6 +58,7 @@ if (HAVE_DMA_BUF)
)
endif()
set_target_properties(krfb_framebuffer_pw PROPERTIES OUTPUT_NAME pw)
install (TARGETS krfb_framebuffer_pw
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)

View File

@@ -1,70 +0,0 @@
{
"Encoding": "UTF-8",
"KPlugin": {
"Description": "PipeWire based Framebuffer for KRfb.",
"Description[ca@valencia]": "«Framebuffer» basat en «PipeWire» per al KRfb.",
"Description[ca]": "«Framebuffer» basat en «PipeWire» per al KRfb.",
"Description[cs]": "Framebuffer založený na Pipe pro KRfb.",
"Description[da]": "PipeWire baseret framebuffer til KRfb.",
"Description[de]": "PipeWire-basierter Framebuffer für KRfb.",
"Description[el]": "Μνήμη ανανέωσης με βάση το pipewire για το KRfb.",
"Description[en_GB]": "PipeWire based Framebuffer for KRfb.",
"Description[es]": "Framebuffer basado en PipeWire para KRfb.",
"Description[et]": "KRfb PipeWire põhine kaadripuhver",
"Description[eu]": "KRfb-rako «PipeWire»n oinarritutako «Framebuffer».",
"Description[fi]": "KRfb:n PipeWire-pohjainen kehyspuskuri.",
"Description[fr]": "Tampon d'images utilisant PipeWire pour KRfb.",
"Description[gl]": "Búfer de fotograma para KRfb baseado en PipeWire.",
"Description[ia]": "Framebuffer basate sur PipeWire per KRfb.",
"Description[it]": "Framebuffer basato su PipeWire per KRfb.",
"Description[ko]": "KRfb용 PipeWire 기반 프레임버퍼입니다.",
"Description[nl]": "Op PipeWire gebaseerd framebuffer voor KRfb.",
"Description[nn]": "PipeWire-basert biletbuffer for KRfb.",
"Description[pl]": "Bufor ramki oparty na PipeWire dla KRfb.",
"Description[pt]": "'Framebuffer' baseado no PipeWire para o KRfb.",
"Description[pt_BR]": "Framebuffer baseado no PipeWire para o KRfb.",
"Description[ru]": "Буфер кадров для KRfb на базе Framebuffer",
"Description[sk]": "Framebuffer založený na PipeWire pre KRfb.",
"Description[sl]": "Slikovni medpomnilnik na osnovi PipeWire za KRfb.",
"Description[sv]": "Rambuffert för Krfb baserad på PipeWire",
"Description[uk]": "Буфер кадрів на основі PipeWire для KRfb.",
"Description[x-test]": "xxPipeWire based Framebuffer for KRfb.xx",
"Description[zh_CN]": "基于 PipeWire 的 KRfb 帧缓冲机制。",
"Description[zh_TW]": "KRfb 基於 PipeWire 的 Framebuffer。",
"EnabledByDefault": true,
"Id": "pw",
"License": "GPL3",
"Name": "PipeWire Framebuffer for KRfb",
"Name[ca@valencia]": "«Framebuffer» del «PipeWire» per al KRfb",
"Name[ca]": "«Framebuffer» del «PipeWire» per al KRfb",
"Name[cs]": "PipeWire Framebuffer pro KRfb",
"Name[da]": "PipeWire framebuffer til KRfb",
"Name[de]": "PipeWire-Framebuffer für KRfb",
"Name[el]": "Μνήμη ανανέωσης pipewire για το KRfb",
"Name[en_GB]": "PipeWire Framebuffer for KRfb",
"Name[es]": "Framebuffer de PipeWire para KRfb",
"Name[et]": "KRfb PipeWire kaadripuhver",
"Name[eu]": "KRfb-rako «PipeWire Framebuffer»",
"Name[fi]": "KRfb:n PipeWire-kehyspuskuri",
"Name[fr]": "Tampon d'images PipeWire pour KRfb",
"Name[gl]": "Búfer de fotograma de PipeWire para KRfb",
"Name[ia]": "Framebuffer de PipeWire per KRfb",
"Name[it]": "Framebuffer PipeWire per KRfb",
"Name[ko]": "KRfb용 PipeWire 프레임버퍼",
"Name[nl]": "PipeWire-framebuffer voor KRfb",
"Name[nn]": "PipeWire-biletbuffer for KRfb",
"Name[pl]": "Wtyczki buforów ramek PipeWire dla KRfb",
"Name[pt]": "'Framebuffer' do PipeWire para o KRfb",
"Name[pt_BR]": "Framebuffer PipeWire para o KRfb",
"Name[ru]": "Буфер кадров PipeWire для KRfb",
"Name[sk]": "PipeWire Framebuffer pre KRfb",
"Name[sl]": "Slikovni medpomnilnik za KRfb na osnovi PipeWire",
"Name[sv]": "PipeWire-rambuffert för Krfb",
"Name[uk]": "Буфер кадрів PipeWire для KRfb",
"Name[x-test]": "xxPipeWire Framebuffer for KRfbxx",
"Name[zh_CN]": "KRfb 的 PipeWire 帧缓冲机制",
"Name[zh_TW]": "KRfb 的 PipeWire Framebuffer",
"Version": "0.1",
"Website": "http://www.kde.org"
}
}

View File

@@ -22,6 +22,9 @@
#include <QDebug>
#include <QRandomGenerator>
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/registry.h>
// pipewire
#include <sys/ioctl.h>
@@ -38,6 +41,7 @@
#include "xdp_dbus_screencast_interface.h"
#include "xdp_dbus_remotedesktop_interface.h"
#include "krfb_fb_pipewire_debug.h"
#include "screencasting.h"
#if HAVE_DMA_BUF
#include <fcntl.h>
@@ -171,6 +175,10 @@ private:
// sanity indicator
bool isValid = true;
QImage cursorTexture;
QPoint cursorPosition;
QPoint cursorHotspot;
#if HAVE_DMA_BUF
struct EGLStruct {
QList<QByteArray> extensions;
@@ -552,6 +560,10 @@ void PWFrameBuffer::Private::onStreamStateChanged(void *data, pw_stream_state /*
}
}
#define CURSOR_BPP 4
#define CURSOR_META_SIZE(w,h) (sizeof(struct spa_meta_cursor) + \
sizeof(struct spa_meta_bitmap) + w * h * CURSOR_BPP)
/**
* @brief PWFrameBuffer::Private::onStreamFormatChanged - being executed after stream is set to active
* and after setup has been requested to connect to it. The actual video format is being negotiated here.
@@ -579,7 +591,6 @@ void PWFrameBuffer::Private::onStreamParamChanged(void *data, uint32_t id, const
auto builder = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
// setup buffers and meta header for new format
const struct spa_pod *params[3];
#if HAVE_DMA_BUF
const auto bufferTypes = d->m_eglInitialized ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr) :
@@ -588,23 +599,38 @@ void PWFrameBuffer::Private::onStreamParamChanged(void *data, uint32_t id, const
const auto bufferTypes = (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr);
#endif /* HAVE_DMA_BUF */
params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
QVector<const struct spa_pod *> params = {
reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
SPA_PARAM_BUFFERS_size, SPA_POD_Int(size),
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(8, 1, 32),
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(1),
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(bufferTypes)));
params[1] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int(bufferTypes))),
reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header))));
params[2] = reinterpret_cast<spa_pod*>(spa_pod_builder_add_object(&builder,
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))),
reinterpret_cast<spa_pod*>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type,
SPA_POD_Id(SPA_META_VideoCrop), SPA_PARAM_META_size,
SPA_POD_Int(sizeof(struct spa_meta_region))));
pw_stream_update_params(d->pwStream, params, 3);
SPA_POD_Int(sizeof(struct spa_meta_region)))),
reinterpret_cast<spa_pod*>(spa_pod_builder_add_object ( &builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id (SPA_META_Cursor),
SPA_PARAM_META_size, SPA_POD_CHOICE_RANGE_Int (CURSOR_META_SIZE (64, 64),
CURSOR_META_SIZE (1, 1),
CURSOR_META_SIZE (1024, 1024)))),
reinterpret_cast<spa_pod*>(spa_pod_builder_add_object ( &builder,
SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage),
SPA_PARAM_META_size, SPA_POD_CHOICE_RANGE_Int(
sizeof(struct spa_meta_region) * 16,
sizeof(struct spa_meta_region) * 1,
sizeof(struct spa_meta_region) * 16))),
};
pw_stream_update_params(d->pwStream, params.data(), params.size());
}
/**
@@ -638,13 +664,42 @@ void PWFrameBuffer::Private::onStreamProcess(void *data)
pw_stream_queue_buffer(d->pwStream, buffer);
}
static QImage::Format spaToQImageFormat(quint32 format)
{
return format == SPA_VIDEO_FORMAT_BGR ? QImage::Format_BGR888
: format == SPA_VIDEO_FORMAT_RGBx ? QImage::Format_RGBX8888
: QImage::Format_RGB32;
}
void PWFrameBuffer::Private::handleFrame(pw_buffer *pwBuffer)
{
auto spaBuffer = pwBuffer->buffer;
uint8_t *src = nullptr;
// process cursor
{
struct spa_meta_cursor *cursor = static_cast<struct spa_meta_cursor*>(spa_buffer_find_meta_data (spaBuffer, SPA_META_Cursor, sizeof (*cursor)));
if (spa_meta_cursor_is_valid (cursor)) {
struct spa_meta_bitmap *bitmap = nullptr;
if (cursor->bitmap_offset)
bitmap = SPA_MEMBER (cursor, cursor->bitmap_offset, struct spa_meta_bitmap);
if (bitmap && bitmap->size.width > 0 && bitmap->size.height > 0) {
const uint8_t *bitmap_data;
bitmap_data = SPA_MEMBER (bitmap, bitmap->offset, uint8_t);
cursorHotspot = { cursor->hotspot.x, cursor->hotspot.y };
cursorTexture = QImage(bitmap_data, bitmap->size.width, bitmap->size.height, bitmap->stride, spaToQImageFormat(bitmap->format));
}
cursorPosition = QPoint{ cursor->position.x, cursor->position.y };
}
}
if (spaBuffer->datas[0].chunk->size == 0) {
qCDebug(KRFB_FB_PIPEWIRE) << "discarding null buffer";
qCDebug(KRFB_FB_PIPEWIRE) << "Got empty buffer. The buffer possibly carried only "
"information about the mouse cursor.";
return;
}
@@ -824,15 +879,21 @@ void PWFrameBuffer::Private::handleFrame(pw_buffer *pwBuffer)
}
if (videoFormat->format != SPA_VIDEO_FORMAT_RGB) {
const QImage::Format format = videoFormat->format == SPA_VIDEO_FORMAT_BGR ? QImage::Format_BGR888
: videoFormat->format == SPA_VIDEO_FORMAT_RGBx ? QImage::Format_RGBX8888
: QImage::Format_RGB32;
QImage img((uchar*) q->fb, videoSize.width(), videoSize.height(), dstStride, format);
QImage img((uchar*) q->fb, videoSize.width(), videoSize.height(), dstStride, spaToQImageFormat(videoFormat->format));
img.convertTo(QImage::Format_RGB888);
}
q->tiles.append(QRect(0, 0, videoSize.width(), videoSize.height()));
if (spa_meta* vdMeta = spa_buffer_find_meta(spaBuffer, SPA_META_VideoDamage)) {
struct spa_meta_region *r;
spa_meta_for_each(r, vdMeta) {
if (!spa_meta_region_is_valid(r))
break;
q->tiles.append(QRect(r->region.position.x, r->region.position.y, r->region.size.width, r->region.size.height));
}
} else {
q->tiles.append(QRect(0, 0, videoSize.width(), videoSize.height()));
}
}
/**
@@ -904,10 +965,6 @@ PWFrameBuffer::PWFrameBuffer(WId winid, QObject *parent)
: FrameBuffer (winid, parent),
d(new Private(this))
{
// D-Bus is most important in init chain, no toys for us if something is wrong with XDP
// PipeWire connectivity is initialized after D-Bus session is started
d->initDbus();
fb = nullptr;
}
@@ -917,6 +974,38 @@ PWFrameBuffer::~PWFrameBuffer()
fb = nullptr;
}
void PWFrameBuffer::initDBus()
{
d->initDbus();
}
void PWFrameBuffer::startVirtualMonitor(const QString& name, const QSize& resolution, qreal dpr)
{
d->videoSize = resolution * dpr;
using namespace KWayland::Client;
auto connection = ConnectionThread::fromApplication(this);
if (!connection) {
qWarning() << "Failed getting Wayland connection from QPA";
QCoreApplication::exit(1);
return;
}
auto registry = new Registry(this);
connect(registry, &KWayland::Client::Registry::interfaceAnnounced, this, [this, registry, name, dpr, resolution] (const QByteArray &interfaceName, quint32 wlname, quint32 version) {
if (interfaceName != "zkde_screencast_unstable_v1")
return;
auto screencasting = new Screencasting(registry, wlname, version, this);
auto r = screencasting->createVirtualMonitorStream(name, resolution, dpr, Screencasting::Metadata);
connect(r, &ScreencastingStream::created, this, [this] (quint32 nodeId) {
d->pwStreamNodeId = nodeId;
d->initPw();
});
});
registry->create(connection);
registry->setup();
}
int PWFrameBuffer::depth()
{
return 32;
@@ -970,3 +1059,8 @@ bool PWFrameBuffer::isValid() const
{
return d->isValid;
}
QPoint PWFrameBuffer::cursorPosition()
{
return d->cursorPosition;
}

View File

@@ -33,6 +33,9 @@ public:
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

@@ -22,9 +22,7 @@
#include "pw_framebuffer.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(PWFrameBufferPluginFactory, "krfb_framebuffer_pw.json",
registerPlugin<PWFrameBufferPlugin>();)
K_PLUGIN_CLASS(PWFrameBufferPlugin)
PWFrameBufferPlugin::PWFrameBufferPlugin(QObject *parent, const QVariantList &args)
: FrameBufferPlugin(parent, args)
@@ -32,14 +30,18 @@ PWFrameBufferPlugin::PWFrameBufferPlugin(QObject *parent, const QVariantList &ar
}
PWFrameBufferPlugin::~PWFrameBufferPlugin()
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
{
}
//NOTE WId is irrelevant in Wayland
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id)
{
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

@@ -33,9 +33,8 @@ class PWFrameBufferPlugin: public FrameBufferPlugin
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() override
{
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() override
{
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

@@ -21,12 +21,13 @@ add_library(krfb_framebuffer_qt
)
target_link_libraries (krfb_framebuffer_qt
Qt5::Core
Qt5::Gui
Qt::Core
Qt::Gui
KF5::CoreAddons
krfbprivate
)
set_target_properties(krfb_framebuffer_qt PROPERTIES OUTPUT_NAME qt)
install (TARGETS krfb_framebuffer_qt
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)

View File

@@ -1,81 +0,0 @@
{
"KPlugin": {
"Description": "Qt based Framebuffer for KRfb.",
"Description[ca@valencia]": "«Framebuffer» basat en les Qt per al KRfb.",
"Description[ca]": "«Framebuffer» basat en les Qt per al KRfb.",
"Description[cs]": "Framebuffer založený na Qt pro KRfb.",
"Description[da]": "Qt-baseret framebuffer til KRfb.",
"Description[de]": "Qt-basierter Framebuffer für KRfb.",
"Description[el]": "Μνήμη ανανέωσης βίντεο με βάση τhn Qt για το KRfb.",
"Description[en_GB]": "Qt based Framebuffer for KRfb.",
"Description[es]": "Framebuffer basado en Qt para KRfb.",
"Description[et]": "KRfb Qt põhine kaadripuhver",
"Description[eu]": "KRfb-rako Qt-n oinarritutako «Framebuffer».",
"Description[fi]": "KRfb:n Qt-pohjainen kehyspuskuri.",
"Description[fr]": "Tampon d'images utilisant Qt pour KRfb.",
"Description[gl]": "Framebuffer baseado en Qt para KRfb.",
"Description[ia]": "Framebuffer basate sur Qt per KRfb",
"Description[id]": "Framebuffer berbasiskan Qt untuk KRfb.",
"Description[it]": "Framebuffer basato su Qt per KRfb.",
"Description[ko]": "KRfb용 Qt 기반 프레임버퍼입니다.",
"Description[nl]": "Op Qt gebaseerd framebuffer voor KRfb.",
"Description[nn]": "Qt-basert biletbuffer for KRfb.",
"Description[pl]": "Bufor ramki oparty na Qt dla KRfb.",
"Description[pt]": "'Framebuffer' baseado no Qt para o KRfb.",
"Description[pt_BR]": "Framebuffer baseado no Qt para o KRfb.",
"Description[ru]": "Буфер кадров для KRfb на базе Qt",
"Description[sk]": "Framebuffer založený na Qt pre KRfb.",
"Description[sl]": "Slikovni medpomnilnik za KRfb na osnovi Qt.",
"Description[sr@ijekavian]": "Кадробафер за КРФБ на основу КуТу",
"Description[sr@ijekavianlatin]": "Kadrobafer za KRFB na osnovu Qtu",
"Description[sr@latin]": "Kadrobafer za KRFB na osnovu Qtu",
"Description[sr]": "Кадробафер за КРФБ на основу КуТу",
"Description[sv]": "X11-rambuffert för Krfb.",
"Description[tr]": "KRfb için Qt tabanlı Çerçeve tamponu.",
"Description[uk]": "Заснований на Qt буфер кадрів для KRfb.",
"Description[x-test]": "xxQt based Framebuffer for KRfb.xx",
"Description[zh_CN]": "KRfb 的基于 Qt 的帧缓冲。",
"Description[zh_TW]": "KRfb 的 Qt-based Framebuffer",
"EnabledByDefault": true,
"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[cs]": "Qt Framebuffer pro KRfb",
"Name[da]": "Qt-framebuffer til KRfb",
"Name[de]": "Qt-Framebuffer für KRfb",
"Name[el]": "Μνήμη ανανέωσης βίντεο Qt για το KRfb",
"Name[en_GB]": "Qt Framebuffer for KRfb",
"Name[es]": "Framebuffer de Qt para KRfb",
"Name[et]": "KRfb Qt kaadripuhver",
"Name[eu]": "KRfb-rako Qt «Framebuffer»",
"Name[fi]": "KRfb:n Qt-kehyspuskuri",
"Name[fr]": "Tampon d'images Qt pour KRfb",
"Name[gl]": "Framebuffer de Qt para KRfb",
"Name[ia]": "Framebuffer Qt per KRfb",
"Name[id]": "Qt Framebuffer untuk KRfb",
"Name[it]": "Framebuffer Qt per KRfb",
"Name[ko]": "KRfb용 Qt 프레임버퍼",
"Name[nl]": "Qt-framebuffer voor KRfb",
"Name[nn]": "Qt-biletbuffer for KRfb",
"Name[pl]": "Bufor ramki Qt dla KRfb",
"Name[pt]": "'Framebuffer' do Qt para o KRfb",
"Name[pt_BR]": "Framebuffer do Qt para o KRfb",
"Name[ru]": "Буфер кадров Qt для KRfb",
"Name[sk]": "Qt Framebuffer pre KRfb",
"Name[sl]": "Slikovni medpomnilnik za KRfb na osnovi Qt",
"Name[sr@ijekavian]": "КуТ‑ов кадробафер за КРФБ",
"Name[sr@ijekavianlatin]": "Qtov kadrobafer za KRFB",
"Name[sr@latin]": "Qtov kadrobafer za KRFB",
"Name[sr]": "КуТ‑ов кадробафер за КРФБ",
"Name[sv]": "QT-rambuffert för Krfb",
"Name[tr]": "KRfb için Qt Çerçeve tamponu",
"Name[uk]": "Буфер кадрів на Qt для KRfb",
"Name[x-test]": "xxQt Framebuffer for KRfbxx",
"Name[zh_CN]": "KRfb 的 Qt 帧缓冲",
"Name[zh_TW]": "Krfb 的 Qt Framebuffer",
"Version": "0.1",
"Website": "https://www.kde.org"
}
}

View File

@@ -24,20 +24,16 @@
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(QtFrameBufferPluginFactory, "krfb_framebuffer_qt.json",
registerPlugin<QtFrameBufferPlugin>();)
K_PLUGIN_CLASS(QtFrameBufferPlugin)
QtFrameBufferPlugin::QtFrameBufferPlugin(QObject *parent, const QVariantList &args)
: FrameBufferPlugin(parent, args)
{
}
QtFrameBufferPlugin::~QtFrameBufferPlugin()
{
}
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id)
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
{
Q_UNUSED(args);
return new QtFrameBuffer(id);
}

View File

@@ -33,9 +33,8 @@ class QtFrameBufferPlugin : public FrameBufferPlugin
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

@@ -18,8 +18,8 @@ ecm_qt_declare_logging_category(krfb_framebuffer_xcb_SRCS
add_library(krfb_framebuffer_xcb MODULE ${krfb_framebuffer_xcb_SRCS})
target_link_libraries (krfb_framebuffer_xcb
Qt5::Core
Qt5::Gui
Qt::Core
Qt::Gui
XCB::XCB
XCB::RENDER
XCB::SHAPE
@@ -31,6 +31,7 @@ target_link_libraries (krfb_framebuffer_xcb
krfbprivate
)
set_target_properties(krfb_framebuffer_xcb PROPERTIES OUTPUT_NAME xcb)
install (TARGETS krfb_framebuffer_xcb
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)

View File

@@ -1,81 +0,0 @@
{
"KPlugin": {
"Description": "X11 XDamage/XShm based Framebuffer for KRfb.",
"Description[ca@valencia]": "«Framebuffer» basat en «XDamage/XShm» de l'X11 per al KRfb.",
"Description[ca]": "«Framebuffer» basat en «XDamage/XShm» de l'X11 per al KRfb.",
"Description[cs]": "Framebuffer založený na X11 XDamage/XShm pro KRfb.",
"Description[da]": "X11 XDamage/XShm-baseret framebuffer til KRfb.",
"Description[de]": "X11 XDamage/XShm-basierter Framebuffer für KRfb.",
"Description[el]": "Μνήμη ανανέωσης βίντεο με βάση το X11 XDamage/XShm για το KRfb.",
"Description[en_GB]": "X11 XDamage/XShm based Framebuffer for KRfb.",
"Description[es]": "Framebuffer basado en XDamage/XShm de X11 para KRfb.",
"Description[et]": "KRfb X11 XDamage/XShm põhine kaadripuhver",
"Description[eu]": "KRfb-rako «X11 XDamage/XShm»en oinarritutako «Framebuffer».",
"Description[fi]": "KRfb:n X11 XDamage/XShm -pohjainen kehyspuskuri.",
"Description[fr]": "Tampon d'images utilisant XDamage/XShm de X11 pour KRfb.",
"Description[gl]": "Framebuffer baseado en X11 XDamage/Xshm para XRfb.",
"Description[ia]": "Framebuffer basate sur X11 XDamage/XShm per KRfb.",
"Description[id]": "Framebuffer berbasiskan X11 XDamage/XShm untuk KRfb.",
"Description[it]": "Framebuffer basato su XDamage/XShm di X11 per KRfb.",
"Description[ko]": "KRfb용 X11 XDamage/XShm 기반 프레임버퍼입니다.",
"Description[nl]": "Op X11 XDamage/XShm gebaseerd framebuffer voor KRfb.",
"Description[nn]": "X11 XDamage/XShm-basert biletbuffer for KRfb.",
"Description[pl]": "Bufor ramki na podstawie X11 XDamage/XShm dla KRfb.",
"Description[pt]": "'Framebuffer' do X11, baseado no XDamage/XShm, para o KRfb.",
"Description[pt_BR]": "Framebuffer baseado no XDamage/XShm do X11 para o KRfb.",
"Description[ru]": "Буфер кадров для KRfb на базе X11 XDamage/XShm",
"Description[sk]": "Framebuffer založený na X11 XDamage/XShm pre KRfb.",
"Description[sl]": "Slikovni medpomnilnik za KRfb, na osnovi X11 XDamage/XShm.",
"Description[sr@ijekavian]": "Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.",
"Description[sr@ijekavianlatin]": "Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.",
"Description[sr@latin]": "Kadrobafer za KRFB na osnovu XDamagea/XShma u X11.",
"Description[sr]": "Кадробафер за КРФБ на основу Икс‑демиџа/Икс‑схма у Иксу11.",
"Description[sv]": "X11 XDamage/XShm-baserad rambuffert för Krfb.",
"Description[tr]": "KRfb için X11 XDamage/XShm tabanlı Çerçeve tamponu.",
"Description[uk]": "Заснований на XDamage/XShm X11 буфер кадрів для KRfb.",
"Description[x-test]": "xxX11 XDamage/XShm based Framebuffer for KRfb.xx",
"Description[zh_CN]": "KRfb 的基于 X11 XDamage/XShm 的帧缓冲。",
"Description[zh_TW]": "KRfb 的 X11 XDamage/XShm based Framebuffer",
"EnabledByDefault": true,
"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[cs]": "X11 Framebuffer pro KRfb",
"Name[da]": "X11-framebuffer til KRfb",
"Name[de]": "X11-Framebuffer für KRfb",
"Name[el]": "Μνήμη ανανέωσης βίντεο X11 για το KRfb.",
"Name[en_GB]": "X11 Framebuffer for KRfb",
"Name[es]": "Framebuffer X11 para KRfb",
"Name[et]": "KRfb X11 kaadripuhver",
"Name[eu]": "KRfb-rako «X11 Framebuffer»",
"Name[fi]": "KRfb:n X11-kehyspuskuri",
"Name[fr]": "Tampon d'images X11 pour KRfb",
"Name[gl]": "Framebuffer de X11 para KRfb",
"Name[ia]": "Framebuffer X11 per KRfb",
"Name[id]": "Framebuffer X11 untuk KRfb",
"Name[it]": "Framebuffer X11 per KRfb",
"Name[ko]": "KRfb용 X11 프레임버퍼",
"Name[nl]": "X11 framebuffer voor KRfb",
"Name[nn]": "X11-biletbuffer for KRfb",
"Name[pl]": "Bufor ramki X11 dla KRfb",
"Name[pt]": "'Framebuffer' do X11 para o KRfb",
"Name[pt_BR]": "Framebuffer do X11 para o KRfb",
"Name[ru]": "Буфер кадров X11 для KRfb",
"Name[sk]": "X11 Framebuffer pre KRfb",
"Name[sl]": "Slikovni medpomnilnik za KRfb na osnovi X11",
"Name[sr@ijekavian]": "Икс11 кадробафер за КРФБ.",
"Name[sr@ijekavianlatin]": "X11 kadrobafer za KRFB.",
"Name[sr@latin]": "X11 kadrobafer za KRFB.",
"Name[sr]": "Икс11 кадробафер за КРФБ.",
"Name[sv]": "X11-rambuffert för Krfb",
"Name[tr]": "KRfb için X11 Çerçeve tamponu",
"Name[uk]": "Буфер кадрів X11 для KRfb",
"Name[x-test]": "xxX11 Framebuffer for KRfbxx",
"Name[zh_CN]": "XRfb 的 X11 帧缓冲",
"Name[zh_TW]": "KRfb 的 X11 Framebuffer",
"Version": "0.1",
"Website": "https://www.kde.org"
}
}

View File

@@ -10,7 +10,6 @@
#include "xcb_framebuffer.h"
#include "krfb_fb_xcb_debug.h"
#include <xcb/xcb.h>
#include <xcb/xproto.h>
#include <xcb/damage.h>
#include <xcb/shm.h>
@@ -19,12 +18,16 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <QX11Info>
#include <QCoreApplication>
#include <QGuiApplication>
#include <QScreen>
#include <QAbstractNativeEventFilter>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <QtGui/private/qtx11extras_p.h>
#endif
class KrfbXCBEventFilter: public QAbstractNativeEventFilter
{
@@ -32,7 +35,11 @@ public:
KrfbXCBEventFilter(XCBFrameBuffer *owner);
public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
#else
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
#endif
public:
int xdamageBaseEvent;
@@ -99,7 +106,11 @@ KrfbXCBEventFilter::KrfbXCBEventFilter(XCBFrameBuffer *owner):
bool KrfbXCBEventFilter::nativeEventFilter(const QByteArray &eventType,
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void *message, long *result) {
#else
void *message, qintptr *result) {
#endif
Q_UNUSED(result); // "result" is only used on windows
if (xdamageBaseEvent == 0) return false; // no xdamage extension
@@ -605,7 +616,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

@@ -22,23 +22,16 @@
#include "xcb_framebuffer.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(XCBFrameBufferPluginFactory, "krfb_framebuffer_xcb.json",
registerPlugin<XCBFrameBufferPlugin>();)
K_PLUGIN_CLASS(XCBFrameBufferPlugin)
XCBFrameBufferPlugin::XCBFrameBufferPlugin(QObject *parent, const QVariantList &args)
: FrameBufferPlugin(parent, args)
{
}
XCBFrameBufferPlugin::~XCBFrameBufferPlugin()
{
}
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(WId id)
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
{
Q_UNUSED(args);
return new XCBFrameBuffer(id);
}

View File

@@ -33,9 +33,8 @@ class XCBFrameBufferPlugin: public FrameBufferPlugin
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

@@ -23,13 +23,18 @@ generate_export_header(krfbprivate BASE_NAME krfbprivate)
target_link_libraries (krfbprivate
Qt5::Core
Qt5::Widgets
Qt5::X11Extras
Qt::Core
Qt::Widgets
${X11_X11_LIB}
${LIBVNCSERVER_LIBRARIES}
)
if(QT_MAJOR_VERSION EQUAL "5")
target_link_libraries (krfbprivate Qt::X11Extras)
else()
target_link_libraries (krfbprivate Qt::GuiPrivate)
endif()
set_target_properties (krfbprivate PROPERTIES
VERSION 5
SOVERSION 5.0
@@ -40,12 +45,6 @@ install (TARGETS krfbprivate
LIBRARY NAMELINK_SKIP
)
install (FILES
krfb-framebuffer.desktop
krfb-events.desktop
DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}
)
#####################################
# Second target: krfb - the app
# itself.
@@ -78,7 +77,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
@@ -86,12 +85,13 @@ ki18n_wrap_ui (krfb_SRCS
ui/mainwidget.ui
)
qt5_add_resources(krfb_SRCS
qt_add_resources(krfb_SRCS
krfb.qrc
)
add_executable (krfb
${krfb_SRCS}
${krfb_UI_SRCS}
)
target_link_libraries (krfb
@@ -100,7 +100,7 @@ target_link_libraries (krfb
${X11_Xext_LIB}
${X11_X11_LIB}
${X11_Xdamage_LIB}
Qt5::Network
Qt::Network
KF5::CoreAddons
KF5::DBusAddons
KF5::DNSSD
@@ -123,6 +123,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
Qt::Gui
Qt::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

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

@@ -28,10 +28,8 @@
#include <QGlobalStatic>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QtCore/QSharedPointer>
class EventsManagerStatic
{
@@ -43,71 +41,33 @@ Q_GLOBAL_STATIC(EventsManagerStatic, eventsManagerStatic)
EventsManager::EventsManager()
{
//qDebug();
loadPlugins();
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/events"), {}, KPluginMetaData::AllowEmptyMetaData);
for (const KPluginMetaData &data : plugins) {
const KPluginFactory::Result<EventsPlugin> result = KPluginFactory::instantiatePlugin<EventsPlugin>(data);
if (result.plugin) {
m_plugins.insert(data.pluginId(), result.plugin);
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
} else {
qCDebug(KRFB) << "unable to load plugin for " << data.fileName() << result.errorString;
}
}
}
EventsManager::~EventsManager()
{
//qDebug();
}
EventsManager::~EventsManager() = default;
EventsManager *EventsManager::instance()
{
//qDebug();
return &eventsManagerStatic->instance;
}
void EventsManager::loadPlugins()
{
//qDebug();
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/events"));
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
KPluginMetaData data = i.previous();
// only load plugins once, even if found multiple times!
if (unique.contains(data.name()))
continue;
KPluginFactory *factory = KPluginLoader(data.fileName()).factory();
if (!factory) {
qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName();
continue;
} else {
qCDebug(KRFB) << "found plugin at " << data.fileName();
}
auto plugin = factory->create<EventsPlugin>(this);
if (plugin) {
m_plugins.insert(data.pluginId(), plugin);
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
} else {
qCDebug(KRFB) << "unable to load plugin for " << data.fileName();
}
unique.insert (data.name());
}
}
QSharedPointer<EventHandler> EventsManager::eventHandler()
{
QMap<QString, EventsPlugin *>::const_iterator iter = m_plugins.constBegin();
while (iter != m_plugins.constEnd()) {
QSharedPointer<EventHandler> eventHandler(iter.value()->eventHandler());
for (auto it = m_plugins.cbegin(); it != m_plugins.constEnd(); it++) {
QSharedPointer<EventHandler> eventHandler(it.value()->eventHandler());
if (eventHandler) {
eventHandler->setFrameBufferPlugin(RfbServerManager::instance()->framebuffer());
return eventHandler;
}
++iter;
}
// No valid events plugin found.

View File

@@ -43,7 +43,7 @@ class KRFBPRIVATE_EXPORT EventsManager : public QObject
public:
static EventsManager *instance();
virtual ~EventsManager();
~EventsManager() override;
QSharedPointer<EventHandler> eventHandler();
@@ -52,8 +52,6 @@ private:
EventsManager();
void loadPlugins();
QMap<QString, EventsPlugin *> m_plugins;
QList<QWeakPointer<EventHandler> > m_eventHandlers;
};

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

@@ -27,10 +27,8 @@
#include <QGlobalStatic>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QSharedPointer>
class FrameBufferManagerStatic
{
@@ -42,61 +40,29 @@ Q_GLOBAL_STATIC(FrameBufferManagerStatic, frameBufferManagerStatic)
FrameBufferManager::FrameBufferManager()
{
//qDebug();
loadPlugins();
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/framebuffer"), {}, KPluginMetaData::AllowEmptyMetaData);
for (const KPluginMetaData &data : plugins) {
const KPluginFactory::Result<FrameBufferPlugin> result = KPluginFactory::instantiatePlugin<FrameBufferPlugin>(data);
if (result.plugin) {
m_plugins.insert(data.pluginId(), result.plugin);
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
} else {
qCDebug(KRFB) << "unable to load plugin for " << data.fileName() << result.errorString;
}
}
}
FrameBufferManager::~FrameBufferManager()
{
//qDebug();
}
FrameBufferManager *FrameBufferManager::instance()
{
//qDebug();
return &frameBufferManagerStatic->instance;
}
void FrameBufferManager::loadPlugins()
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVariantMap &args)
{
//qDebug();
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
QSet<QString> unique;
while (i.hasPrevious()) {
const KPluginMetaData &data = i.previous();
// only load plugins once, even if found multiple times!
if (unique.contains(data.name()))
continue;
KPluginFactory *factory = KPluginLoader(data.fileName()).factory();
if (!factory) {
qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName();
continue;
} else {
qCDebug(KRFB) << "found plugin at " << data.fileName();
}
auto plugin = factory->create<FrameBufferPlugin>(this);
if (plugin) {
m_plugins.insert(data.pluginId(), plugin);
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
} else {
qCDebug(KRFB) << "unable to load plugin for " << data.fileName();
}
unique.insert (data.name());
}
}
QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
{
//qDebug();
// See if there is still an existing framebuffer to this WId.
if (m_frameBuffers.contains(id)) {
QWeakPointer<FrameBuffer> weakFrameBuffer = m_frameBuffers.value(id);
@@ -111,23 +77,17 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
}
// We don't already have that frame buffer.
QMap<QString, FrameBufferPlugin *>::const_iterator iter = m_plugins.constBegin();
while (iter != m_plugins.constEnd()) {
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
for (auto it = m_plugins.cbegin(); it != m_plugins.constEnd(); it++) {
if (it.key() == KrfbConfig::preferredFrameBufferPlugin()) {
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id));
QSharedPointer<FrameBuffer> frameBuffer(it.value()->frameBuffer(id, args));
if (frameBuffer) {
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
return frameBuffer;
}
}
++iter;
}
// No valid framebuffer plugin found.

View File

@@ -45,15 +45,13 @@ public:
~FrameBufferManager() override;
QSharedPointer<FrameBuffer> frameBuffer(WId id);
QSharedPointer<FrameBuffer> frameBuffer(WId id, const QVariantMap &args);
private:
Q_DISABLE_COPY(FrameBufferManager)
FrameBufferManager();
void loadPlugins();
QMap<QString, FrameBufferPlugin *> m_plugins;
QMap<WId, QWeakPointer<FrameBuffer> > m_frameBuffers;
};

View File

@@ -37,7 +37,7 @@ public:
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>
@@ -31,7 +30,7 @@
#include <KLocalizedString>
#include <KUser>
#include <KStringHandler>
#include <KWallet/KWallet>
#include <KWallet>
#include <kdnssd_version.h>
#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
@@ -178,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 &&
@@ -195,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

@@ -1,34 +0,0 @@
[Desktop Entry]
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[cs]=Moduly událostí pro KRfb
Comment[da]=Hændelses-plugins til KRfb
Comment[de]=Ereignis-Module für KRfb
Comment[el]=Πρόσθετα γεγονότων για το KRfb
Comment[en_GB]=Event plugins for KRfb
Comment[es]=Complementos de eventos para KRfb
Comment[et]=KRfb sündmuste pluginad
Comment[eu]=KRfb-rako gertaeren pluginak
Comment[fi]=KRfb:n tapahtumaliitännäinen
Comment[fr]=Modules externes d'évènements pour Krfb
Comment[gl]=Complementos de eventos para KRfb
Comment[ia]=Plug-ins de evento per KRfb
Comment[it]=Estensioni degli eventi per KRfb
Comment[ko]=KRfb 이벤트 플러그인
Comment[nl]=Plug-ins voor gebeurtenis voor KRfb
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[sk]=Doplnky udalostí pre KRfb
Comment[sl]=Vstavki dogodkov za KRFB
Comment[sv]=Händelseinsticksprogram för Krfb
Comment[uk]=Додатки обробки подій для KRfb
Comment[x-test]=xxEvent plugins for KRfbxx
Comment[zh_CN]=KRfb 事件插件
Comment[zh_TW]=KRfb 的事件外掛程式

View File

@@ -1,34 +0,0 @@
{
"KPlugin": {
"Description": "Events plugins for 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",
"Description[el]": "Πρόσθετα γεγονότων για το KRfb",
"Description[en_GB]": "Events plugins for KRfb",
"Description[es]": "Complementos de eventos para KRfb",
"Description[et]": "KRfb sündmuste pluginad",
"Description[eu]": "KRfb-rako gertaeren pluginak",
"Description[fi]": "KRfb:n tapahtumaliitännäinen",
"Description[fr]": "Modules externes d'évènements pour KRfb",
"Description[gl]": "Complementos de eventos para KRfb",
"Description[ia]": "Plug-ins de eventos per KRfb",
"Description[it]": "Estensioni degli eventi per KRfb",
"Description[ko]": "KRfb 이벤트 플러그인",
"Description[nl]": "Plug-ins voor gebeurtenis voor KRfb",
"Description[nn]": "Hendingstillegg for KRfb",
"Description[pl]": "Wtyczki wydarzeń dla KRfb",
"Description[pt]": "'Plugins' de eventos para o KRfb",
"Description[pt_BR]": "Plugins de evento para o KRfb",
"Description[sk]": "Doplnky udalostí pre KRfb",
"Description[sl]": "Vtičniki za dogodke za KRfb",
"Description[sv]": "Händelseinsticksprogram för Krfb",
"Description[uk]": "Додатки обробки подій для KRfb",
"Description[x-test]": "xxEvents plugins for KRfbxx",
"Description[zh_CN]": "KRfb 事件插件",
"Description[zh_TW]": "KRfb 的事件外掛程式"
},
"X-KDE-ServiceType": "krfb/events"
}

View File

@@ -1,55 +0,0 @@
[Desktop Entry]
Type=ServiceType
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[cs]=Moduly Frame bufferu pro KRfb
Comment[da]=Framebuffer-plugins til KRfb
Comment[de]=Framebuffer-Module für KRfb
Comment[el]=Πρόσθετα μνήμης εξόδου βίντεο καρέ για το KRfb
Comment[en_GB]=Frame Buffer plugins for KRfb
Comment[es]=Complementos de memoria intermedia de vídeo para KRfb
Comment[et]=KRfb kaadripuhvri plugin
Comment[eu]=Irteerako bideoaren pluginak KRfb-rentzako
Comment[fi]=Kehyspuskuriliitännäinen kohteelle KRfb
Comment[fr]=Modules externes de sortie vidéo pour Krfb
Comment[ga]=Breiseáin Mhaoláin Fráma le haghaidh KRfb
Comment[gl]=Complementos de búfer de fotograma para KRfb
Comment[hr]=Priključci za međuspremnike okvira za KRfb
Comment[hu]=Framebuffer bővítmények a Krfb-hez
Comment[ia]=Plug-ins de Frame Buffer per KRfb
Comment[id]=Plugin Frame Buffer untuk KRfb
Comment[it]=Estensioni del framebuffer per KRfb
Comment[ja]=KRfb の フレームバッファプラグイン
Comment[kk]=KRfb кадр буфер плагині
Comment[km]=កម្មវិធី​ជំនួយ​ Frame Buffer សម្រាប់ KRfb
Comment[ko]=KRfb 프레임버퍼 플러그인
Comment[lt]=Frame Buffer papildiniai skirti KRfb
Comment[lv]=Kadru bufera sprudņi priekš KRfb
Comment[nb]=Rammebuffer-programtillegg for KRfb
Comment[nds]=Bildpuffer-Modulen för KRfb
Comment[nl]=Framebuffer-plugins voor KRfb
Comment[nn]=Framebuffer-tillegg KRfb
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[ru]=Модуль буфера кадров для KRfb
Comment[si]=KRfb සඳහා රාමු බෆර ප්ලගින
Comment[sk]=Frame Buffer modul pre KRfb
Comment[sl]=Vstavki slikovnih medpomnilnikov za KRFB
Comment[sr]=Прикључци кадробафера за КРФБ
Comment[sr@ijekavian]=Прикључци кадробафера за КРФБ
Comment[sr@ijekavianlatin]=Priključci kadrobafera za KRFB
Comment[sr@latin]=Priključci kadrobafera za KRFB
Comment[sv]=Insticksprogram med rambuffert för Krfb
Comment[th]=ส่วนเสริมของ KRfb สำหรับจัดการเฟรมบัฟเฟอร์
Comment[tr]=KRfb için Çerçeve Tamponu eklentileri
Comment[uk]=Додатки буфера кадрів для KRfb
Comment[x-test]=xxFrame Buffer plugins for KRfbxx
Comment[zh_CN]=KRfb 的帧缓冲插件
Comment[zh_TW]=KRfb 的 Frame Buffer 外掛程式

View File

@@ -1,41 +0,0 @@
{
"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[cs]": "Moduly Frame bufferu pro KRfb",
"Description[da]": "Framebuffer-plugins til KRfb",
"Description[de]": "Framebuffer-Module für KRfb",
"Description[el]": "Πρόσθετα μνήμης ανανέωσης βίντεο καρέ για το KRfb",
"Description[en_GB]": "Frame Buffer plugins for KRfb",
"Description[es]": "Complementos de framebuffer para KRfb",
"Description[et]": "KRfb kaadripuhvri pluginad",
"Description[eu]": "KRfb-rako «Frame Buffer» pluginak",
"Description[fi]": "KRfb:n kehyspuskuriliitännäinen",
"Description[fr]": "Modules de tampons d'image pour KRfb",
"Description[gl]": "Complemento de búfer de fotograma para KRfb",
"Description[ia]": "Plug-ins de Frame Buffer per KRfb",
"Description[id]": "Plugin Frame Buffer untuk KRfb",
"Description[it]": "Estensioni del framebuffer per KRfb",
"Description[ko]": "KRfb 프레임버퍼 플러그인",
"Description[nl]": "Framebuffer-plugins voor KRfb",
"Description[nn]": "Biletbuffer-tillegg KRfb",
"Description[pl]": "Wtyczki buforów ramek dla KRfb",
"Description[pt]": "'Plugins' do 'Framebuffer' para o KRfb",
"Description[pt_BR]": "Plugins de framebuffers para o KRfb",
"Description[ru]": "Модули буфера кадров для KRfb",
"Description[sk]": "Frame Buffer modul pre KRfb",
"Description[sl]": "Vtičniki vmesnika medpomnilnika za KRfb",
"Description[sr@ijekavian]": "Прикључци кадробафера за КРФБ",
"Description[sr@ijekavianlatin]": "Priključci kadrobafera za KRFB",
"Description[sr@latin]": "Priključci kadrobafera za KRFB",
"Description[sr]": "Прикључци кадробафера за КРФБ",
"Description[sv]": "Insticksprogram med rambuffert för Krfb",
"Description[tr]": "KRfb için Çerçeve Tamponu eklentileri",
"Description[uk]": "Додатки буфера кадрів для KRfb",
"Description[x-test]": "xxFrame Buffer plugins for KRfbxx",
"Description[zh_CN]": "KRfb 的帧缓冲插件",
"Description[zh_TW]": "KRfb 的 Frame Buffer 外掛程式"
},
"X-KDE-ServiceType": "krfb/framebuffer"
}

View File

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

View File

@@ -0,0 +1,175 @@
/* 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) override {
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);
if (!server.start()) {
return 1;
}
return app.exec();
}

View File

@@ -30,7 +30,12 @@
#include <QPixmap>
#include <qwindowdefs.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <QtGui/private/qtx11extras_p.h>
#endif
#include <csignal>
#include <X11/extensions/XTest.h>
@@ -38,8 +43,6 @@
#include <QCommandLineOption>
static const char description[] = I18N_NOOP("VNC-compatible server to share "
"desktops");
static bool checkX11Capabilities()
{
int bp1, bp2, majorv, minorv;
@@ -95,7 +98,7 @@ int main(int argc, char *argv[])
KAboutData aboutData(QStringLiteral("krfb"),
i18n("Desktop Sharing"),
QStringLiteral(KRFB_VERSION_STRING),
i18n(description),
i18n("VNC-compatible server to share desktops"),
KAboutLicense::GPL,
i18n("(c) 2009-2010, Collabora Ltd.\n"
"(c) 2007, Alessandro Praduroux\n"
@@ -160,6 +163,15 @@ int main(int argc, char *argv[])
MainWindow mainWindow;
TrayIcon trayicon(&mainWindow);
QObject::connect(&service, &KDBusService::activateRequested, &mainWindow, [&mainWindow](const QStringList & /*arguments*/, const QString & /*workdir*/) {
if (!mainWindow.isVisible()) {
mainWindow.setVisible(true);
} else {
KWindowSystem::updateStartupId(mainWindow.windowHandle());
KWindowSystem::activateWindow(mainWindow.windowHandle());
}
});
if (KrfbConfig::startMinimized()) {
mainWindow.hide();
} else if (app.isSessionRestored() && KMainWindow::canBeRestored(1)) {

View File

@@ -22,7 +22,6 @@
#include <KStandardAction>
#include <KActionCollection>
#include <KNewPasswordDialog>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QIcon>
@@ -34,12 +33,12 @@
#include <QSet>
#include <QNetworkInterface>
#include <QHostInfo>
#include <QMessageBox>
class TCP: public QWidget, public Ui::TCP
{
public:
TCP(QWidget *parent = nullptr) : QWidget(parent) {
explicit TCP(QWidget *parent = nullptr) : QWidget(parent) {
setupUi(this);
}
};
@@ -83,15 +82,9 @@ public:
}
void fillFrameBuffersCombo() {
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
QSet<QString> unique;
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
while (i.hasPrevious()) {
const KPluginMetaData &metadata = i.previous();
if (unique.contains(metadata.pluginId())) continue;
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("krfb/framebuffer"), {}, KPluginMetaData::AllowEmptyMetaData);
for (const KPluginMetaData &metadata : plugins) {
cb_preferredFrameBufferPlugin->addItem(metadata.pluginId());
unique.insert(metadata.pluginId());
}
}
};
@@ -226,16 +219,16 @@ void MainWindow::passwordChanged(const QString& password)
void MainWindow::aboutConnectionAddress()
{
KMessageBox::about(this,
i18n("This field contains the address of your computer and the port number, separated by a colon.\n\nThe address is just a hint - you can use any address that can reach your computer.\n\nDesktop Sharing tries to guess your address from your network configuration, but does not always succeed in doing so.\n\nIf your computer is behind a firewall it may have a different address or be unreachable for other computers."),
i18n("KDE Desktop Sharing"));
QMessageBox::about(this,
i18n("KDE Desktop Sharing"),
i18n("This field contains the address of your computer and the port number, separated by a colon.\n\nThe address is just a hint - you can use any address that can reach your computer.\n\nDesktop Sharing tries to guess your address from your network configuration, but does not always succeed in doing so.\n\nIf your computer is behind a firewall it may have a different address or be unreachable for other computers."));
}
void MainWindow::aboutUnattendedMode()
{
KMessageBox::about(this,
i18n("Any remote user with normal desktop sharing password will have to be authenticated.\n\nIf unattended access is on, and the remote user provides unattended mode password, desktop sharing access will be granted without explicit confirmation."),
i18n("KDE Desktop Sharing"));
QMessageBox::about(this,
i18n("KDE Desktop Sharing"),
i18n("Any remote user with normal desktop sharing password will have to be authenticated.\n\nIf unattended access is on, and the remote user provides unattended mode password, desktop sharing access will be granted without explicit confirmation."));
}
void MainWindow::showConfiguration()

View File

@@ -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>
@@ -41,13 +42,15 @@
<name xml:lang="zh-TW">Krfb</name>
<summary>Share your desktop to another computer via VNC</summary>
<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="ca-valencia">Compartix 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>
@@ -59,15 +62,19 @@
<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="ru">Предоставление другому компьютеру доступа к рабочему столу с помощью VNC</summary>
<summary xml:lang="sk">Zdieľajte vašu plochu s iným počítačom cez 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="tr">Masaüstünüzü başka bir bilgisayara VNC aracılığıyla paylaşın</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>
<p xml:lang="ca-valencia">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>
<p xml:lang="ca-valencia">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>
<p xml:lang="da">Krfb-skrivebordsdeling er et serverprogram der giver dig mulighed for at dele din nuværende session med en bruger på en anden maskine som kan bruge en VNC-klient til at vise eller endda styrer skrivebordet.</p>
<p xml:lang="de">Krfb ist eine Serveranwendung, welche die gemeinsame Benutzung der aktuellen Sitzung mit einem Benutzer auf einem anderen Rechner ermöglicht, der mit Hilfe eines VNC-Programms den Bildschirminhalt sehen oder sogar die Arbeitsfläche bedienen kann.</p>
<p xml:lang="el">Η κοινή χρήση επιφάνειας εργασίας Krfb είναι μια εφαρμογή εξυπηρετητή που σας επιτρέπει να μοιράζεστε την τρέχουσα συνεδρία σας με έναν χρήστη σε άλλο μηχάνημα, ο οποίος μπορεί να χρησιμοποιεί έναν πελάτη VNC για να παρακολουθεί ή και να ελέγχει την επιφάνεια εργασίας σας.</p>
@@ -87,6 +94,7 @@
<p xml:lang="pl">Współdzielenie pulpitu Krfb jest aplikacją serwerową, która umożliwia współdzielenie twojej bieżącej sesji z użytkownikiem na innym komputerze, który może użyć klienta VNC do oglądania,a a nawet sterowania twoim pulpitem.</p>
<p xml:lang="pt">A Partilha de Ecrã Krfb é uma aplicação de servidor que lhe permite partilhar a sua sessão actual com um utilizador noutra máquina, o qual poderá usar um cliente de VNC para ver ou mesmo controlar o ambiente de trabalho.</p>
<p xml:lang="pt-BR">Krfb Desktop Sharing é um aplicativo de servidor que lhe permite compartilhar a sua sessão atual com um usuário em outra máquina, que poderá usar um cliente de VNC para ver ou mesmo controlar a máquina.</p>
<p xml:lang="ro">Partajarea Biroului Krfb e o aplicație-server ce vă permite să partajați sesiunea actuală cu un utilizator de pe altă mașină, care poate folosi un client VNC pentru a vedea sau chiar controla biroul.</p>
<p xml:lang="ru">Krfb является сервером, который позволяет вам предоставлять доступ к своему текущему сеансу пользователю на другом компьютере, который использует клиент VNC для просмотра или управления вашим рабочим столом.</p>
<p xml:lang="sk">Krfb je serverová aplikácia, ktorá vám umožní zdieľať vaše aktuálne sedenie s používateľom na inom stroji, ktorý môže používať VNC klienta na pripojenie alebo ovládanie stanice.</p>
<p xml:lang="sl">Souporaba namizja Krfb je strežniški program, ki vam dovoli, da delite vašo trenutno sejo z uporabnikom na drugem računalniku, ki ima odjemalec VNC. Uporabnik lahko gleda ali celo nadzira namizje.</p>
@@ -95,7 +103,7 @@
<p xml:lang="sr-ijekavian">КРФБ је серверски програм за дељење површи, којим можете да поделите своју текућу сесију са корисником на другој машини. Удаљени корисник може да употреби неки ВНЦ клијент за гледање површи, па чак и управљање њоме.</p>
<p xml:lang="sr-ijekavianlatin">KRFB je serverski program za deljenje površi, kojim možete da podelite svoju tekuću sesiju sa korisnikom na drugoj mašini. Udaljeni korisnik može da upotrebi neki VNC klijent za gledanje površi, pa čak i upravljanje njome.</p>
<p xml:lang="sv">Krfb-skrivbordsdelning är ett serverprogram som gör det möjligt att dela aktuell session med en användare på en annan dator, som kan använda en VNC-klient för att betrakta eller till och med kontrollera skrivbordet.</p>
<p xml:lang="tr">Krfb Masaüstü Paylaşımı, mevcut oturumu masaüstünü görüntülemek veya kontrol etmek için, VNC istemcisi kullanan başka bir makinedeki, kullanıcıyla paylaşmanızı sağlayan bir sunucu uygulamasıdır.</p>
<p xml:lang="tr">Krfb Masaüstü Paylaşımı; geçerli oturumunuzu, başka bir makinedeki bir kullanıcıyla paylaşmanıza izin veren bir sunucu uygulamasıdır. Kullanıcılar, bir VNC istemcisi ile masaüstünüzü görüntüleyebilir ve hatta denetleyebilirler.</p>
<p xml:lang="uk">Програма для спільного використання стільниці Krfb — це серверна програма, яка надає вам змогу розділити ваш поточний сеанс роботи з користувачем, який працює на іншому комп’ютері, так, щоб цей користувач зміг скористатися клієнтом VNC для перегляду або навіть керування вашою стільницею.</p>
<p xml:lang="x-test">xxKrfb 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.xx</p>
<p xml:lang="zh-CN">Krfb 桌面共享是一个可以让您与另一个在其他机器上的用户共享当前会话的服务器程序,他可以使用 VNC 客户端来查看甚至控制桌面。</p>
@@ -109,7 +117,7 @@
<screenshot type="default">
<caption>Sharing desktop with Krfb</caption>
<caption xml:lang="ca">Compartint l'escriptori amb el Krfb</caption>
<caption xml:lang="ca-valencia">Compartint l'escriptori amb el Krfb</caption>
<caption xml:lang="ca-valencia">Compartint l'escriptori amb Krfb</caption>
<caption xml:lang="cs">Sdílím pracovní plochu pomocí Krfb</caption>
<caption xml:lang="da">Deler skrivebord med Krfb</caption>
<caption xml:lang="de">Freigabe der Arbeitsfläche mit Krfb</caption>
@@ -130,10 +138,12 @@
<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>
<caption xml:lang="sv">Dela skrivbord med Krfb</caption>
<caption xml:lang="tr">Krfb ile masaüstü paylaşımı</caption>
<caption xml:lang="uk">Спільне використання стільниці за допомогою Krfb</caption>
<caption xml:lang="x-test">xxSharing desktop with Krfbxx</caption>
<caption xml:lang="zh-CN">使用 Krfb 共享桌面</caption>
@@ -146,9 +156,9 @@
</provides>
<project_group>KDE</project_group>
<releases>
<release version="21.04.3" date="2021-07-08"/>
<release version="21.04.2" date="2021-06-10"/>
<release version="21.04.1" date="2021-05-13"/>
<release version="21.04.0" date="2021-04-22"/>
<release version="22.04.3" date="2022-07-07"/>
<release version="22.04.2" date="2022-06-09"/>
<release version="22.04.1" date="2022-05-12"/>
<release version="22.04.0" date="2022-04-21"/>
</releases>
</component>

View File

@@ -1,7 +1,7 @@
# KDE Config File
[Desktop Entry]
Type=Application
Exec=krfb -qwindowtitle %c %i
Exec=krfb -qwindowtitle %c
Icon=krfb
X-DBUS-StartupType=Unique
X-DocPath=krfb/index.html
@@ -84,6 +84,7 @@ 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)
@@ -94,8 +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[ru]=Совместный доступ к рабочему столу (VNC)
GenericName[sk]=Zdieľanie pracovnej plochy (VNC)
GenericName[sl]=Souporaba namizja (VNC)
GenericName[sv]=Skrivbordsdelning (VNC)
GenericName[tr]=Masaüstü Paylaşımı (VNC)
GenericName[uk]=Спільні стільниці (VNC)
GenericName[x-test]=xxDesktop Sharing (VNC)xx
GenericName[zh_CN]=桌面共享 (VNC)

View File

@@ -0,0 +1,58 @@
# 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 de Krfb
Name[cs]=Virtuální monitor 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[ru]=Виртуальный монитор KRFB
Name[sk]=Virtuálny monitor KRFB
Name[sl]=Navidezni monitor KRFB
Name[sv]=Krfb:s virtuella bildskärm
Name[tr]=KRFB Sanal Monitörü
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[cs]=Vzdálený virtuální monitor
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[ru]=Удалённый виртуальный монитор
Comment[sk]=Vzdialený virtuálny monitor
Comment[sl]=Oddaljeni navidezni monitor
Comment[sv]=Virtuell fjärrbildskärm
Comment[tr]=Uzak Sanal Monitör
Comment[uk]=Віддалений віртуальний монітор
Comment[x-test]=xxRemote Virtual Monitorxx
Comment[zh_CN]=
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

@@ -24,7 +24,12 @@
#include <QApplication>
#include <QClipboard>
#include <QPointer>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <QtGui/private/qtx11extras_p.h>
#endif
struct RfbServer::Private
{
@@ -117,6 +122,7 @@ bool RfbServer::start()
}
d->screen->port = listeningPort();
d->screen->ipv6port = listeningPort();
// Disable/Enable password checking
if (passwordRequired()) {

View File

@@ -20,10 +20,10 @@
*/
#include "rfbservermanager.h"
#include "rfbserver.h"
#include "framebuffer.h"
#include "framebuffermanager.h"
#include "sockethelpers.h"
#include "krfbconfig.h"
#include "krfbdebug.h"
#include <QTimer>
#include <QApplication>
#include <QDesktopWidget>
@@ -33,6 +33,9 @@
#include <KLocalizedString>
#include <KUser>
#include <KNotification>
#include <chrono>
using namespace std::chrono_literals;
static const char *cur =
" "
@@ -116,11 +119,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 +137,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 +145,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 +203,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 +221,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)