1
0
mirror of https://github.com/KDE/krfb synced 2026-07-02 08:11:17 -07:00

Compare commits

...

260 Commits

Author SHA1 Message Date
Albert Astals Cid
7fb0a163a5 GIT_SILENT Upgrade release service version to 21.07.80. 2021-07-10 19:02:21 +02:00
Laurent Montel
c729e9e048 Modernize code 2021-07-09 08:53:14 +02:00
Laurent Montel
45548e020a Add missing override + add nullptr 2021-07-09 08:53:14 +02:00
Laurent Montel
dc64af6f5e Remove code for old qt version 2021-07-09 08:53:14 +02:00
Laurent Montel
2af26baf56 GIT_SILENT: time to increase version 2021-07-09 08:53:14 +02:00
Laurent Montel
e07f2c1f11 GIT_SILENT: ignore file 2021-07-09 08:53:14 +02:00
Laurent Montel
e5e2b293e8 GIT_SILENT: add support for cmake preset support 2021-07-09 08:53:14 +02:00
Heiko Becker
6cb2b22bf6 GIT_SILENT Update Appstream for new release
(cherry picked from commit 464d1a60a1)
2021-07-05 21:21:15 +02:00
Friedrich W. H. Kossebau
0316c376f2 Port away from deprecated KDNSSD CamelCase include prefixes
GIT_SILENT
2021-06-21 15:37:01 +02:00
Aleix Pol
b8f972d59e Fix crash when the destination stride != source stride
When we allocate the locally mapped texture size, use the announced
stride (aka bytes per line) instead of the texture width. Otherwise we
might overflow and crash eventually.

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

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

This reverts commit 8f0de62401.

Revert "Drop support for PipeWire 0.2"

This reverts commit 028ac099ea.

These were accidentally pushed without review. They were meant
to be pushed to my fork instead.
2021-05-21 14:12:23 +02:00
Jan Grulich
eb1dc503bd Improve PipeWire code
- add support for VideoCrop metadata
- add support for memptr buffer type
2021-05-21 14:09:10 +02:00
Jan Grulich
8f0de62401 Add dma-buf defines to build dma-buf support everywhere 2021-05-21 09:31:51 +02:00
Jan Grulich
028ac099ea Drop support for PipeWire 0.2 2021-05-21 09:22:45 +02:00
l10n daemon script
5e18689b8e GIT_SILENT made messages (after extraction) 2021-05-10 00:20:04 +00:00
Heiko Becker
68866dc4fa GIT_SILENT Update Appstream for new release
(cherry picked from commit 4a36c727c2)
2021-05-07 20:36:21 +02:00
l10n daemon script
15f5654e5b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2021-04-25 01:20:50 +00:00
l10n daemon script
76e36c0761 GIT_SILENT made messages (after extraction) 2021-04-25 00:18:35 +00:00
Heiko Becker
0afcfc82b9 GIT_SILENT Update Appstream for new release
(cherry picked from commit 5959b4690d)
2021-04-14 17:25:03 +02:00
Albert Astals Cid
730e4d74a8 GIT_SILENT Upgrade release service version to 21.07.70. 2021-03-13 22:21:04 +01:00
l10n daemon script
d533b76f9b 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-03-13 06:42:19 +01:00
l10n daemon script
34a0e0c361 GIT_SILENT made messages (after extraction) 2021-03-13 02:36:42 +01:00
Albert Astals Cid
e1fdba3014 Merge remote-tracking branch 'origin/release/20.12' 2021-03-13 00:56:36 +01:00
Heiko Becker
73500f837e GIT_SILENT Update Appstream for new release
(cherry picked from commit f9a062ffa9)
2021-02-25 00:41:46 +01:00
Heiko Becker
f9a062ffa9 GIT_SILENT Update Appstream for new release 2021-02-25 00:29:46 +01:00
Heiko Becker
a4177eac39 GIT_SILENT Upgrade release service version to 20.12.3. 2021-02-25 00:05:58 +01:00
Laurent Montel
15068b250c We depend against kf5.68 => depend against qt 5.12 2021-02-08 07:06:20 +01:00
Laurent Montel
326d58a439 GIT_SILENT: don't use deprecated cmake variable 2021-02-08 07:05:59 +01:00
Heiko Becker
1a7f3a8517 GIT_SILENT Update Appstream for new release 2021-01-29 21:24:50 +01:00
Heiko Becker
3625b0cee3 GIT_SILENT Update Appstream for new release
(cherry picked from commit 1a7f3a8517)
2021-01-29 21:24:50 +01:00
Heiko Becker
7ef0dce382 GIT_SILENT Upgrade release service version to 20.12.2. 2021-01-29 20:48:53 +01:00
l10n daemon script
72270006ca 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-01-24 11:14:42 +01:00
l10n daemon script
938f98cef5 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-01-24 06:57:01 +01:00
Aleix Pol
93eb2d78d4 Merge branch 'release/20.12' 2021-01-22 02:00:03 +01:00
Aleix Pol
f041cdf095 pipewire: Support BGRA
It's not supported by QImage, so we need to do it ourselves by swapping
the B and the R.
2021-01-22 00:58:34 +00:00
l10n daemon script
e1e359fa7b 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-01-18 11:54:54 +01:00
l10n daemon script
50b72f26a8 GIT_SILENT made messages (after extraction) 2021-01-18 09:20:26 +01:00
l10n daemon script
2c184a22bf 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-01-18 07:08:20 +01:00
l10n daemon script
bb35068a1d GIT_SILENT made messages (after extraction) 2021-01-18 02:43:31 +01:00
Christoph Feck
706d4853b2 GIT_SILENT Update Appstream for new release 2021-01-02 15:22:45 +01:00
Christoph Feck
f03b829814 GIT_SILENT Update Appstream for new release
(cherry picked from commit 706d4853b2)
2021-01-02 15:22:45 +01:00
Christoph Feck
4335f83dab GIT_SILENT Upgrade release service version to 20.12.1. 2021-01-02 14:23:25 +01:00
l10n daemon script
08d967af66 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"
2020-12-18 10:01:32 +01:00
l10n daemon script
f0c1bc787e GIT_SILENT made messages (after extraction) 2020-12-18 08:30:35 +01:00
l10n daemon script
230040c5a9 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"
2020-12-07 09:53:53 +01:00
l10n daemon script
dad7f0184b GIT_SILENT made messages (after extraction) 2020-12-07 08:20:11 +01:00
l10n daemon script
74070d3baa 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"
2020-12-07 06:12:37 +01:00
l10n daemon script
cceab8c12a GIT_SILENT made messages (after extraction) 2020-12-07 02:28:32 +01:00
Christoph Feck
b5a328b905 GIT_SILENT Update Appstream for new release 2020-12-02 23:35:55 +01:00
Christoph Feck
513b717fac GIT_SILENT Update Appstream for new release
(cherry picked from commit b5a328b905)
2020-12-02 23:35:55 +01:00
Christoph Feck
a5f3009530 GIT_SILENT Upgrade release service version to 20.12.0. 2020-12-02 22:53:12 +01:00
Christoph Feck
2b1f48b92a GIT_SILENT Upgrade release service version to 20.11.90. 2020-11-25 02:29:59 +01:00
l10n daemon script
617f237d4e 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"
2020-11-18 10:23:39 +01:00
l10n daemon script
dcc1bb2de5 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"
2020-11-18 06:35:41 +01:00
l10n daemon script
14aa98ccca 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"
2020-11-12 06:23:56 +01:00
l10n daemon script
717607b1c6 GIT_SILENT made messages (after extraction) 2020-11-12 02:27:33 +01:00
l10n daemon script
4e0aa9c78b 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"
2020-11-11 10:36:42 +01:00
Albert Astals Cid
e34043d514 GIT_SILENT Upgrade release service version to 21.03.70. 2020-11-08 18:56:33 +01:00
Albert Astals Cid
8010c34bf1 GIT_SILENT Upgrade release service version to 20.11.80. 2020-11-08 18:09:43 +01:00
l10n daemon script
5610c0a292 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"
2020-11-01 06:35:22 +01:00
l10n daemon script
280c852a4e GIT_SILENT made messages (after extraction) 2020-11-01 02:26:28 +01:00
Christoph Feck
6518c17362 GIT_SILENT Update Appstream for new release
(cherry picked from commit 4b3caa10f2)
2020-10-31 18:29:34 +01:00
l10n daemon script
fcad3620db GIT_SILENT made messages (after extraction) 2020-10-31 02:21:18 +01:00
Tobias Junghans
de7050d8b7 pipewire: fix version check 2020-10-23 14:59:08 +02:00
Tobias Junghans
60c5d93f20 Zero-initialize sockaddr structure 2020-10-23 11:02:20 +02:00
Tobias Junghans
3a83ce6279 Use C++11 loops 2020-10-23 10:55:37 +02:00
Tobias Junghans
a109e3d6c9 Use auto keyword where possible 2020-10-23 10:54:59 +02:00
Tobias Junghans
4993e65d59 Include C headers in C++ style 2020-10-23 10:52:23 +02:00
Tobias Junghans
d91bbdcb05 Use QStringLiteral to avoid runtime allocations 2020-10-23 10:51:02 +02:00
Tobias Junghans
1d429a9bc6 Add missing member variable initializations 2020-10-23 10:49:57 +02:00
Tobias Junghans
2b9cb5c58c pipewire: remove QX11Info include
The plugin neither uses QX11Info nor links against Qt5::X11Extras.
2020-10-22 08:48:17 +00:00
l10n daemon script
6d9226c8d9 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"
2020-10-09 06:34:49 +02:00
l10n daemon script
f67f629899 GIT_SILENT made messages (after extraction) 2020-10-09 02:23:09 +02:00
Alexey Min
0e3733c327 Merge branch 'release/20.08' 2020-10-05 08:28:17 +03:00
Alexey Min
fd362fd642 Make sure to save security settings each time they are modified
Settings that are modified using normal settings window, which is
invoked using menu "Configure Desktop Sharing..." are always saved
correctly.

However some settings that are present on Krfb main window
(normal password, unattended password, checkbox "enable unattended
access") are not handled by KConfigDialog and there is a chance that
settings might not be saved correctly (for example if application
was suddenly terminated).

This hopefully fixes some bugs which are present since year 2011-2014
and have 110 votes, like https://bugs.kde.org/show_bug.cgi?id=340411,
maybe something else.

BUG: 340411
FIXED-IN: 20.08.2
CHANGELOG: Make sure to save passwords each time they are modified
2020-10-05 08:07:12 +03:00
l10n daemon script
b14b7cc3a8 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"
2020-10-05 06:11:39 +02:00
l10n daemon script
b71652061a GIT_SILENT made messages (after extraction) 2020-10-05 02:22:34 +02:00
Christoph Feck
9d02f073bd GIT_SILENT Update Appstream for new release 2020-10-03 14:42:55 +02:00
Christoph Feck
05f36df893 GIT_SILENT Update Appstream for new release
(cherry picked from commit 9d02f073bd)
2020-10-03 14:42:55 +02:00
Christoph Feck
251d8f2e0e GIT_SILENT Upgrade release service version to 20.08.2. 2020-10-03 12:55:34 +02:00
l10n daemon script
5aa1acd96b GIT_SILENT made messages (after extraction) 2020-10-01 02:21:47 +02:00
l10n daemon script
da2f51de6a 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"
2020-09-21 06:01:29 +02:00
l10n daemon script
47fbb3f316 GIT_SILENT made messages (after extraction) 2020-09-21 02:27:23 +02:00
Ömer Fadıl Usta
7ba81f52df Remove doubled parts and fix compile for systems without pipewire
SPA_DATA_DmaBuf checking was written twice which needs on pipewire
2020-09-19 11:02:41 +03:00
Aleix Pol
b9efda5956 Merge branch 'release/20.08' into master 2020-09-19 00:31:35 +02:00
Aleix Pol
f83d5102b6 Merge branch 'release/20.08' into master 2020-09-18 22:03:29 +02:00
Aleix Pol
8afd5c8df2 pipewire: Only aspire to use dmabuf if linux/dma-buf.h is present 2020-09-18 18:16:42 +02:00
Ömer Fadıl Usta
ef6b3a6093 Fixes for builds without pipewire3
Because of some parts still available without PW_CHECK_VERSION check
the systems without pipewire3 couldnt able to compile code.
2020-09-18 16:58:08 +02:00
l10n daemon script
9e1680d122 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"
2020-09-18 06:17:06 +02:00
l10n daemon script
f3587b224f GIT_SILENT made messages (after extraction) 2020-09-18 02:23:05 +02:00
l10n daemon script
d4175c0f22 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"
2020-09-17 06:16:06 +02:00
l10n daemon script
481972a129 GIT_SILENT made messages (after extraction) 2020-09-17 02:23:18 +02:00
l10n daemon script
e432a4ee7c 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"
2020-09-16 06:33:12 +02:00
l10n daemon script
f5768411e6 GIT_SILENT made messages (after extraction) 2020-09-16 02:28:03 +02:00
Aleix Pol
c5d6abab58 Port pipewire to use QLoggingCategory 2020-09-16 00:38:03 +02:00
Aleix Pol
c5e157fa82 Support DMABuf streams 2020-09-15 16:15:41 +02:00
Aleix Pol
3e00ff22f9 Support DMABuf streams 2020-09-15 16:14:06 +02:00
l10n daemon script
068ce93465 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"
2020-09-15 06:07:29 +02:00
l10n daemon script
9bb6fd224b GIT_SILENT made messages (after extraction) 2020-09-15 02:21:31 +02:00
Stefan Brüns
024ce87b3a Compensate for global scale factor when using xcb fb plugin
The screen geometry is reported in device independent pixels, so it has
to be multiplied by the devicePixelRatio to get the size of the underlying
framebuffer. Otherwise, only the top left of the screen will be captured.

This matches the behavior of QScreen::grabWindow(...), which also
returns a QPixmap of the given size scaled by devicePixelRatio.

BUG: 419814
2020-09-15 03:03:47 +03:00
Thiago Sueto
97951fc296 Improve GenericName and Appstream Summary
Change GenericName in the .desktop file and Summary in the
.xml file to be more descriptive and to be parallel with
KRDC's description, so both are shown to provide a complete
solution for VPN.

Reviewed-on: https://invent.kde.org/network/krfb/-/merge_requests/1
2020-09-14 19:47:45 +03:00
Christoph Feck
52fded8831 GIT_SILENT Update Appstream for new release
(cherry picked from commit 740f5c1449)
2020-08-31 21:23:24 +02:00
Christoph Feck
740f5c1449 GIT_SILENT Update Appstream for new release 2020-08-31 21:23:23 +02:00
Christoph Feck
1e9a91e83e GIT_SILENT Upgrade release service version to 20.08.1. 2020-08-31 20:41:17 +02:00
Stefan Brüns
933169b4c0 Compensate for global scale factor when using xcb fb plugin
The screen geometry is reported in device independent pixels, so it has
to be multiplied by the devicePixelRatio to get the size of the underlying
framebuffer. Otherwise, only the top left of the screen will be captured.

This matches the behavior of QScreen::grabWindow(...), which also
returns a QPixmap of the given size scaled by devicePixelRatio.

BUG: 419814
2020-08-28 04:08:15 +02:00
Pino Toscano
6f58476dbe Merge remote-tracking branch 'origin/release/20.08' into master 2020-08-25 07:52:11 +02:00
Pino Toscano
f839da9ba2 typo fix in debug message
GIT_SILENT
2020-08-25 07:51:01 +02:00
Stefan Brüns
76c2f08c9e Declare and use logging categories
Adds the following logging categories:
- krfb.krfb (KRFB application)
- krfb.framebuffer.qt (Qt Framebuffer plugin)
- krfb.framebuffer.xcb (XCB Framebuffer plugin)
2020-08-13 20:17:39 +02:00
Stefan Brüns
b135370c5c Replace KLineEdit with QLineEdit
The password field uses none of the KLineEdit features like completion,
so QLineEdit suffices.
2020-08-13 10:32:20 +00:00
Stefan Brüns
b5adcd23c6 Remove last remnant of telepathy support
Telepathy was removed in commit 6d5e2bc356
(¨Remove telepathy tubes and contact list support.¨)
2020-08-12 17:55:01 +02:00
Christoph Feck
13f5de2518 GIT_SILENT Update Appstream for new release 2020-08-05 10:17:31 +02:00
Christoph Feck
cb83a9d539 GIT_SILENT Update Appstream for new release
(cherry picked from commit 13f5de2518)
2020-08-05 10:17:31 +02:00
Christoph Feck
c4f012a919 GIT_SILENT Upgrade release service version to 20.08.0. 2020-08-05 09:25:49 +02:00
Christoph Feck
04c3f3e01e GIT_SILENT Upgrade release service version to 20.07.90. 2020-07-31 23:29:32 +02:00
l10n daemon script
0cdc848844 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"
2020-07-26 09:02:55 +02:00
l10n daemon script
e2daae290b GIT_SILENT made messages (after extraction) 2020-07-26 07:51:11 +02:00
l10n daemon script
c73c58b55d 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"
2020-07-26 05:44:08 +02:00
l10n daemon script
d983ed6869 GIT_SILENT made messages (after extraction) 2020-07-26 02:14:31 +02:00
l10n daemon script
b948d90c84 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"
2020-07-25 08:50:58 +02:00
l10n daemon script
287919dbe2 GIT_SILENT made messages (after extraction) 2020-07-25 07:38:44 +02:00
l10n daemon script
b561ec1415 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"
2020-07-25 05:31:46 +02:00
l10n daemon script
04d050a685 GIT_SILENT made messages (after extraction) 2020-07-25 02:15:15 +02:00
l10n daemon script
4f3e2f8bd9 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"
2020-07-24 09:37:32 +02:00
l10n daemon script
f284736978 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"
2020-07-24 05:49:48 +02:00
Albert Astals Cid
bdb4e9efbf GIT_SILENT Upgrade release service version to 20.11.70. 2020-07-11 12:40:23 +02:00
Albert Astals Cid
425783b825 GIT_SILENT Upgrade release service version to 20.07.80. 2020-07-11 12:08:07 +02:00
Albert Astals Cid
3cc2af7e18 KRandom -> QRandomGenerator
KRandom is now deprecated
2020-07-04 12:19:27 +02:00
Christoph Feck
49add727b0 GIT_SILENT Update Appstream for new release
(cherry picked from commit feafe98e1f)
2020-07-03 23:24:03 +02:00
l10n daemon script
10923d2e01 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"
2020-06-18 05:39:49 +02:00
l10n daemon script
ebbedab547 GIT_SILENT made messages (after extraction) 2020-06-18 02:19:22 +02:00
l10n daemon script
e824ea5534 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"
2020-06-17 14:07:28 +02:00
l10n daemon script
3462004357 GIT_SILENT made messages (after extraction) 2020-06-17 11:32:44 +02:00
l10n daemon script
d57a7e5aef 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"
2020-06-13 05:30:03 +02:00
Christoph Feck
60f8a418cd GIT_SILENT Update Appstream for new release
(cherry picked from commit b65b7ff2fd)
2020-06-08 20:05:22 +02:00
Yuri Chornoivan
ed56b1b8f7 GIT_SILENT: add KRFB icon as repository logo 2020-05-21 16:20:29 +03:00
Christoph Feck
3f0f6e9efb GIT_SILENT Update Appstream for new release
(cherry picked from commit fc7c86a74b)
2020-05-11 23:30:00 +02:00
Christoph Feck
3e2a8b0ce2 GIT_SILENT Update Appstream for new release
(cherry picked from commit 8ed10f0d2a)
2020-04-15 11:22:14 +02:00
l10n daemon script
f178121c54 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"
2020-03-27 06:34:06 +01:00
l10n daemon script
3f5dabf76b GIT_SILENT made messages (after extraction) 2020-03-27 03:37:10 +01:00
Albert Astals Cid
bb403a310f GIT_SILENT Upgrade release service version to 20.07.70. 2020-03-15 19:45:54 +01:00
l10n daemon script
f32dde2af7 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"
2020-03-02 05:47:18 +01:00
Pino Toscano
4e6062e9af Merge remote-tracking branch 'origin/release/19.12' 2020-03-01 13:52:38 +01:00
Pino Toscano
8ea2ca9afb appdata: remove duplicate <releases>
fix my merge from release/19.12
2020-03-01 13:52:30 +01:00
Christoph Feck
081d1222b6 GIT_SILENT Update Appstream for new release 2020-03-01 10:49:41 +01:00
Pino Toscano
55d749ce9a Merge remote-tracking branch 'origin/release/19.12' 2020-03-01 09:55:22 +01:00
Pino Toscano
07b48fe44f unbreak appdata
fixes commit 024f02a70f
2020-03-01 09:54:18 +01:00
Christoph Feck
1da8e3c84a GIT_SILENT Upgrade KDE Applications version to 19.12.3. 2020-02-29 23:30:44 +01:00
Jan Grulich
92c9905f36 PW framebuffer: support upcoming PipeWire 0.3
Summary: Adds support for slightly different PipeWire API.

Test Plan: Tested with xdg-desktop-portal-kde and new pipewire.

Reviewers: Kanedias

Reviewed By: Kanedias

Differential Revision: https://phabricator.kde.org/D27287
2020-02-26 14:22:27 +01:00
Jan Grulich
a62ef07e9d PW framebuffer: send correct type over DBus 2020-02-10 14:23:29 +01:00
l10n daemon script
a20cc6963a GIT_SILENT made messages (after extraction) 2020-02-05 03:20:28 +01:00
Jonathan Riddell
024f02a70f GIT_SILENT manually merge release versions from release/19.12 branch, in future this will be cherry picked along with the branch commit 2020-02-04 18:15:49 +00:00
Christoph Feck
f473c88aff GIT_SILENT Update Appstream for new release 2020-02-04 00:29:19 +01:00
Christoph Feck
4acb23aa5e GIT_SILENT Upgrade KDE Applications version to 19.12.2. 2020-02-02 15:06:53 +01:00
l10n daemon script
f162574aba 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"
2020-01-19 09:14:45 +01:00
Christoph Feck
5f53df2e76 Update Appstream for new release 2020-01-06 15:07:36 +01:00
l10n daemon script
ba87204070 GIT_SILENT made messages (after extraction) 2020-01-06 08:37:19 +01:00
l10n daemon script
8df008137a GIT_SILENT made messages (after extraction) 2020-01-06 03:27:18 +01:00
Albert Astals Cid
9b422f1338 Fix uninitialized memory read when calling rfbEncryptBytes
rfbEncryptBytes calls strlen on passwd so we need to make sure there's
an empty null character at the end if the password is of MAXPWLEN size
2020-01-05 20:09:17 +01:00
Albert Astals Cid
92b6f2fe68 Merge remote-tracking branch 'origin/release/19.12' 2020-01-05 19:15:19 +01:00
Albert Astals Cid
bb59ce2776 Correctly populate max color values in server screen format
Summary:
Compute max color values from color masks, instead of relying on unreliable `bits_per_rgb_value` provided by `xcb_visualtype_t`.

In some cases (e.g. nvidia?) `bits_per_rgb_value` contains wrong value. This results in wrong max color values, and causes weird color translation inside libvncserver. Clients will see a screen which is sorta recognizable but in a complete off-color, making krfb unusable.

This is probably a bug in drivers, but x11vnc does not use this value[1], so I guess it's fair to ignore it in krfb too.

[1]: https://github.com/LibVNC/x11vnc/blob/master/src/screen.c#L3442

Reviewers: alexeymin, aacid, #kde_applications

Differential Revision: https://phabricator.kde.org/D25876
2020-01-05 19:14:24 +01:00
Christoph Feck
6c78a2f98d GIT_SILENT Upgrade KDE Applications version to 19.12.1. 2020-01-05 05:40:44 +01:00
Jonathan Riddell
8a7965fa6f Change KDE_APPLICATIONS_VERSION to RELEASE_SERVICE_VERSION https://phabricator.kde.org/T11933
GIT_SILENT
2019-12-10 16:39:41 +00:00
Christoph Feck
c136ef0681 Update Appstream for new release 2019-12-05 22:17:30 +01:00
Christoph Feck
afc1fb6b88 GIT_SILENT Upgrade KDE Applications version to 19.12.0. 2019-12-05 20:50:38 +01:00
Albert Astals Cid
e4362a655e GIT_SILENT Upgrade KDE Applications version to 19.11.90. 2019-11-26 23:34:51 +01:00
Yuri Chornoivan
e2ebae3b19 Use URLs with transport encryption 2019-11-18 20:50:04 +02:00
l10n daemon script
f3648d11a3 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"
2019-11-11 09:48:29 +01:00
l10n daemon script
e897ce9b49 GIT_SILENT made messages (after extraction) 2019-11-11 08:20:49 +01:00
Albert Astals Cid
8ff1f8fb21 GIT_SILENT Upgrade KDE Applications version to 19.11.80. 2019-11-10 12:01:22 +01:00
l10n daemon script
f139985c99 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"
2019-11-10 05:27:11 +01:00
l10n daemon script
45d4a9cad7 GIT_SILENT made messages (after extraction) 2019-11-10 03:11:48 +01:00
Albert Astals Cid
dd7f1af0bc GIT_SILENT Upgrade KDE Applications version to 20.03.70. 2019-11-10 01:22:53 +01:00
Jan Grulich
b8861cd229 Merge branch 'Applications/19.08' 2019-11-06 14:52:13 +01:00
Jan Grulich
80db244c7d Un-break portal support
Summary: We need to mention what wayland interfaces will be used, otherwise KWin will not let us to use them.

Reviewers: apol

Reviewed By: apol

Differential Revision: https://phabricator.kde.org/D25167
2019-11-06 14:51:19 +01:00
Christoph Feck
439bacb527 GIT_SILENT Upgrade KDE Applications version to 19.08.3. 2019-11-01 22:57:16 +01:00
Christoph Feck
28f2cca952 GIT_SILENT Upgrade KDE Applications version to 19.08.2. 2019-10-06 05:13:10 +02:00
l10n daemon script
f2b1e60106 GIT_SILENT made messages (after extraction) 2019-09-30 07:34:44 +02:00
l10n daemon script
08c8bd84b1 GIT_SILENT made messages (after extraction) 2019-09-30 02:59:39 +02:00
l10n daemon script
7a42bd3b65 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"
2019-09-05 09:09:34 +02:00
l10n daemon script
7190908aa3 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"
2019-09-05 05:19:48 +02:00
Christoph Feck
28fbf6c89c GIT_SILENT Upgrade KDE Applications version to 19.08.1. 2019-09-01 05:35:18 +02:00
l10n daemon script
853eeaa050 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"
2019-08-28 05:14:00 +02:00
l10n daemon script
8848a11ba4 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"
2019-08-27 08:48:52 +02:00
l10n daemon script
0234025013 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"
2019-08-24 05:08:24 +02:00
l10n daemon script
5498ce6390 GIT_SILENT made messages (after extraction) 2019-08-24 03:00:32 +02:00
l10n daemon script
46560f2f6a 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"
2019-08-20 08:26:33 +02:00
l10n daemon script
1c8afa165b 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"
2019-08-20 05:01:38 +02:00
l10n daemon script
4ffe2ce140 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"
2019-08-13 08:57:25 +02:00
l10n daemon script
e472644e10 GIT_SILENT made messages (after extraction) 2019-08-13 07:46:08 +02:00
l10n daemon script
1a23694b32 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"
2019-08-13 05:25:56 +02:00
l10n daemon script
210b1cfac9 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"
2019-08-12 08:33:44 +02:00
l10n daemon script
49c9dc2311 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"
2019-08-12 05:11:18 +02:00
Andreas Sturmlechner
1b5daefe54 Merge branch 'Applications/19.08' 2019-08-10 11:07:14 +02:00
Andreas Sturmlechner
62be4e43fd Add missing QHash
Summary:
Fixes build with future Frameworks.

In master, this should make 69c492a54b obsolete.

Reviewers: alexeymin, #kde_applications, lbeltrame

Reviewed By: alexeymin, #kde_applications, lbeltrame

Differential Revision: https://phabricator.kde.org/D23059
2019-08-10 11:05:10 +02:00
Luca Beltrame
1190610710 Merge branch 'Applications/19.08' 2019-08-09 15:58:57 +02:00
Luca Beltrame
69c492a54b Attempt to fix build
At least with Qt 5.13, it looks like the QHash include isn't being
included transitively.
2019-08-09 15:56:44 +02:00
Christoph Feck
06d711dd79 GIT_SILENT Upgrade KDE Applications version to 19.08.0. 2019-08-09 02:08:09 +02:00
l10n daemon script
f417d230d7 GIT_SILENT made messages (after extraction) 2019-08-08 02:57:01 +02:00
l10n daemon script
6b7a17a327 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"
2019-08-07 08:40:26 +02:00
l10n daemon script
13f6082465 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"
2019-08-07 05:06:46 +02:00
l10n daemon script
0c1aaa62c1 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"
2019-08-06 08:30:32 +02:00
l10n daemon script
826904c4ca 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"
2019-08-03 08:34:22 +02:00
l10n daemon script
eb1b74d90b 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"
2019-08-03 05:05:05 +02:00
l10n daemon script
fad81c061a 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"
2019-07-31 09:02:57 +02:00
l10n daemon script
a360e5c8ae 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"
2019-07-31 05:17:18 +02:00
Christoph Feck
9e9acb4833 GIT_SILENT Upgrade KDE Applications version to 19.07.90. 2019-07-29 15:53:33 +02:00
l10n daemon script
d22dca0833 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"
2019-07-27 08:45:59 +02:00
l10n daemon script
b0712e1874 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"
2019-07-27 05:15:30 +02:00
l10n daemon script
142a652b25 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"
2019-07-22 08:37:21 +02:00
l10n daemon script
87ad1774a2 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"
2019-07-22 05:10:18 +02:00
l10n daemon script
388aa12a96 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"
2019-07-21 08:49:31 +02:00
l10n daemon script
ed9fe37985 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"
2019-07-21 05:20:01 +02:00
l10n daemon script
bd9e576684 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"
2019-07-19 09:05:33 +02:00
l10n daemon script
bfeba242ea 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"
2019-07-19 05:37:59 +02:00
l10n daemon script
be4ec5fe7a 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"
2019-07-18 08:44:59 +02:00
l10n daemon script
8e51ddfb45 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"
2019-07-18 05:22:56 +02:00
l10n daemon script
445cb49e16 GIT_SILENT made messages (after extraction) 2019-07-16 07:43:35 +02:00
l10n daemon script
a4c4dd29a5 GIT_SILENT made messages (after extraction) 2019-07-16 02:53:03 +02:00
Albert Astals Cid
078a05e368 GIT_SILENT Upgrade KDE Applications version to 19.11.70. 2019-07-15 21:49:47 +02:00
Albert Astals Cid
f1ec721e47 GIT_SILENT Upgrade KDE Applications version to 19.07.80. 2019-07-15 21:27:52 +02:00
l10n daemon script
f8e02290a3 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"
2019-07-14 05:16:48 +02:00
l10n daemon script
0e5ac2d9aa 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"
2019-07-12 05:17:58 +02:00
Alexey Min
9828143609 New dep: KWindowSystem and support running in Wayland
This commit adds a new dependency - KWindowSystem, to help
with window system detection. If wayland is detected, then
preferred framebuffer plugin is switched to "pw" (pipewire).
2019-07-07 14:28:10 +03:00
Alexey Min
0cc47b9a06 Remove unneeded moc include 2019-07-07 14:10:52 +03:00
Alexey Min
656c90916c Fix unused variable warning 2019-07-07 14:06:46 +03:00
l10n daemon script
296f5db567 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"
2019-06-26 05:19:24 +02:00
Alexey Min
e15c5d634d Fix clazy: unused non-trivial variable
unused QByteArray [-Wclazy-unused-non-trivial-variable]

That variable was totally unused!
2019-06-20 23:21:40 +03:00
Alexey Min
22b017e0b0 Fix clazy: calling QByteArray::data() on temporary
Don't call QByteArray::data() on temporary [-Wclazy-detaching-temporary]

data() is not const and will detach, call constData() instead
2019-06-20 23:18:56 +03:00
Alexey Min
05b96c0bd0 clazy: Don't call QList::first() on temporary
Don't call QList::first() on temporary [-Wclazy-detaching-temporary]

There is a constFirst() for that, to prevent detaching
2019-06-20 23:06:57 +03:00
Alexey Min
fa7c32fbb9 Fix clazy warning about lambda context object
Pass a context object as 3rd connect parameter [-Wclazy-connect-3arg-lambda]
2019-06-20 23:00:34 +03:00
Alexey Min
acf4f7393e bzero() function is obsoleted by memset()
Another clang-tidy warning.
The bzero() function is deprecated (marked as
LEGACY in POSIX.1-2001); use memset(3) in new
programs. POSIX.1-2008 removes the specification
of bzero().
2019-06-20 00:58:29 +03:00
Alexey Min
43aeee4c3e Fix clang-tidy warn: call to virtual function during destruction 2019-06-20 00:42:00 +03:00
Alexey Min
aab2869883 Fix potential use of pointer after checking for nullptr
Code below continues to use the pointer after a check for
nullptr like nothing happened. Probably continue is missing
in a loop.

clang-tidy: Called C++ object pointer is null
  at eventsmanager.cpp:87
  at framebuffermanager.cpp:86
2019-06-20 00:23:37 +03:00
Alexey Min
306a094540 Fix unused parameter warning 2019-06-20 00:05:34 +03:00
Alexey Min
a774e678bb Remove unneeded .moc includes
[5/8] Automatic MOC for target krfb_events_x11
AutoMoc warning
---------------
  "~/dev/kde/krfb/events/x11/x11events.cpp"
The file includes the moc file "x11events.moc",
but does not contain a Q_OBJECT, Q_GADGET,
Q_NAMESPACE, K_PLUGIN_FACTORY,
K_PLUGIN_FACTORY_WITH_JSON or
K_PLUGIN_CLASS_WITH_JSON macro.

AutoMoc: ~/dev/kde/krfb/events/x11/x11events.cpp:0:
 Note: No relevant classes found. No output generated.
2019-06-19 23:50:45 +03:00
Alexey Min
718b0ac000 Show hostname in krfb connection info
Summary:
Using krfb as desktop support tool for ~250 desktops on LAN - 95% of the users aren't equipped to deal with reciting IP addresses accurately, so I wanted to add the hostname into the connection details as well, since it's easier for non-tech people to read that back.

Attached patch does this, and works internally for us - thoughts on doing it better:
* hostnames as reported by the host are not necessarily accurate for network access, so
* consider actually doing a nameserver lookup to verify
* only show the hostname if you can verify

Reviewers: ngraham, #kde_applications, aacid

Reviewed By: #kde_applications, aacid

Subscribers: akulichalexandr, aacid, pino, alexeymin

Tags: #kde_applications

Differential Revision: https://phabricator.kde.org/D14527
2019-06-19 23:09:26 +03:00
l10n daemon script
4230b2234b 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"
2019-06-12 05:33:49 +02:00
l10n daemon script
f5467f826c 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"
2019-06-03 05:29:38 +02:00
Jonathan Riddell
0a0a7f096a stick to one category 2019-05-31 20:16:44 +01:00
l10n daemon script
94ea33aaa4 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"
2019-05-31 05:09:53 +02:00
l10n daemon script
3f471e6fd1 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"
2019-05-28 05:19:21 +02:00
l10n daemon script
e018e1a7c5 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"
2019-05-27 05:13:28 +02:00
l10n daemon script
576cef1a12 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"
2019-05-26 05:18:37 +02:00
l10n daemon script
77f5ae8230 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"
2019-05-25 05:26:01 +02:00
Jan Grulich
c05707884c Implement Wayland support using PipeWire and xdg-desktop-portal
Summary:
Adds a new framebuffer implementation, which uses xdg-desktop-portal to support remote
desktop on Wayland and uses PipeWire to deliver the screen content. So far only mouse
support is implemented, because keyboard support is missing on KWin side.

Reviewers: Kanedias, romangg

Reviewed By: Kanedias

Subscribers: asturmlechner, pino, ngraham, romangg

Differential Revision: https://phabricator.kde.org/D20402
2019-05-24 13:51:43 +02:00
Alexey Min
7624aee8e2 Do not crash on wayland, gracefully exit with error instead
Summary:
Sadly, XTestQueryExtension just segfaults under wayland.
Avoid it by detecting QPA used.

BUG: 406599

Test Plan:
Nice error message when running in Wayland session.
{F6833467}

Still works in X11
{F6833069}

Reviewers: aacid, kossebau, jgrulich, #kde_applications, pino, ngraham

Reviewed By: pino

Subscribers: pino, ngraham

Tags: #kde_applications

Differential Revision: https://phabricator.kde.org/D21267
2019-05-18 18:07:52 +03:00
Alexey Min
6ecb4248b8 Fix warning when compiling with Qt >= 5.10 2019-05-18 02:05:16 +03:00
l10n daemon script
61cedda6b3 GIT_SILENT made messages (after extraction) 2019-04-22 03:24:42 +02:00
Albert Astals Cid
895ec578c6 GIT_SILENT Upgrade KDE Applications version to 19.07.70. 2019-03-16 22:21:36 +01:00
70 changed files with 3656 additions and 504 deletions

26
.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
# Ignore the following files
*~
*.[oa]
*.diff
*.kate-swp
*.kdev4
.kdev_include_paths
*.kdevelop.pcs
*.moc
*.moc.cpp
*.orig
*.user
.*.swp
.swp.*
Doxyfile
Makefile
/build*/
.cmake/
CMakeLists.txt.user*
*.unc-backup*
.clang-format
/compile_commands.json
.clangd
.cache
.idea
/cmake-build*

View File

@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.16)
# KDE Application Version, managed by release script
set (KDE_APPLICATIONS_VERSION_MAJOR "19")
set (KDE_APPLICATIONS_VERSION_MINOR "03")
set (KDE_APPLICATIONS_VERSION_MICRO "70")
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "07")
set (RELEASE_SERVICE_VERSION_MICRO "80")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(krfb VERSION ${KDE_APPLICATIONS_VERSION})
project(krfb VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION 5.6.0)
set(KF5_MIN_VERSION 5.31.0)
set(QT_MIN_VERSION 5.15.0)
set(KF5_MIN_VERSION 5.83.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})
@@ -20,13 +20,16 @@ include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMInstallIcons)
include(ECMAddAppIcon)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
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(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
I18n
Completion
Config
CoreAddons
Crash
@@ -36,6 +39,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Notifications
Wallet
WidgetsAddons
WindowSystem
XmlGui
)
@@ -73,6 +77,35 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
find_package(LibVNCServer REQUIRED)
pkg_check_modules(PipeWire IMPORTED_TARGET libpipewire-0.3)
add_feature_info(PipeWire PipeWire_FOUND "Required for pipewire screencast plugin")
find_package(gbm)
set_package_properties(gbm PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
)
find_package(EGL)
set_package_properties(EGL PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
)
find_package(epoxy)
set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy"
URL "https://github.com/anholt/libepoxy"
TYPE OPTIONAL
PURPOSE "Required for dma-buf support in pipewire screencast plugin."
)
if(EGL_FOUND AND gbm_FOUND AND epoxy_FOUND)
set (HAVE_DMA_BUF TRUE)
else()
set (HAVE_DMA_BUF FALSE)
endif()
ecm_setup_version(PROJECT
VARIABLE_PREFIX KRFB
VERSION_HEADER "krfb_version.h")
@@ -88,9 +121,16 @@ if(Q_WS_X11)
endif(NOT X11_XTest_FOUND)
endif(Q_WS_X11)
add_subdirectory(events)
add_subdirectory(krfb)
add_subdirectory(framebuffers)
add_subdirectory(doc)
add_subdirectory(icons)
ecm_qt_install_logging_categories(
EXPORT KRFB
FILE krfb.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

128
CMakePresets.json Normal file
View File

@@ -0,0 +1,128 @@
{
"version": 2,
"configurePresets": [
{
"name": "dev",
"displayName": "Build as debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "asan",
"displayName": "Build with Asan support.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-asan",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"ECM_ENABLE_SANITIZERS" : "'address;undefined'",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "dev-clang",
"displayName": "dev-clang",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-clang",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"environment": {
"CXX": "clang++",
"CCACHE_DISABLE": "ON"
}
},
{
"name": "unity",
"displayName": "Build with CMake unity support.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-unity",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_UNITY_BUILD": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "release",
"displayName": "Build as release mode.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "profile",
"displayName": "profile",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-profile",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "clazy",
"displayName": "clazy",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-clazy",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
},
"environment": {
"CXX": "clazy",
"CCACHE_DISABLE": "ON"
}
}
],
"buildPresets": [
{
"name": "dev",
"configurePreset": "dev"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "dev-clang",
"configurePreset": "dev-clang"
},
{
"name": "asan",
"configurePreset": "asan"
},
{
"name": "unity",
"configurePreset": "unity"
},
{
"name": "clazy",
"configurePreset": "clazy",
"environment": {
"CLAZY_CHECKS" : "level0,level1,detaching-member,ifndef-define-typo,isempty-vs-count,qrequiredresult-candidates,reserve-candidates,signal-with-return-value,unneeded-cast,function-args-by-ref,function-args-by-value,returning-void-expression,no-ctor-missing-parent-argument,isempty-vs-count,qhash-with-char-pointer-key,raw-environment-function,qproperty-type-mismatch,old-style-connect,qstring-allocations,container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,qstring-varargs,level2,detaching-member,heap-allocated-small-trivial-type,isempty-vs-count,qstring-varargs,qvariant-template-instantiation,raw-environment-function,reserve-candidates,signal-with-return-value,thread-with-slots,no-ctor-missing-parent-argument,no-missing-typeinfo",
"CCACHE_DISABLE" : "ON"
}
}
],
"testPresets": [
{
"name": "dev",
"configurePreset": "dev",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": false}
},
{
"name": "asan",
"configurePreset": "asan",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
}
]
}

View File

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

104
cmake/modules/Findgbm.cmake Normal file
View File

@@ -0,0 +1,104 @@
#.rst:
# Findgbm
# -------
#
# Try to find gbm on a Unix system.
#
# This will define the following variables:
#
# ``gbm_FOUND``
# True if (the requested version of) gbm is available
# ``gbm_VERSION``
# The version of gbm
# ``gbm_LIBRARIES``
# This can be passed to target_link_libraries() instead of the ``gbm::gbm``
# target
# ``gbm_INCLUDE_DIRS``
# This should be passed to target_include_directories() if the target is not
# used for linking
# ``gbm_DEFINITIONS``
# This should be passed to target_compile_options() if the target is not
# used for linking
#
# If ``gbm_FOUND`` is TRUE, it will also define the following imported target:
#
# ``gbm::gbm``
# The gbm library
#
# In general we recommend using the imported target, as it is easier to use.
# Bear in mind, however, that if the target is in the link interface of an
# exported library, it must be made available by the package config file.
#=============================================================================
# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
# SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "CMake 2.8.12 is required by Findgbm.cmake")
endif()
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake")
endif()
if(NOT WIN32)
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
pkg_check_modules(PKG_gbm QUIET gbm)
set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER})
set(gbm_VERSION ${PKG_gbm_VERSION})
find_path(gbm_INCLUDE_DIR
NAMES
gbm.h
HINTS
${PKG_gbm_INCLUDE_DIRS}
)
find_library(gbm_LIBRARY
NAMES
gbm
HINTS
${PKG_gbm_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(gbm
FOUND_VAR
gbm_FOUND
REQUIRED_VARS
gbm_LIBRARY
gbm_INCLUDE_DIR
VERSION_VAR
gbm_VERSION
)
if(gbm_FOUND AND NOT TARGET gbm::gbm)
add_library(gbm::gbm UNKNOWN IMPORTED)
set_target_properties(gbm::gbm PROPERTIES
IMPORTED_LOCATION "${gbm_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${gbm_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${gbm_INCLUDE_DIR}"
)
endif()
mark_as_advanced(gbm_LIBRARY gbm_INCLUDE_DIR)
# compatibility variables
set(gbm_LIBRARIES ${gbm_LIBRARY})
set(gbm_INCLUDE_DIRS ${gbm_INCLUDE_DIR})
set(gbm_VERSION_STRING ${gbm_VERSION})
else()
message(STATUS "Findgbm.cmake cannot find gbm on Windows systems.")
set(gbm_FOUND FALSE)
endif()
include(FeatureSummary)
set_package_properties(gbm PROPERTIES
URL "https://www.mesa3d.org"
DESCRIPTION "Mesa gbm library."
)

View File

@@ -0,0 +1,374 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2017-2018 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
-->
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<!--
org.freedesktop.portal.RemoteDesktop:
@short_description: Remote desktop portal
The Remote desktop portal allows to create remote desktop sessions.
This documentation describes version 1 of this interface.
-->
<interface name="org.freedesktop.portal.RemoteDesktop">
<!--
CreateSession:
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Create a remote desktop session.
A remote desktop session is used to allow remote controlling a desktop
session. It can also be used together with a screen cast session (see
org.freedesktop.portal.ScreenCast), but may only be started and stopped
with this interface.
To also get a screen content, call the
#org.freedesktop.ScreenCast.SelectSources with the
#org.freedesktop.Session object created with this method.
Supported keys in the @options vardict include:
<variablelist>
<varlistentry>
<term>handle_token s</term>
<listitem><para>
A string that will be used as the last element of the @handle. Must be a valid
object path element. See the #org.freedesktop.portal.Request documentation for
more information about the @handle.
</para></listitem>
</varlistentry>
<varlistentry>
<term>session_handle_token s</term>
<listitem><para>
A string that will be used as the last element of the session handle. Must be a valid
object path element. See the #org.freedesktop.portal.Session documentation for
more information about the session handle.
</para></listitem>
</varlistentry>
</variablelist>
The following results get returned via the #org.freedesktop.portal.Request::Response signal:
<variablelist>
<varlistentry>
<term>session_handle o</term>
<listitem><para>
The session handle. An object path for the
#org.freedesktop.portal.Session object representing the created
session.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="CreateSession">
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
SelectDevices:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Select input devices to remote control.
Supported keys in the @options vardict include:
<variablelist>
<varlistentry>
<term>handle_token s</term>
<listitem><para>
A string that will be used as the last element of the @handle. Must be a valid
object path element. See the #org.freedesktop.portal.Request documentation for
more information about the @handle.
</para></listitem>
</varlistentry>
<varlistentry>
<term>type u</term>
<listitem><para>
Bitmask of what device types to request remote controlling of.
Default is all.
</para></listitem>
</varlistentry>
</variablelist>
For available source types, see the AvailableDeviceTypes property.
-->
<method name="SelectDevices">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
Start:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@parent_window: Identifier for the application window, see <link linkend="parent_window">Common Conventions</link>
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Start the remote desktop session. This will typically result in the portal
presenting a dialog letting the user select what to share, including
devices and optionally screen content if screen cast sources was
selected.
Supported keys in the @options vardict include:
<variablelist>
<varlistentry>
<term>handle_token s</term>
<listitem><para>
A string that will be used as the last element of the @handle. Must be a valid
object path element. See the #org.freedesktop.portal.Request documentation for
more information about the @handle.
</para></listitem>
</varlistentry>
</variablelist>
The following results get returned via the
#org.freedesktop.portal.Request::Response signal:
<variablelist>
<varlistentry>
<term>devices u</term>
<listitem><para>
A bitmask of the devices selected by the user.
</para></listitem>
</varlistentry>
</variablelist>
If a screen cast source was selected, the results of the
#org.freedesktop.portal.ScreenCast.Start response signal may be
included.
-->
<method name="Start">
<arg type="o" name="session_handle" direction="in"/>
<arg type="s" name="parent_window" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
NotifyPointerMotion:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@dx: Relative movement on the x axis
@dy: Relative movement on the y axis
Notify about a new relative pointer motion event. The (dx, dy) vector
represents the new pointer position in the streams logical coordinate
space.
-->
<method name="NotifyPointerMotion">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="d" name="dx" direction="in"/>
<arg type="d" name="dy" direction="in"/>
</method>
<!--
NotifyPointerMotionAbsolute:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@stream: The PipeWire stream node the coordinate is relative to
@x: Pointer motion x coordinate
@y: Pointer motion y coordinate
Notify about a new absolute pointer motion event. The (x, y) position
represents the new pointer position in the streams logical coordinate
space (see the logical_size stream property in
#org.freedesktop.portal.ScreenCast).
-->
<method name="NotifyPointerMotionAbsolute">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="u" name="stream" direction="in"/>
<arg type="d" name="x" direction="in"/>
<arg type="d" name="y" direction="in"/>
</method>
<!--
NotifyPointerButton:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@button: The pointer button was pressed or released
@state: The new state of the button
The pointer button is encoded according to Linux Evdev button codes.
May only be called if POINTER access was provided after starting the
session.
Available button states:
<simplelist>
<member>0: Released</member>
<member>1: Pressed</member>
</simplelist>
-->
<method name="NotifyPointerButton">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="i" name="button" direction="in"/>
<arg type="u" name="state" direction="in"/>
</method>
<!--
NotifyPointerAxis:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@dx: Relative axis movement on the x axis
@dy: Relative axis movement on the y axis
The axis movement from a 'smooth scroll' device, such as a touchpad.
When applicable, the size of the motion delta should be equivalent to
the motion vector of a pointer motion done using the same advice.
May only be called if POINTER access was provided after starting the
session.
Supported keys in the @options vardict include:
<variablelist>
<varlistentry>
<term>finish b</term>
<listitem><para>
If set to true, this is the last axis event in a series, for
example as a result of the fingers being lifted from a touchpad
after a two-finger scroll. Default is false.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="NotifyPointerAxis">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="d" name="dx" direction="in"/>
<arg type="d" name="dy" direction="in"/>
</method>
<!--
NotifyPointerAxisDiscrete:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@axis: The axis that was scrolled
@steps: The number of steps scrolled
May only be called if POINTER access was provided after starting the
session.
Available axes:
<simplelist>
<member>0: Vertical scroll</member>
<member>1: Horizontal scroll</member>
</simplelist>
-->
<method name="NotifyPointerAxisDiscrete">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="u" name="axis" direction="in"/>
<arg type="i" name="steps" direction="in"/>
</method>
<!--
NotifyKeyboardKeycode:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@keycode: Keyboard code that was pressed or released
@state: New state of keyboard keysym
May only be called if KEYBOARD access was provided after starting the
session.
Available keyboard keysym states:
<simplelist>
<member>0: Released</member>
<member>1: Pressed</member>
</simplelist>
-->
<method name="NotifyKeyboardKeycode">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="i" name="keycode" direction="in"/>
<arg type="u" name="state" direction="in"/>
</method>
<!--
NotifyKeyboardKeysym:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@keysym: Keyboard symbol that was pressed or released
@state: New state of keyboard keysym
May only be called if KEYBOARD access was provided after starting the
session.
Available keyboard keysym states:
<simplelist>
<member>0: Released</member>
<member>1: Pressed</member>
</simplelist>
-->
<method name="NotifyKeyboardKeysym">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="i" name="keysym" direction="in"/>
<arg type="u" name="state" direction="in"/>
</method>
<!--
NotifyTouchDown:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@stream: The PipeWire stream node the coordinate is relative to
@slot: Touch slot where touch point appeared
@x: Touch down x coordinate
@y: Touch down y coordinate
May only be called if TOUCHSCREEN access was provided after starting the
session.
Notify about a new touch down event. The (x, y) position
represents the new touch point position in the streams logical
coordinate space (see the logical_size stream property in
#org.freedesktop.portal.ScreenCast).
-->
<method name="NotifyTouchDown">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="u" name="stream" direction="in"/>
<arg type="u" name="slot" direction="in"/>
<arg type="d" name="x" direction="in"/>
<arg type="d" name="y" direction="in"/>
</method>
<!--
NotifyTouchMotion:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@stream: The PipeWire stream node the coordinate is relative to
@slot: Touch slot where touch point appeared
@x: Touch motion x coordinate
@y: Touch motion y coordinate
May only be called if TOUCHSCREEN access was provided after starting the
session.
Notify about a new touch motion event. The (x, y) position
represents where the touch point position in the streams logical
coordinate space moved (see the logical_size stream property in
#org.freedesktop.portal.ScreenCast).
-->
<method name="NotifyTouchMotion">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="u" name="stream" direction="in"/>
<arg type="u" name="slot" direction="in"/>
<arg type="d" name="x" direction="in"/>
<arg type="d" name="y" direction="in"/>
</method>
<!--
NotifyTouchUp:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@slot: Touch slot where touch point appeared
May only be called if TOUCHSCREEN access was provided after starting the
session.
Notify about a new touch up event.
-->
<method name="NotifyTouchUp">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="u" name="slot" direction="in"/>
</method>
<!--
AvailableDeviceTypes:
A bitmask of available source types. Currently defined types are:
<simplelist>
<member>1: KEYBOARD</member>
<member>2: POINTER</member>
<member>4: TOUCHSCREEN</member>
</simplelist>
-->
<property name="AvailableDeviceTypes" type="u" access="read"/>
<property name="version" type="u" access="read"/>
</interface>
</node>

View File

@@ -0,0 +1,186 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2017-2018 Red Hat, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
-->
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
<!--
org.freedesktop.portal.ScreenCast:
@short_description: Screen cast portal
-->
<interface name="org.freedesktop.portal.ScreenCast">
<!--
CreateSession:
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Create a screen cast session. A successfully created session can at
any time be closed using org.freedesktop.portal.Session::Close, or may
at any time be closed by the portal implementation, which will be
signalled via org.freedesktop.portal.Session::Closed.
The following results get returned via the #org.freedesktop.portal.Request::Response signal:
<variablelist>
<varlistentry>
<term>session_handle o</term>
<listitem><para>
The session handle. An object path for the
#org.freedesktop.portal.Session object representing the created
session.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="CreateSession">
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
SelectSources:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Configure what the screen cast session should record. This method must
be called before starting the session.
Passing invalid input to this method will cause the session to be
closed. An application may only attempt to select sources once per
session.
Supported keys in the @options vardict include:
<variablelist>
<varlistentry>
<term>types u</term>
<listitem><para>
Bitmask of what types of content to record. Default is MONITOR.
</para></listitem>
</varlistentry>
<varlistentry>
<term>multiple b</term>
<listitem><para>
Whether to allow selecting multiple sources. Default is no.
</para></listitem>
</varlistentry>
</variablelist>
For available source types, see the AvailableSourceTypes property.
-->
<method name="SelectSources">
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
Start:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@parent_window: Identifier for the application window
@options: Vardict with optional further information
@handle: Object path for the #org.freedesktop.portal.Request object representing this call
Start the screen cast session. This will typically result the portal
presenting a dialog letting the user do the selection set up by
SelectSources. An application can only attempt start a session once.
A screen cast session may only be started after having selected sources
using org.freedesktop.portal.ScreenCast::SelectSources.
The @parent_window identifier must be of the form "x11:$XID" for an X11
window. Support for other window systems may be added in the future.
The following results get returned via the
#org.freedesktop.portal.Request::Response signal:
<variablelist>
<varlistentry>
<term>streams a(ua{sv})</term>
<listitem><para>
An array of PipeWire streams. Each stream consists of a PipeWire
node ID (the first element in the tuple, and a Vardict of
properties.
The array will contain a single stream if 'multiple' (see
SelectSources) was set to 'false', or at least one stream if
'multiple' was set to 'true' as part of the SelectSources method.
</para></listitem>
</varlistentry>
</variablelist>
Stream properties include:
<variablelist>
<varlistentry>
<term>position (ii)</term>
<listitem><para>
A tuple consisting of the position (x, y) in the compositor
coordinate space. Note that the position may not be equivalent to a
position in a pixel coordinate space. Only available for monitor
streams.
</para></listitem>
</varlistentry>
<varlistentry>
<term>size (ii)</term>
<listitem><para>
A tuple consisting of (width, height). The size represents the size
of the stream as it is displayed in the compositor coordinate
space. Note that this size may not be equivalent to a size in a
pixel coordinate space. The size may differ from the size of the
stream.
</para></listitem>
</varlistentry>
</variablelist>
-->
<method name="Start">
<arg type="o" name="session_handle" direction="in"/>
<arg type="s" name="parent_window" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In2" value="QVariantMap"/>
<arg type="o" name="handle" direction="out"/>
</method>
<!--
OpenPipeWireRemote:
@session_handle: Object path for the #org.freedesktop.portal.Session object
@options: Vardict with optional further information
@fd: File descriptor of an open PipeWire remote.
Open a file descriptor to the PipeWire remote where the screen cast
streams are available. The file descriptor should be used to create a
<classname>pw_remote</classname> object, by using
<function>pw_remote_connect_fd</function>. Only the screen cast stream
nodes will be available from this PipeWire node.
-->
<method name="OpenPipeWireRemote">
<annotation name="org.gtk.GDBus.C.Name" value="open_pipewire_remote"/>
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg type="o" name="session_handle" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="h" name="fd" direction="out"/>
</method>
<!--
AvailableSourceTypes:
A bitmask of available source types. Currently defined types are:
<simplelist>
<member>1: MONITOR</member>
<member>2: WINDOW</member>
</simplelist>
-->
<property name="AvailableSourceTypes" type="u" access="read"/>
<property name="version" type="u" access="read"/>
</interface>
</node>

View File

@@ -1,2 +1,2 @@
########### install files ###############
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR krfb)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR krfb)

6
events/CMakeLists.txt Normal file
View File

@@ -0,0 +1,6 @@
add_subdirectory(x11)
# Makes sense to use only when PW framebuffer is used
if (${PipeWire_FOUND})
add_subdirectory(xdp)
endif()

18
events/x11/CMakeLists.txt Normal file
View File

@@ -0,0 +1,18 @@
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set (krfb_events_x11_SRCS
x11events.cpp
x11eventsplugin.cpp
)
add_library (krfb_events_x11 MODULE ${krfb_events_x11_SRCS})
target_link_libraries (krfb_events_x11
${X11_XTest_LIB}
KF5::CoreAddons
krfbprivate
)
install (TARGETS krfb_events_x11 DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events)

View File

@@ -0,0 +1,66 @@
{
"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"
}
}

210
events/x11/x11events.cpp Normal file
View File

@@ -0,0 +1,210 @@
/*
This file is part of the KDE project
Copyright (C) 2016 by Oleg Chernovskiy <kanedias@xaker.ru>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "x11events.h"
#include <QApplication>
#include <QX11Info>
#include <QDesktopWidget>
#include <QGlobalStatic>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
#include <QX11Info>
enum {
LEFTSHIFT = 1,
RIGHTSHIFT = 2,
ALTGR = 4
};
class EventData
{
public:
EventData();
//keyboard
Display *dpy = nullptr;
signed char modifiers[0x100] = {};
KeyCode keycodes[0x100] = {};
KeyCode leftShiftCode = 0;
KeyCode rightShiftCode = 0;
KeyCode altGrCode = 0;
char modifierState = 0;
//mouse
int buttonMask = 0;
int x = 0;
int y = 0;
private:
void init();
};
Q_GLOBAL_STATIC(EventData, data)
EventData::EventData()
{
init();
}
void EventData::init()
{
buttonMask = 0;
dpy = QX11Info::display();
//initialize keycodes
KeySym key, *keymap;
int i, j, minkey, maxkey, syms_per_keycode;
memset(modifiers, -1, sizeof(modifiers));
XDisplayKeycodes(dpy, &minkey, &maxkey);
Q_ASSERT(minkey >= 8);
Q_ASSERT(maxkey < 256);
keymap = (KeySym *) XGetKeyboardMapping(dpy, minkey,
(maxkey - minkey + 1),
&syms_per_keycode);
Q_ASSERT(keymap);
for (i = minkey; i <= maxkey; i++) {
for (j = 0; j < syms_per_keycode; j++) {
key = keymap[(i-minkey)*syms_per_keycode+j];
if (key >= ' ' && key < 0x100 && i == XKeysymToKeycode(dpy, key)) {
keycodes[key] = i;
modifiers[key] = j;
}
}
}
leftShiftCode = XKeysymToKeycode(dpy, XK_Shift_L);
rightShiftCode = XKeysymToKeycode(dpy, XK_Shift_R);
altGrCode = XKeysymToKeycode(dpy, XK_Mode_switch);
XFree((char *)keymap);
}
/* this function adjusts the modifiers according to mod (as from modifiers) and data->modifierState */
static void tweakModifiers(signed char mod, bool down)
{
bool isShift = data->modifierState & (LEFTSHIFT | RIGHTSHIFT);
if (mod < 0) {
return;
}
if (isShift && mod != 1) {
if (data->modifierState & LEFTSHIFT) {
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
down, CurrentTime);
}
if (data->modifierState & RIGHTSHIFT) {
XTestFakeKeyEvent(data->dpy, data->rightShiftCode,
down, CurrentTime);
}
}
if (!isShift && mod == 1) {
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
down, CurrentTime);
}
if ((data->modifierState & ALTGR) && mod != 2) {
XTestFakeKeyEvent(data->dpy, data->altGrCode,
!down, CurrentTime);
}
if (!(data->modifierState & ALTGR) && mod == 2) {
XTestFakeKeyEvent(data->dpy, data->altGrCode,
down, CurrentTime);
}
}
void X11EventHandler::handleKeyboard(bool down, rfbKeySym keySym)
{
#define ADJUSTMOD(sym,state) \
if(keySym==sym) { if(down) data->modifierState|=state; else data->modifierState&=~state; }
if (QX11Info::isPlatformX11()) {
ADJUSTMOD(XK_Shift_L, LEFTSHIFT);
ADJUSTMOD(XK_Shift_R, RIGHTSHIFT);
ADJUSTMOD(XK_Mode_switch, ALTGR);
if (keySym >= ' ' && keySym < 0x100) {
KeyCode k;
if (down) {
tweakModifiers(data->modifiers[keySym], True);
}
k = data->keycodes[keySym];
if (k != NoSymbol) {
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
}
if (down) {
tweakModifiers(data->modifiers[keySym], False);
}
} else {
KeyCode k = XKeysymToKeycode(data->dpy, keySym);
if (k != NoSymbol) {
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
}
}
}
/*
// Wayland platform and pipweire plugin in use
if (KrfbConfig::preferredFrameBufferPlugin() == QStringLiteral("pw")) {
}*/
}
void X11EventHandler::handlePointer(int buttonMask, int x, int y)
{
if (QX11Info::isPlatformX11()) {
QDesktopWidget *desktopWidget = QApplication::desktop();
int screen = desktopWidget->screenNumber();
if (screen < 0) {
screen = 0;
}
XTestFakeMotionEvent(data->dpy, screen, x, y, CurrentTime);
for (int i = 0; i < 5; i++) {
if ((data->buttonMask&(1 << i)) != (buttonMask&(1 << i))) {
XTestFakeButtonEvent(data->dpy,
i + 1,
(buttonMask&(1 << i)) ? True : False,
CurrentTime);
}
}
data->buttonMask = buttonMask;
}
}

41
events/x11/x11events.h Normal file
View File

@@ -0,0 +1,41 @@
/*
This file is part of the KDE project
Copyright (C) 2016 by Oleg Chernovskiy <kanedias@xaker.ru>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef EVENTS_X11EVENTS_H
#define EVENTS_X11EVENTS_H
#include "../../krfb/events.h"
class X11EventHandler : public EventHandler
{
Q_OBJECT
public:
explicit X11EventHandler(QObject *parent = nullptr)
: EventHandler(parent)
{
};
void handleKeyboard(bool down, rfbKeySym key) override;
void handlePointer(int buttonMask, int x, int y) override;
};
#endif

View File

@@ -0,0 +1,45 @@
/* This file is part of the KDE project
Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "x11eventsplugin.h"
#include "x11events.h"
#include <KPluginFactory>
#include <QX11Info>
K_PLUGIN_FACTORY_WITH_JSON(X11EventsPluginFactory, "krfb_events_x11.json",
registerPlugin<X11EventsPlugin>();)
X11EventsPlugin::X11EventsPlugin(QObject *parent, const QVariantList &args)
: EventsPlugin(parent, args)
{
}
EventHandler *X11EventsPlugin::eventHandler()
{
// works only under X11
if(!QX11Info::isPlatformX11())
return nullptr;
return new X11EventHandler();
}
#include "x11eventsplugin.moc"

View File

@@ -0,0 +1,43 @@
/* This file is part of the KDE project
Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KRFB_EVENTS_X11_X11EVENTSPLUGIN_H
#define KRFB_EVENTS_X11_X11EVENTSPLUGIN_H
#include "eventsplugin.h"
#include <QWidget>
class EventHandler;
class X11EventsPlugin : public EventsPlugin
{
Q_OBJECT
public:
X11EventsPlugin(QObject *parent, const QVariantList &args);
virtual ~X11EventsPlugin() = default;
EventHandler *eventHandler() override;
private:
Q_DISABLE_COPY(X11EventsPlugin)
};
#endif // Header guard

27
events/xdp/CMakeLists.txt Normal file
View File

@@ -0,0 +1,27 @@
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set (krfb_events_xdp_SRCS
xdpevents.cpp
xdpeventsplugin.cpp
)
qt5_add_dbus_interface(
krfb_events_xdp_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
xdp_dbus_remotedesktop_interface
)
add_library (krfb_events_xdp MODULE ${krfb_events_xdp_SRCS})
target_link_libraries (krfb_events_xdp
KF5::CoreAddons
KF5::I18n
Qt5::DBus
krfbprivate
)
install (TARGETS krfb_events_xdp
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/events
)

View File

@@ -0,0 +1,66 @@
{
"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"
}
}

124
events/xdp/xdpevents.cpp Normal file
View File

@@ -0,0 +1,124 @@
/*
This file is part of the KDE project
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "xdpevents.h"
#include "rfbservermanager.h"
#include "xdp_dbus_remotedesktop_interface.h"
#include <linux/input.h>
#include <QApplication>
#include <QDesktopWidget>
#include <QGlobalStatic>
class EventData
{
public:
EventData();
//mouse
int buttonMask = 0;
int x = 0;
int y = 0;
QScopedPointer<OrgFreedesktopPortalRemoteDesktopInterface> dbusXdpRemoteDesktopService;
private:
void init();
};
Q_GLOBAL_STATIC(EventData, data)
EventData::EventData()
{
init();
}
void EventData::init()
{
dbusXdpRemoteDesktopService.reset(new OrgFreedesktopPortalRemoteDesktopInterface(QStringLiteral("org.freedesktop.portal.Desktop"),
QStringLiteral("/org/freedesktop/portal/desktop"), QDBusConnection::sessionBus()));
}
void XdpEventHandler::handleKeyboard(bool down, rfbKeySym keySym)
{
// TODO: implement button handling
// both in FakeInput interface and here
Q_UNUSED(down)
Q_UNUSED(keySym)
}
void XdpEventHandler::handlePointer(int buttonMask, int x, int y)
{
const uint streamNodeId = frameBuffer()->customProperty(QStringLiteral("stream_node_id")).toUInt();
const QDBusObjectPath sessionHandle = frameBuffer()->customProperty(QStringLiteral("session_handle")).value<QDBusObjectPath>();
if (streamNodeId == 0 || sessionHandle.path().isEmpty()) {
return;
}
if (x != data->x || y != data->y) {
data->dbusXdpRemoteDesktopService->NotifyPointerMotionAbsolute(sessionHandle, QVariantMap(), streamNodeId, x, y);
data->x = x;
data->y = y;
}
if (buttonMask != data->buttonMask) {
int i = 0;
QVector<int> buttons = { BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, 0, 0, 0, 0, BTN_SIDE, BTN_EXTRA };
for (auto it = buttons.constBegin(); it != buttons.constEnd(); ++it) {
int prevButtonState = (data->buttonMask >> i) & 0x01;
int currentButtonState = (buttonMask >> i) & 0x01;
if (prevButtonState != currentButtonState) {
if (*it) {
data->dbusXdpRemoteDesktopService->NotifyPointerButton(sessionHandle, QVariantMap(), *it, buttonMask);
} else {
int axis = 0;
int steps = 0;
switch (i) {
case 3:
axis = 0; // Vertical
steps = -1;
break;
case 4:
axis = 0; // Vertical
steps = 1;
break;
case 5:
axis = 1; // Horizontal
steps = -1;
break;
case 6:
axis = 1; // Horizontal
steps = 1;
break;
}
data->dbusXdpRemoteDesktopService->NotifyPointerAxisDiscrete(sessionHandle, QVariantMap(), axis, steps);
}
}
++i;
}
data->buttonMask = buttonMask;
}
}

37
events/xdp/xdpevents.h Normal file
View File

@@ -0,0 +1,37 @@
/*
This file is part of the KDE project
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef EVENTS_XDPEVENTS_H
#define EVENTS_XDPEVENTS_H
#include "../../krfb/events.h"
class XdpEventHandler : public EventHandler
{
Q_OBJECT
public:
void handleKeyboard(bool down, rfbKeySym key) override;
void handlePointer(int buttonMask, int x, int y) override;
};
#endif

View File

@@ -0,0 +1,43 @@
/*
This file is part of the KDE project
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "xdpeventsplugin.h"
#include "xdpevents.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(XdpEventsPluginFactory, "krfb_events_xdp.json",
registerPlugin<XdpEventsPlugin>();)
XdpEventsPlugin::XdpEventsPlugin(QObject *parent, const QVariantList &args)
: EventsPlugin(parent, args)
{
}
EventHandler *XdpEventsPlugin::eventHandler()
{
// works only under Wayland
return new XdpEventHandler();
}
#include "xdpeventsplugin.moc"

View File

@@ -0,0 +1,46 @@
/*
This file is part of the KDE project
Copyright (C) 2018-2019 Jan Grulich <jgrulich@redhat.com>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KRFB_EVENTS_XDP_XDPEVENTSPLUGIN_H
#define KRFB_EVENTS_XDP_XDPEVENTSPLUGIN_H
#include "eventsplugin.h"
#include <QWidget>
class EventHandler;
class XdpEventsPlugin : public EventsPlugin
{
Q_OBJECT
public:
XdpEventsPlugin(QObject *parent, const QVariantList &args);
virtual ~XdpEventsPlugin() = default;
EventHandler *eventHandler() override;
private:
Q_DISABLE_COPY(XdpEventsPlugin)
};
#endif // Header guard

View File

@@ -1,5 +1,9 @@
add_subdirectory (qt)
if (${XCB_DAMAGE_FOUND} AND ${XCB_SHM_FOUND} AND ${XCB_IMAGE_FOUND})
add_subdirectory (xcb)
add_subdirectory (xcb)
endif()
if (${PipeWire_FOUND})
add_subdirectory(pipewire)
endif()

View File

@@ -0,0 +1,54 @@
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
set (krfb_framebuffer_pw_SRCS
pw_framebuffer.cpp
pw_framebufferplugin.cpp
)
ecm_qt_declare_logging_category(krfb_framebuffer_pw_SRCS
HEADER krfb_fb_pipewire_debug.h
IDENTIFIER KRFB_FB_PIPEWIRE
CATEGORY_NAME krfb.framebuffer.pipewire
DESCRIPTION "KRFB PipeWire framebuffer plugin"
EXPORT KRFB
)
qt5_add_dbus_interface(
krfb_framebuffer_pw_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_screencast_interface.xml
xdp_dbus_screencast_interface
)
qt5_add_dbus_interface(
krfb_framebuffer_pw_SRCS
${CMAKE_SOURCE_DIR}/dbus/xdp_dbus_remotedesktop_interface.xml
xdp_dbus_remotedesktop_interface
)
add_library(krfb_framebuffer_pw
MODULE
${krfb_framebuffer_pw_SRCS}
)
target_link_libraries(krfb_framebuffer_pw
Qt5::Core
Qt5::Gui
Qt5::DBus
KF5::CoreAddons
krfbprivate
PkgConfig::PipeWire
)
if (HAVE_DMA_BUF)
target_link_libraries(krfb_framebuffer_pw
${epoxy_LIBRARIES}
gbm::gbm
)
endif()
install (TARGETS krfb_framebuffer_pw
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)

View File

@@ -0,0 +1,70 @@
{
"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

@@ -0,0 +1,972 @@
/* This file is part of the KDE project
Copyright (C) 2018-2021 Jan Grulich <jgrulich@redhat.com>
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
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 "config-krfb.h"
// system
#include <sys/mman.h>
#include <cstring>
// Qt
#include <QCoreApplication>
#include <QGuiApplication>
#include <QScreen>
#include <QSocketNotifier>
#include <QDebug>
#include <QRandomGenerator>
// pipewire
#include <sys/ioctl.h>
#include <spa/param/format-utils.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/props.h>
#include <spa/utils/result.h>
#include <pipewire/pipewire.h>
#include <climits>
#include "pw_framebuffer.h"
#include "xdp_dbus_screencast_interface.h"
#include "xdp_dbus_remotedesktop_interface.h"
#include "krfb_fb_pipewire_debug.h"
#if HAVE_DMA_BUF
#include <fcntl.h>
#include <unistd.h>
#include <gbm.h>
#include <epoxy/egl.h>
#include <epoxy/gl.h>
#endif /* HAVE_DMA_BUF */
static const int BYTES_PER_PIXEL = 4;
static const uint MIN_SUPPORTED_XDP_KDE_SC_VERSION = 1;
Q_DECLARE_METATYPE(PWFrameBuffer::Stream);
Q_DECLARE_METATYPE(PWFrameBuffer::Streams);
const QDBusArgument &operator >> (const QDBusArgument &arg, PWFrameBuffer::Stream &stream)
{
arg.beginStructure();
arg >> stream.nodeId;
arg.beginMap();
while (!arg.atEnd()) {
QString key;
QVariant map;
arg.beginMapEntry();
arg >> key >> map;
arg.endMapEntry();
stream.map.insert(key, map);
}
arg.endMap();
arg.endStructure();
return arg;
}
#if HAVE_DMA_BUF
const char * formatGLError(GLenum err)
{
switch(err) {
case GL_NO_ERROR:
return "GL_NO_ERROR";
case GL_INVALID_ENUM:
return "GL_INVALID_ENUM";
case GL_INVALID_VALUE:
return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION:
return "GL_INVALID_OPERATION";
case GL_STACK_OVERFLOW:
return "GL_STACK_OVERFLOW";
case GL_STACK_UNDERFLOW:
return "GL_STACK_UNDERFLOW";
case GL_OUT_OF_MEMORY:
return "GL_OUT_OF_MEMORY";
default:
return (QLatin1String("0x") + QString::number(err, 16)).toLocal8Bit().constData();
}
}
#endif /* HAVE_DMA_BUF */
/**
* @brief The PWFrameBuffer::Private class - private counterpart of PWFramebuffer class. This is the entity where
* whole logic resides, for more info search for "d-pointer pattern" information.
*/
class PWFrameBuffer::Private {
public:
Private(PWFrameBuffer *q);
~Private();
private:
friend class PWFrameBuffer;
static void onCoreError(void *data, uint32_t id, int seq, int res, const char *message);
static void onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format);
static void onStreamStateChanged(void *data, pw_stream_state old, pw_stream_state state, const char *error_message);
static void onStreamProcess(void *data);
void initDbus();
void initPw();
// dbus handling
void handleSessionCreated(quint32 &code, QVariantMap &results);
void handleDevicesSelected(quint32 &code, QVariantMap &results);
void handleSourcesSelected(quint32 &code, QVariantMap &results);
void handleRemoteDesktopStarted(quint32 &code, QVariantMap &results);
// pw handling
pw_stream *createReceivingStream();
void handleFrame(pw_buffer *pwBuffer);
// link to public interface
PWFrameBuffer *q;
// pipewire stuff
struct pw_context *pwContext = nullptr;
struct pw_core *pwCore = nullptr;
struct pw_stream *pwStream = nullptr;
struct pw_thread_loop *pwMainLoop = nullptr;
// wayland-like listeners
// ...of events that happen in pipewire server
spa_hook coreListener = {};
spa_hook streamListener = {};
// event handlers
pw_core_events pwCoreEvents = {};
pw_stream_events pwStreamEvents = {};
uint pwStreamNodeId = 0;
// negotiated video format
spa_video_info_raw *videoFormat = nullptr;
// requests a session from XDG Desktop Portal
// auto-generated and compiled from xdp_dbus_interface.xml file
QScopedPointer<OrgFreedesktopPortalScreenCastInterface> dbusXdpScreenCastService;
QScopedPointer<OrgFreedesktopPortalRemoteDesktopInterface> dbusXdpRemoteDesktopService;
// XDP screencast session handle
QDBusObjectPath sessionPath;
// Pipewire file descriptor
QDBusUnixFileDescriptor pipewireFd;
// screen geometry holder
QSize streamSize;
QSize videoSize;
// Allowed devices
uint devices = 0;
// sanity indicator
bool isValid = true;
#if HAVE_DMA_BUF
struct EGLStruct {
QList<QByteArray> extensions;
EGLDisplay display = EGL_NO_DISPLAY;
EGLContext context = EGL_NO_CONTEXT;
};
bool m_eglInitialized = false;
qint32 m_drmFd = 0; // for GBM buffer mmap
gbm_device *m_gbmDevice = nullptr; // for passed GBM buffer retrieval
EGLStruct m_egl;
#endif /* HAVE_DMA_BUF */
};
PWFrameBuffer::Private::Private(PWFrameBuffer *q) : q(q)
{
pwCoreEvents.version = PW_VERSION_CORE_EVENTS;
pwCoreEvents.error = &onCoreError;
pwStreamEvents.version = PW_VERSION_STREAM_EVENTS;
pwStreamEvents.state_changed = &onStreamStateChanged;
pwStreamEvents.param_changed = &onStreamParamChanged;
pwStreamEvents.process = &onStreamProcess;
#if HAVE_DMA_BUF
m_drmFd = open("/dev/dri/renderD128", O_RDWR);
if (m_drmFd < 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to open drm render node: " << strerror(errno);
return;
}
m_gbmDevice = gbm_create_device(m_drmFd);
if (!m_gbmDevice) {
qCWarning(KRFB_FB_PIPEWIRE) << "Cannot create GBM device: " << strerror(errno);
return;
}
// Get the list of client extensions
const char* clientExtensionsCString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
const QByteArray clientExtensionsString = QByteArray::fromRawData(clientExtensionsCString, qstrlen(clientExtensionsCString));
if (clientExtensionsString.isEmpty()) {
// If eglQueryString() returned NULL, the implementation doesn't support
// EGL_EXT_client_extensions. Expect an EGL_BAD_DISPLAY error.
qCWarning(KRFB_FB_PIPEWIRE) << "No client extensions defined! " << formatGLError(eglGetError());
return;
}
m_egl.extensions = clientExtensionsString.split(' ');
// Use eglGetPlatformDisplayEXT() to get the display pointer
// if the implementation supports it.
if (!m_egl.extensions.contains(QByteArrayLiteral("EGL_EXT_platform_base")) ||
!m_egl.extensions.contains(QByteArrayLiteral("EGL_MESA_platform_gbm"))) {
qCWarning(KRFB_FB_PIPEWIRE) << "One of required EGL extensions is missing";
return;
}
m_egl.display = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, m_gbmDevice, nullptr);
if (m_egl.display == EGL_NO_DISPLAY) {
qCWarning(KRFB_FB_PIPEWIRE) << "Error during obtaining EGL display: " << formatGLError(eglGetError());
return;
}
EGLint major, minor;
if (eglInitialize(m_egl.display, &major, &minor) == EGL_FALSE) {
qCWarning(KRFB_FB_PIPEWIRE) << "Error during eglInitialize: " << formatGLError(eglGetError());
return;
}
if (eglBindAPI(EGL_OPENGL_API) == EGL_FALSE) {
qCWarning(KRFB_FB_PIPEWIRE) << "bind OpenGL API failed";
return;
}
m_egl.context = eglCreateContext(m_egl.display, nullptr, EGL_NO_CONTEXT, nullptr);
if (m_egl.context == EGL_NO_CONTEXT) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't create EGL context: " << formatGLError(eglGetError());
return;
}
qCDebug(KRFB_FB_PIPEWIRE) << "Egl initialization succeeded";
qCDebug(KRFB_FB_PIPEWIRE) << QStringLiteral("EGL version: %1.%2").arg(major).arg(minor);
m_eglInitialized = true;
#endif /* HAVE_DMA_BUF */
}
/**
* @brief PWFrameBuffer::Private::initDbus - initialize D-Bus connectivity with XDG Desktop Portal.
* Based on XDG_CURRENT_DESKTOP environment variable it will give us implementation that we need,
* in case of KDE it is xdg-desktop-portal-kde binary.
*/
void PWFrameBuffer::Private::initDbus()
{
qInfo() << "Initializing D-Bus connectivity with XDG Desktop Portal";
dbusXdpScreenCastService.reset(new OrgFreedesktopPortalScreenCastInterface(QStringLiteral("org.freedesktop.portal.Desktop"),
QStringLiteral("/org/freedesktop/portal/desktop"),
QDBusConnection::sessionBus()));
dbusXdpRemoteDesktopService.reset(new OrgFreedesktopPortalRemoteDesktopInterface(QStringLiteral("org.freedesktop.portal.Desktop"),
QStringLiteral("/org/freedesktop/portal/desktop"),
QDBusConnection::sessionBus()));
auto version = dbusXdpScreenCastService->version();
if (version < MIN_SUPPORTED_XDP_KDE_SC_VERSION) {
qCWarning(KRFB_FB_PIPEWIRE) << "Unsupported XDG Portal screencast interface version:" << version;
isValid = false;
return;
}
// create session
auto sessionParameters = QVariantMap {
{ QStringLiteral("session_handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) },
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
};
auto sessionReply = dbusXdpRemoteDesktopService->CreateSession(sessionParameters);
sessionReply.waitForFinished();
if (!sessionReply.isValid()) {
qWarning("Couldn't initialize XDP-KDE screencast session");
isValid = false;
return;
}
qInfo() << "DBus session created: " << sessionReply.value().path();
QDBusConnection::sessionBus().connect(QString(),
sessionReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpSessionCreated(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpSessionCreated(quint32 code, QVariantMap results)
{
d->handleSessionCreated(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleSessionCreated - handle creation of ScreenCast session.
* XDG Portal answers with session path if it was able to successfully create the screencast.
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleSessionCreated(quint32 &code, QVariantMap &results)
{
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to create session: " << code;
isValid = false;
return;
}
sessionPath = QDBusObjectPath(results.value(QStringLiteral("session_handle")).toString());
// select sources for the session
auto selectionOptions = QVariantMap {
// We have to specify it's an uint, otherwise xdg-desktop-portal will not forward it to backend implementation
{ QStringLiteral("types"), QVariant::fromValue<uint>(7) }, // request all (KeyBoard, Pointer, TouchScreen)
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
};
auto selectorReply = dbusXdpRemoteDesktopService->SelectDevices(sessionPath, selectionOptions);
selectorReply.waitForFinished();
if (!selectorReply.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't select devices for the remote-desktop session";
isValid = false;
return;
}
QDBusConnection::sessionBus().connect(QString(),
selectorReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpDevicesSelected(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpDevicesSelected(quint32 code, QVariantMap results)
{
d->handleDevicesSelected(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleDevicesCreated - handle selection of devices we want to use for remote desktop
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleDevicesSelected(quint32 &code, QVariantMap &results)
{
Q_UNUSED(results)
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to select devices: " << code;
isValid = false;
return;
}
// select sources for the session
auto selectionOptions = QVariantMap {
{ QStringLiteral("types"), QVariant::fromValue<uint>(1) }, // only MONITOR is supported
{ QStringLiteral("multiple"), false },
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
};
auto selectorReply = dbusXdpScreenCastService->SelectSources(sessionPath, selectionOptions);
selectorReply.waitForFinished();
if (!selectorReply.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't select sources for the screen-casting session";
isValid = false;
return;
}
QDBusConnection::sessionBus().connect(QString(),
selectorReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpSourcesSelected(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpSourcesSelected(quint32 code, QVariantMap results)
{
d->handleSourcesSelected(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleSourcesSelected - handle Screencast sources selection.
* XDG Portal shows a dialog at this point which allows you to select monitor from the list.
* This function is called after you make a selection.
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleSourcesSelected(quint32 &code, QVariantMap &)
{
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to select sources: " << code;
isValid = false;
return;
}
// start session
auto startParameters = QVariantMap {
{ QStringLiteral("handle_token"), QStringLiteral("krfb%1").arg(QRandomGenerator::global()->generate()) }
};
auto startReply = dbusXdpRemoteDesktopService->Start(sessionPath, QString(), startParameters);
startReply.waitForFinished();
QDBusConnection::sessionBus().connect(QString(),
startReply.value().path(),
QStringLiteral("org.freedesktop.portal.Request"),
QStringLiteral("Response"),
this->q,
SLOT(handleXdpRemoteDesktopStarted(uint, QVariantMap)));
}
void PWFrameBuffer::handleXdpRemoteDesktopStarted(quint32 code, QVariantMap results)
{
d->handleRemoteDesktopStarted(code, results);
}
/**
* @brief PWFrameBuffer::Private::handleScreencastStarted - handle Screencast start.
* At this point there shall be ready pipewire stream to consume.
*
* @param code return code for dbus call. Zero is success, non-zero means error
* @param results map with results of call.
*/
void PWFrameBuffer::Private::handleRemoteDesktopStarted(quint32 &code, QVariantMap &results)
{
if (code != 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to start screencast: " << code;
isValid = false;
return;
}
// there should be only one stream
Streams streams = qdbus_cast<Streams>(results.value(QStringLiteral("streams")));
if (streams.isEmpty()) {
// maybe we should check deeper with qdbus_cast but this suffices for now
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to get screencast streams";
isValid = false;
return;
}
auto streamReply = dbusXdpScreenCastService->OpenPipeWireRemote(sessionPath, QVariantMap());
streamReply.waitForFinished();
if (!streamReply.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't open pipewire remote for the screen-casting session";
isValid = false;
return;
}
pipewireFd = streamReply.value();
if (!pipewireFd.isValid()) {
qCWarning(KRFB_FB_PIPEWIRE) << "Couldn't get pipewire connection file descriptor";
isValid = false;
return;
}
devices = results.value(QStringLiteral("types")).toUInt();
pwStreamNodeId = streams.first().nodeId;
initPw();
}
/**
* @brief PWFrameBuffer::Private::initPw - initialize Pipewire socket connectivity.
* pipewireFd should be pointing to existing file descriptor that was passed by D-Bus at this point.
*/
void PWFrameBuffer::Private::initPw() {
qInfo() << "Initializing Pipewire connectivity";
// init pipewire (required)
pw_init(nullptr, nullptr); // args are not used anyways
pwMainLoop = pw_thread_loop_new("pipewire-main-loop", nullptr);
pw_thread_loop_lock(pwMainLoop);
pwContext = pw_context_new(pw_thread_loop_get_loop(pwMainLoop), nullptr, 0);
if (!pwContext) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to create PipeWire context";
return;
}
pwCore = pw_context_connect(pwContext, nullptr, 0);
if (!pwCore) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to connect PipeWire context";
return;
}
pw_core_add_listener(pwCore, &coreListener, &pwCoreEvents, this);
pwStream = createReceivingStream();
if (!pwStream) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to create PipeWire stream";
return;
}
if (pw_thread_loop_start(pwMainLoop) < 0) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to start main PipeWire loop";
isValid = false;
}
pw_thread_loop_unlock(pwMainLoop);
}
void PWFrameBuffer::Private::onCoreError(void *data, uint32_t id, int seq, int res, const char *message)
{
Q_UNUSED(data);
Q_UNUSED(id);
Q_UNUSED(seq);
Q_UNUSED(res);
qInfo() << "core error: " << message;
}
/**
* @brief PWFrameBuffer::Private::onStreamStateChanged - called whenever stream state changes on pipewire server
* @param data pointer that you have set in pw_stream_add_listener call's last argument
* @param state new state that stream has changed to
* @param error_message optional error message, is set to non-null if state is error
*/
void PWFrameBuffer::Private::onStreamStateChanged(void *data, pw_stream_state /*old*/, pw_stream_state state, const char *error_message)
{
Q_UNUSED(data);
qInfo() << "Stream state changed: " << pw_stream_state_as_string(state);
switch (state) {
case PW_STREAM_STATE_ERROR:
qCWarning(KRFB_FB_PIPEWIRE) << "pipewire stream error: " << error_message;
break;
case PW_STREAM_STATE_PAUSED:
case PW_STREAM_STATE_STREAMING:
case PW_STREAM_STATE_UNCONNECTED:
case PW_STREAM_STATE_CONNECTING:
break;
}
}
/**
* @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.
* @param data pointer that you have set in pw_stream_add_listener call's last argument
* @param format format that's being proposed
*/
void PWFrameBuffer::Private::onStreamParamChanged(void *data, uint32_t id, const struct spa_pod *format)
{
qInfo() << "Stream format changed";
auto d = static_cast<PWFrameBuffer::Private *>(data);
if (!format || id != SPA_PARAM_Format) {
return;
}
d->videoFormat = new spa_video_info_raw();
spa_format_video_raw_parse(format, d->videoFormat);
auto width = d->videoFormat->size.width;
auto height = d->videoFormat->size.height;
auto stride = SPA_ROUND_UP_N(width * BYTES_PER_PIXEL, 4);
auto size = height * stride;
d->streamSize = QSize(width, height);
uint8_t buffer[1024];
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) :
(1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr);
#else
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,
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_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_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);
}
/**
* @brief PWFrameBuffer::Private::onNewBuffer - called when new buffer is available in pipewire stream
* @param data pointer that you have set in pw_stream_add_listener call's last argument
* @param id
*/
void PWFrameBuffer::Private::onStreamProcess(void *data)
{
auto d = static_cast<PWFrameBuffer::Private *>(data);
pw_buffer* next_buffer;
pw_buffer* buffer = nullptr;
next_buffer = pw_stream_dequeue_buffer(d->pwStream);
while (next_buffer) {
buffer = next_buffer;
next_buffer = pw_stream_dequeue_buffer(d->pwStream);
if (next_buffer) {
pw_stream_queue_buffer(d->pwStream, buffer);
}
}
if (!buffer) {
return;
}
d->handleFrame(buffer);
pw_stream_queue_buffer(d->pwStream, buffer);
}
void PWFrameBuffer::Private::handleFrame(pw_buffer *pwBuffer)
{
auto spaBuffer = pwBuffer->buffer;
uint8_t *src = nullptr;
if (spaBuffer->datas[0].chunk->size == 0) {
qCDebug(KRFB_FB_PIPEWIRE) << "discarding null buffer";
return;
}
std::function<void()> cleanup;
const qint64 srcStride = spaBuffer->datas[0].chunk->stride;
if (spaBuffer->datas->type == SPA_DATA_MemFd) {
uint8_t *map = static_cast<uint8_t*>(mmap(
nullptr, spaBuffer->datas->maxsize + spaBuffer->datas->mapoffset,
PROT_READ, MAP_PRIVATE, spaBuffer->datas->fd, 0));
if (map == MAP_FAILED) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to mmap the memory: " << strerror(errno);
return;
}
src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t);
cleanup = [map, spaBuffer] {
munmap(map, spaBuffer->datas->maxsize + spaBuffer->datas->mapoffset);
};
} else if (spaBuffer->datas[0].type == SPA_DATA_MemPtr) {
src = static_cast<uint8_t*>(spaBuffer->datas[0].data);
}
#if HAVE_DMA_BUF
else if (spaBuffer->datas->type == SPA_DATA_DmaBuf) {
if (!m_eglInitialized) {
// Shouldn't reach this
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to process DMA buffer.";
return;
}
gbm_import_fd_data importInfo = {static_cast<int>(spaBuffer->datas->fd), static_cast<uint32_t>(streamSize.width()),
static_cast<uint32_t>(streamSize.height()), static_cast<uint32_t>(spaBuffer->datas[0].chunk->stride), GBM_BO_FORMAT_ARGB8888};
gbm_bo *imported = gbm_bo_import(m_gbmDevice, GBM_BO_IMPORT_FD, &importInfo, GBM_BO_USE_SCANOUT);
if (!imported) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to process buffer: Cannot import passed GBM fd - " << strerror(errno);
return;
}
// bind context to render thread
eglMakeCurrent(m_egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, m_egl.context);
// create EGL image from imported BO
EGLImageKHR image = eglCreateImageKHR(m_egl.display, nullptr, EGL_NATIVE_PIXMAP_KHR, imported, nullptr);
if (image == EGL_NO_IMAGE_KHR) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to record frame: Error creating EGLImageKHR - " << formatGLError(glGetError());
gbm_bo_destroy(imported);
return;
}
// create GL 2D texture for framebuffer
GLuint texture;
glGenTextures(1, &texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, texture);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
src = static_cast<uint8_t*>(malloc(srcStride * streamSize.height()));
GLenum glFormat = GL_BGRA;
switch (videoFormat->format) {
case SPA_VIDEO_FORMAT_RGBx:
glFormat = GL_RGBA;
break;
case SPA_VIDEO_FORMAT_RGBA:
glFormat = GL_RGBA;
break;
case SPA_VIDEO_FORMAT_BGRx:
glFormat = GL_BGRA;
break;
case SPA_VIDEO_FORMAT_RGB:
glFormat = GL_RGB;
break;
case SPA_VIDEO_FORMAT_BGR:
glFormat = GL_BGR;
break;
default:
glFormat = GL_BGRA;
break;
}
glGetTexImage(GL_TEXTURE_2D, 0, glFormat, GL_UNSIGNED_BYTE, src);
if (!src) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to get image from DMA buffer.";
gbm_bo_destroy(imported);
return;
}
cleanup = [src] {
free(src);
};
glDeleteTextures(1, &texture);
eglDestroyImageKHR(m_egl.display, image);
gbm_bo_destroy(imported);
}
#endif /* HAVE_DMA_BUF */
struct spa_meta_region* videoMetadata =
static_cast<struct spa_meta_region*>(spa_buffer_find_meta_data(
spaBuffer, SPA_META_VideoCrop, sizeof(*videoMetadata)));
if (videoMetadata && (videoMetadata->region.size.width > static_cast<uint32_t>(streamSize.width()) ||
videoMetadata->region.size.height > static_cast<uint32_t>(streamSize.height()))) {
qCWarning(KRFB_FB_PIPEWIRE) << "Stream metadata sizes are wrong!";
return;
}
// Use video metadata when video size from metadata is set and smaller than
// video stream size, so we need to adjust it.
bool videoFullWidth = true;
bool videoFullHeight = true;
if (videoMetadata && videoMetadata->region.size.width != 0 &&
videoMetadata->region.size.height != 0) {
if (videoMetadata->region.size.width < static_cast<uint32_t>(streamSize.width())) {
videoFullWidth = false;
} else if (videoMetadata->region.size.height < static_cast<uint32_t>(streamSize.height())) {
videoFullHeight = false;
}
}
QSize prevVideoSize = videoSize;
if (!videoFullHeight || !videoFullWidth) {
videoSize = QSize(videoMetadata->region.size.width, videoMetadata->region.size.height);
} else {
videoSize = streamSize;
}
if (!q->fb || videoSize != prevVideoSize) {
if (q->fb) {
free(q->fb);
}
q->fb = static_cast<char*>(malloc(videoSize.width() * videoSize.height() * BYTES_PER_PIXEL));
if (!q->fb) {
qCWarning(KRFB_FB_PIPEWIRE) << "Failed to allocate buffer";
isValid = false;
return;
}
Q_EMIT q->frameBufferChanged();
}
const qint32 dstStride = videoSize.width() * BYTES_PER_PIXEL;
Q_ASSERT(dstStride <= srcStride);
if (!videoFullHeight && (videoMetadata->region.position.y + videoSize.height() <= streamSize.height())) {
src += srcStride * videoMetadata->region.position.y;
}
const int xOffset = !videoFullWidth && (videoMetadata->region.position.x + videoSize.width() <= streamSize.width())
? videoMetadata->region.position.x * BYTES_PER_PIXEL : 0;
char *dst = q->fb;
for (int i = 0; i < videoSize.height(); ++i) {
// Adjust source content based on crop video position if needed
src += xOffset;
std::memcpy(dst, src, dstStride);
if (videoFormat->format == SPA_VIDEO_FORMAT_BGRA || videoFormat->format == SPA_VIDEO_FORMAT_BGRx) {
for (int j = 0; j < dstStride; j += 4) {
std::swap(dst[j], dst[j + 2]);
}
}
src += srcStride - xOffset;
dst += dstStride;
}
if (spaBuffer->datas->type == SPA_DATA_MemFd ||
spaBuffer->datas->type == SPA_DATA_DmaBuf) {
cleanup();
}
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);
img.convertTo(QImage::Format_RGB888);
}
q->tiles.append(QRect(0, 0, videoSize.width(), videoSize.height()));
}
/**
* @brief PWFrameBuffer::Private::createReceivingStream - create a stream that will consume Pipewire buffers
* and copy the framebuffer to the existing image that we track. The state of the stream and configuration
* are later handled by the corresponding listener.
*/
pw_stream *PWFrameBuffer::Private::createReceivingStream()
{
spa_rectangle pwMinScreenBounds = SPA_RECTANGLE(1, 1);
spa_rectangle pwMaxScreenBounds = SPA_RECTANGLE(UINT32_MAX, UINT32_MAX);
spa_fraction pwFramerateMin = SPA_FRACTION(0, 1);
spa_fraction pwFramerateMax = SPA_FRACTION(60, 1);
pw_properties* reuseProps = pw_properties_new_string("pipewire.client.reuse=1");
auto stream = pw_stream_new(pwCore, "krfb-fb-consume-stream", reuseProps);
uint8_t buffer[1024] = {};
const spa_pod *params[1];
auto builder = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
params[0] = reinterpret_cast<spa_pod *>(spa_pod_builder_add_object(&builder,
SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video),
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(6,
SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA,
SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA,
SPA_VIDEO_FORMAT_RGB, SPA_VIDEO_FORMAT_BGR),
SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMaxScreenBounds, &pwMinScreenBounds, &pwMaxScreenBounds),
SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&pwFramerateMin),
SPA_FORMAT_VIDEO_maxFramerate, SPA_POD_CHOICE_RANGE_Fraction(&pwFramerateMax, &pwFramerateMin, &pwFramerateMax)));
pw_stream_add_listener(stream, &streamListener, &pwStreamEvents, this);
if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pwStreamNodeId, PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) {
isValid = false;
}
return stream;
}
PWFrameBuffer::Private::~Private()
{
if (pwMainLoop) {
pw_thread_loop_stop(pwMainLoop);
}
if (pwStream) {
pw_stream_destroy(pwStream);
}
if (pwCore) {
pw_core_disconnect(pwCore);
}
if (pwContext) {
pw_context_destroy(pwContext);
}
if (pwMainLoop) {
pw_thread_loop_destroy(pwMainLoop);
}
}
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;
}
PWFrameBuffer::~PWFrameBuffer()
{
free(fb);
fb = nullptr;
}
int PWFrameBuffer::depth()
{
return 32;
}
int PWFrameBuffer::height()
{
return d->videoSize.height();
}
int PWFrameBuffer::width()
{
return d->videoSize.width();
}
int PWFrameBuffer::paddedWidth()
{
return width() * 4;
}
void PWFrameBuffer::getServerFormat(rfbPixelFormat &format)
{
format.bitsPerPixel = 32;
format.depth = 32;
format.trueColour = true;
format.bigEndian = false;
}
void PWFrameBuffer::startMonitor()
{
}
void PWFrameBuffer::stopMonitor()
{
}
QVariant PWFrameBuffer::customProperty(const QString &property) const
{
if (property == QLatin1String("stream_node_id")) {
return QVariant::fromValue<uint>(d->pwStreamNodeId);
} if (property == QLatin1String("session_handle")) {
return QVariant::fromValue<QDBusObjectPath>(d->sessionPath);
}
return FrameBuffer::customProperty(property);
}
bool PWFrameBuffer::isValid() const
{
return d->isValid;
}

View File

@@ -0,0 +1,59 @@
/* This file is part of the KDE project
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
Copyright (C) 2018-2020 Jan Grulich <jgrulich@redhat.com>
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.
*/
#ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
#define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
#include "framebuffer.h"
#include <QWidget>
#include <QVariantMap>
/**
* @brief The PWFrameBuffer class - framebuffer implementation based on XDG Desktop Portal ScreenCast interface.
* The design relies heavily on a presence of XDG D-Bus service and PipeWire daemon.
*
* @author Oleg Chernovskiy <kanedias@xaker.ru>
*/
class PWFrameBuffer: public FrameBuffer
{
Q_OBJECT
public:
using Stream = struct {
uint nodeId;
QVariantMap map;
};
using Streams = QList<Stream>;
PWFrameBuffer(WId winid, QObject *parent = nullptr);
virtual ~PWFrameBuffer() override;
int depth() override;
int height() override;
int width() override;
int paddedWidth() override;
void getServerFormat(rfbPixelFormat &format) override;
void startMonitor() override;
void stopMonitor() override;
QVariant customProperty(const QString &property) const override;
bool isValid() const;
private Q_SLOTS:
void handleXdpSessionCreated(quint32 code, QVariantMap results);
void handleXdpDevicesSelected(quint32 code, QVariantMap results);
void handleXdpSourcesSelected(quint32 code, QVariantMap results);
void handleXdpRemoteDesktopStarted(quint32 code, QVariantMap results);
private:
class Private;
const QScopedPointer<Private> d;
};
#endif

View File

@@ -0,0 +1,53 @@
/* This file is part of the KDE project
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "pw_framebufferplugin.h"
#include "pw_framebuffer.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(PWFrameBufferPluginFactory, "krfb_framebuffer_pw.json",
registerPlugin<PWFrameBufferPlugin>();)
PWFrameBufferPlugin::PWFrameBufferPlugin(QObject *parent, const QVariantList &args)
: FrameBufferPlugin(parent, args)
{
}
PWFrameBufferPlugin::~PWFrameBufferPlugin()
{
}
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id)
{
auto pwfb = new PWFrameBuffer(id);
// sanity check for dbus/wayland/pipewire errors
if (!pwfb->isValid()) {
delete pwfb;
return nullptr;
}
return pwfb;
}
#include "pw_framebufferplugin.moc"

View File

@@ -0,0 +1,45 @@
/* This file is part of the KDE project
Copyright (C) 2018 Oleg Chernovskiy <kanedias@xaker.ru>
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KRFB_FRAMEBUFFER_PW_PWFRAMEBUFFERPLUGIN_H
#define KRFB_FRAMEBUFFER_PW_PWFRAMEBUFFERPLUGIN_H
#include "framebufferplugin.h"
#include <QWidget>
class FrameBuffer;
class PWFrameBufferPlugin: public FrameBufferPlugin
{
Q_OBJECT
public:
PWFrameBufferPlugin(QObject *parent, const QVariantList &args);
virtual ~PWFrameBufferPlugin() override;
FrameBuffer *frameBuffer(WId id) override;
private:
Q_DISABLE_COPY(PWFrameBufferPlugin)
};
#endif // Header guard

View File

@@ -7,6 +7,14 @@ set (krfb_framebuffer_qt_SRCS
qtframebufferplugin.cpp
)
ecm_qt_declare_logging_category(krfb_framebuffer_qt_SRCS
HEADER krfb_fb_qt_debug.h
IDENTIFIER KRFB_FB_QT
CATEGORY_NAME krfb.framebuffer.qt
DESCRIPTION "KRFB Qt framebuffer plugin"
EXPORT KRFB
)
add_library(krfb_framebuffer_qt
MODULE
${krfb_framebuffer_qt_SRCS}
@@ -20,5 +28,5 @@ target_link_libraries (krfb_framebuffer_qt
)
install (TARGETS krfb_framebuffer_qt
DESTINATION ${PLUGIN_INSTALL_DIR}/krfb
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)

View File

@@ -5,12 +5,13 @@
"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[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[fi]": "QT-perustainen Kehyspuskuri KRfb:lle",
"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",
@@ -19,12 +20,12 @@
"Description[ko]": "KRfb용 Qt 기반 프레임버퍼입니다.",
"Description[nl]": "Op Qt gebaseerd framebuffer voor KRfb.",
"Description[nn]": "Qt-basert biletbuffer for KRfb.",
"Description[pl]": "Bufor ramki na podstawie Qt dla 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, ki temelji na Qt",
"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",
@@ -48,7 +49,8 @@
"Name[en_GB]": "Qt Framebuffer for KRfb",
"Name[es]": "Framebuffer de Qt para KRfb",
"Name[et]": "KRfb Qt kaadripuhver",
"Name[fi]": "QT-kehyspuskuri KRfb:lle",
"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",
@@ -62,20 +64,17 @@
"Name[pt_BR]": "Framebuffer do Qt para o KRfb",
"Name[ru]": "Буфер кадров Qt для KRfb",
"Name[sk]": "Qt Framebuffer pre KRfb",
"Name[sl]": "Slikovni medpomnilnik Qt za 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]": "X11-rambuffert för Krfb",
"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",
"ServiceTypes": [
"krfb/framebuffer"
],
"Version": "0.1",
"Website": "https://www.kde.org"
}

View File

@@ -26,7 +26,7 @@ QtFrameBuffer::QtFrameBuffer(WId id, QObject *parent)
if (screen) {
primaryScreen = screen;
fbImage = screen->grabWindow(win).toImage();
fb = new char[fbImage.byteCount()];
fb = new char[fbImage.sizeInBytes()];
} else {
fb = nullptr;
primaryScreen = nullptr;
@@ -104,7 +104,7 @@ void QtFrameBuffer::updateFrameBuffer()
tiles.append(img.rect());
#endif
memcpy(fb, (const char *)img.bits(), img.byteCount());
memcpy(fb, img.bits(), static_cast<size_t>(img.sizeInBytes()));
fbImage = img;
}

View File

@@ -7,6 +7,14 @@ set (krfb_framebuffer_xcb_SRCS
xcb_framebuffer.cpp
)
ecm_qt_declare_logging_category(krfb_framebuffer_xcb_SRCS
HEADER krfb_fb_xcb_debug.h
IDENTIFIER KRFB_FB_XCB
CATEGORY_NAME krfb.framebuffer.xcb
DESCRIPTION "KRFB XCB framebuffer plugin"
EXPORT KRFB
)
add_library(krfb_framebuffer_xcb MODULE ${krfb_framebuffer_xcb_SRCS})
target_link_libraries (krfb_framebuffer_xcb
@@ -24,5 +32,5 @@ target_link_libraries (krfb_framebuffer_xcb
)
install (TARGETS krfb_framebuffer_xcb
DESTINATION ${PLUGIN_INSTALL_DIR}/krfb
DESTINATION ${KDE_INSTALL_PLUGINDIR}/krfb/framebuffer
)

View File

@@ -1,8 +1,8 @@
{
"KPlugin": {
"Description": "X11 XDamage/XShm based Framebuffer for KRfb.",
"Description[ca@valencia]": "«Framebuffer» basat en XDamage/XShmQt del X11 per al KRfb.",
"Description[ca]": "«Framebuffer» basat en XDamage/XShmQt del X11 per al 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.",
@@ -10,7 +10,8 @@
"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[fi]": "X11 XDamage/XShm-perustainen kehyspuskui KRfb:lle.",
"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.",
@@ -24,7 +25,7 @@
"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, ki temelji na X11 XDamage/XShm",
"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.",
@@ -39,8 +40,8 @@
"Id": "xcb",
"License": "GPL",
"Name": "X11 Framebuffer for KRfb",
"Name[ca@valencia]": "«Framebuffer» del X11 per al KRfb.",
"Name[ca]": "«Framebuffer» del X11 per al KRfb.",
"Name[ca@valencia]": "«Framebuffer» de l'X11 per al KRfb.",
"Name[ca]": "«Framebuffer» de l'X11 per al KRfb.",
"Name[cs]": "X11 Framebuffer pro KRfb",
"Name[da]": "X11-framebuffer til KRfb",
"Name[de]": "X11-Framebuffer für KRfb",
@@ -48,7 +49,8 @@
"Name[en_GB]": "X11 Framebuffer for KRfb",
"Name[es]": "Framebuffer X11 para KRfb",
"Name[et]": "KRfb X11 kaadripuhver",
"Name[fi]": "X11-kehyspuskuri KRfb:lle",
"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",
@@ -62,7 +64,7 @@
"Name[pt_BR]": "Framebuffer do X11 para o KRfb",
"Name[ru]": "Буфер кадров X11 для KRfb",
"Name[sk]": "X11 Framebuffer pre KRfb",
"Name[sl]": "Slikovni medpomnilnik X11 za 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.",
@@ -73,9 +75,6 @@
"Name[x-test]": "xxX11 Framebuffer for KRfbxx",
"Name[zh_CN]": "XRfb 的 X11 帧缓冲",
"Name[zh_TW]": "KRfb 的 X11 Framebuffer",
"ServiceTypes": [
"krfb/framebuffer"
],
"Version": "0.1",
"Website": "https://www.kde.org"
}

View File

@@ -8,6 +8,7 @@
*/
#include "xcb_framebuffer.h"
#include "krfb_fb_xcb_debug.h"
#include <xcb/xcb.h>
#include <xcb/xproto.h>
@@ -23,7 +24,6 @@
#include <QGuiApplication>
#include <QScreen>
#include <QAbstractNativeEventFilter>
#include <QDebug>
class KrfbXCBEventFilter: public QAbstractNativeEventFilter
@@ -68,7 +68,7 @@ KrfbXCBEventFilter::KrfbXCBEventFilter(XCBFrameBuffer *owner):
}
#ifdef _DEBUG
qDebug() << "xcb framebuffer: XDamage extension version:" <<
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: XDamage extension version:" <<
xdamage_version->major_version << "." << xdamage_version->minor_version;
#endif
@@ -105,7 +105,7 @@ bool KrfbXCBEventFilter::nativeEventFilter(const QByteArray &eventType,
if (xdamageBaseEvent == 0) return false; // no xdamage extension
if (eventType == "xcb_generic_event_t") {
xcb_generic_event_t* ev = static_cast<xcb_generic_event_t *>(message);
auto ev = static_cast<xcb_generic_event_t *>(message);
if ((ev->response_type & 0x7F) == (xdamageBaseEvent + XCB_DAMAGE_NOTIFY)) {
// this is xdamage notification
this->fb_owner->handleXDamageNotify(ev);
@@ -163,11 +163,15 @@ XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
QScreen *primaryScreen = QGuiApplication::primaryScreen();
if (primaryScreen) {
qDebug() << "xcb framebuffer: Primary screen: " << primaryScreen->name()
qreal scaleFactor = primaryScreen->devicePixelRatio();
d->area = { primaryScreen->geometry().topLeft() * scaleFactor,
primaryScreen->geometry().bottomRight() * scaleFactor };
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: Primary screen: " << primaryScreen->name()
<< ", geometry: " << primaryScreen->geometry()
<< ", device scaling: " << scaleFactor
<< ", native size: " << d->area
<< ", depth: " << primaryScreen->depth();
//
d->area = primaryScreen->geometry();
} else {
qWarning() << "xcb framebuffer: ERROR: Failed to get application's primary screen info!";
return;
@@ -183,7 +187,7 @@ XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
XCB_IMAGE_FORMAT_Z_PIXMAP);
if (d->framebufferImage) {
#ifdef _DEBUG
qDebug() << "xcb framebuffer: Got primary screen image. bpp: " << d->framebufferImage->bpp
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: Got primary screen image. bpp: " << d->framebufferImage->bpp
<< ", size (" << d->framebufferImage->width << d->framebufferImage->height << ")"
<< ", depth: " << d->framebufferImage->depth
<< ", padded width: " << d->framebufferImage->stride;
@@ -211,15 +215,15 @@ XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
nullptr); // data = 0
if (d->updateTile) {
#ifdef _DEBUG
qDebug() << "xcb framebuffer: Successfully created new empty image in native format";
qDebug() << " size: " << d->updateTile->width << "x" << d->updateTile->height
<< "(stride: " << d->updateTile->stride << ")";
qDebug() << " bpp, depth: " << d->updateTile->bpp << d->updateTile->depth; // 32, 24
qDebug() << " addr of base, data: " << d->updateTile->base << (void *)d->updateTile->data;
qDebug() << " size: " << d->updateTile->size;
qDebug() << " image byte order = " << d->updateTile->byte_order; // == 0 .._LSB_FIRST
qDebug() << " image bit order = " << d->updateTile->bit_order; // == 1 .._MSB_FIRST
qDebug() << " image plane_mask = " << d->updateTile->plane_mask; // == 16777215 == 0x00FFFFFF
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: Successfully created new empty image in native format"
<< "\n size: " << d->updateTile->width << "x" << d->updateTile->height
<< "(stride: " << d->updateTile->stride << ")"
<< "\n bpp, depth: " << d->updateTile->bpp << d->updateTile->depth // 32, 24
<< "\n addr of base, data: " << d->updateTile->base << (void *)d->updateTile->data
<< "\n size: " << d->updateTile->size
<< "\n image byte order = " << d->updateTile->byte_order // == 0 .._LSB_FIRST
<< "\n image bit order = " << d->updateTile->bit_order // == 1 .._MSB_FIRST
<< "\n image plane_mask = " << d->updateTile->plane_mask; // == 16777215 == 0x00FFFFFF
#endif
// allocate shared memory block only once, make its size large enough
@@ -237,7 +241,7 @@ XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
xcb_shm_attach(QX11Info::connection(), d->shminfo.shmseg, d->shminfo.shmid, 0);
#ifdef _DEBUG
qDebug() << " shm id: " << d->shminfo.shmseg << ", addr: " << (void *)d->shminfo.shmaddr;
qCDebug(KRFB_FB_XCB) << " shm id: " << d->shminfo.shmseg << ", addr: " << (void *)d->shminfo.shmaddr;
#endif
// will return 1 on success (yes!)
@@ -273,7 +277,7 @@ XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
}
#ifdef _DEBUG
qDebug() << "xcb framebuffer: XCBFrameBuffer(), xshm base event = " << d->x11EvtFilter->xshmBaseEvent
qCDebug(KRFB_FB_XCB) << "xcb framebuffer: XCBFrameBuffer(), xshm base event = " << d->x11EvtFilter->xshmBaseEvent
<< ", xshm base error = " << d->x11EvtFilter->xdamageBaseError
<< ", xdamage base event = " << d->x11EvtFilter->xdamageBaseEvent
<< ", xdamage base error = " << d->x11EvtFilter->xdamageBaseError;
@@ -381,49 +385,52 @@ void XCBFrameBuffer::getServerFormat(rfbPixelFormat &format) {
// information about pixels layout
if (root_visualtype) {
uint16_t pixelmaxValue = (1 << root_visualtype->bits_per_rgb_value) - 1;
#ifdef _DEBUG
qDebug("xcb framebuffer: Got info about root visual:\n"
" bits per rgb value: %d\n"
" red mask: %08x\n"
" green mask: %08x\n"
" blue mask: %08x\n"
" pixelMaxValue = %d\n",
" blue mask: %08x\n",
(int)root_visualtype->bits_per_rgb_value,
root_visualtype->red_mask,
root_visualtype->green_mask,
root_visualtype->blue_mask,
(int)pixelmaxValue);
root_visualtype->blue_mask);
#endif
// calculate shifts
format.redShift = 0;
format.redMax = pixelmaxValue;
if (root_visualtype->red_mask) {
while (!(root_visualtype->red_mask & (1 << format.redShift))) {
format.redShift++;
}
}
format.greenShift = 0;
format.greenMax = pixelmaxValue;
if (root_visualtype->green_mask) {
while (!(root_visualtype->green_mask & (1 << format.greenShift))) {
format.greenShift++;
}
}
format.blueShift = 0;
format.blueMax = pixelmaxValue;
if (root_visualtype->blue_mask) {
while (!(root_visualtype->blue_mask & (1 << format.blueShift))) {
format.blueShift++;
}
}
// calculate pixel max value.
// NOTE: bits_per_rgb_value is unreliable, thus should be avoided.
format.redMax = root_visualtype->red_mask >> format.redShift;
format.greenMax = root_visualtype->green_mask >> format.greenShift;
format.blueMax = root_visualtype->blue_mask >> format.blueShift;
#ifdef _DEBUG
qDebug() << " Calculated redShift =" << (int)format.redShift;
qDebug() << " Calculated greenShift =" << (int)format.greenShift;
qDebug() << " Calculated blueShift =" << (int)format.blueShift;
qCDebug(KRFB_FB_XCB,
" Calculated redShift = %d\n"
" Calculated greenShift = %d\n"
" Calculated blueShift = %d\n"
" Calculated max values: R%d G%d B%d",
format.redShift, format.greenShift, format.blueShift
format.redMax, format.greenMax, format.blueMax);
#endif
} else {
// some kind of fallback (unlikely code execution will go this way)
@@ -476,10 +483,10 @@ void XCBFrameBuffer::cleanupRects() {
QRect ri = r.intersected(d->area);
if (tiles.size() > 0) {
for (int i = 0; i < tiles.size(); i++) {
// if current rect has intersection with tiles[i], unite them
if (ri.intersects(tiles[i])) {
tiles[i] |= ri;
for (auto &tile : tiles) {
// if current rect has intersection with tile, unite them
if (ri.intersects(tile)) {
tile |= ri;
inserted = true;
break;
}
@@ -497,25 +504,25 @@ void XCBFrameBuffer::cleanupRects() {
// increase all rectangles size by 30 pixels each side.
// limit coordinates to primary monitor boundaries.
for (int i = 0; i < tiles.size(); i++) {
tiles[i].adjust(-30, -30, 30, 30);
if (tiles[i].top() < d->area.top()) {
tiles[i].setTop(d->area.top());
for (auto &tile : tiles) {
tile.adjust(-30, -30, 30, 30);
if (tile.top() < d->area.top()) {
tile.setTop(d->area.top());
}
if (tiles[i].bottom() > d->area.bottom()) {
tiles[i].setBottom(d->area.bottom());
if (tile.bottom() > d->area.bottom()) {
tile.setBottom(d->area.bottom());
}
//
if (tiles[i].left() < d->area.left()) {
tiles[i].setLeft(d->area.left());
if (tile.left() < d->area.left()) {
tile.setLeft(d->area.left());
}
if (tiles[i].right() > d->area.right()) {
tiles[i].setRight(d->area.right());
if (tile.right() > d->area.right()) {
tile.setRight(d->area.right());
}
// move update rects so that they are positioned relative to
// framebuffer image, not whole screen
tiles[i].moveTo(tiles[i].left() - d->area.left(),
tiles[i].top() - d->area.top());
tile.moveTo(tile.left() - d->area.left(),
tile.top() - d->area.top());
}
}
@@ -675,7 +682,7 @@ void XCBFrameBuffer::stopMonitor() {
void XCBFrameBuffer::handleXDamageNotify(xcb_generic_event_t *xevent) {
xcb_damage_notify_event_t *xdevt = (xcb_damage_notify_event_t *)xevent;
auto xdevt = (xcb_damage_notify_event_t *)xevent;
QRect r((int)xdevt->area.x, (int)xdevt->area.y,
(int)xdevt->area.width, (int)xdevt->area.height);

View File

@@ -1,3 +0,0 @@
[Project]
Manager=KDevCMakeManager
Name=krfb

View File

@@ -11,6 +11,8 @@ include(GenerateExportHeader)
set (krfbprivate_SRCS
framebuffer.cpp
framebufferplugin.cpp
events.cpp
eventsplugin.cpp
)
add_library (krfbprivate
@@ -19,6 +21,7 @@ add_library (krfbprivate
)
generate_export_header(krfbprivate BASE_NAME krfbprivate)
target_link_libraries (krfbprivate
Qt5::Core
Qt5::Widgets
@@ -33,13 +36,14 @@ set_target_properties (krfbprivate PROPERTIES
)
install (TARGETS krfbprivate
${INSTALL_TARGETS_DEFAULT_ARGS}
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
)
install (FILES
krfb-framebuffer.desktop
DESTINATION ${SERVICETYPES_INSTALL_DIR}
krfb-events.desktop
DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}
)
#####################################
@@ -48,8 +52,9 @@ install (FILES
set (krfb_SRCS
connectiondialog.cpp
events.cpp
framebuffermanager.cpp
events.cpp
eventsmanager.cpp
main.cpp
mainwindow.cpp
sockethelpers.cpp
@@ -61,6 +66,14 @@ set (krfb_SRCS
invitationsrfbclient.cpp
)
ecm_qt_declare_logging_category(krfb_SRCS
HEADER krfbdebug.h
IDENTIFIER KRFB
CATEGORY_NAME krfb.krfb
DESCRIPTION "KRFB Application"
EXPORT KRFB
)
kconfig_add_kcfg_files (krfb_SRCS
krfbconfig.kcfgc
)
@@ -88,7 +101,6 @@ target_link_libraries (krfb
${X11_X11_LIB}
${X11_Xdamage_LIB}
Qt5::Network
KF5::Completion
KF5::CoreAddons
KF5::DBusAddons
KF5::DNSSD
@@ -96,6 +108,7 @@ target_link_libraries (krfb
KF5::Notifications
KF5::Wallet
KF5::WidgetsAddons
KF5::WindowSystem
KF5::XmlGui
${LIBVNCSERVER_LIBRARIES}
)
@@ -107,13 +120,13 @@ if (X11_XTest_FOUND)
endif (X11_XTest_FOUND)
install (TARGETS krfb
${INSTALL_TARGETS_DEFAULT_ARGS}
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
)
########### install files ###############
install (PROGRAMS org.kde.krfb.desktop
DESTINATION ${XDG_APPS_INSTALL_DIR}
DESTINATION ${KDE_INSTALL_APPDIR}
)
install(FILES org.kde.krfb.appdata.xml
@@ -121,6 +134,6 @@ install(FILES org.kde.krfb.appdata.xml
)
install (FILES krfb.notifyrc
DESTINATION ${DATA_INSTALL_DIR}/krfb
DESTINATION ${KDE_INSTALL_DATADIR}/krfb
)

View File

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

View File

@@ -37,9 +37,9 @@ ConnectionDialog<UI>::ConnectionDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("New Connection"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
auto mainWidget = new QWidget(this);
auto mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);

View File

@@ -24,177 +24,17 @@
#include "events.h"
#include <QApplication>
#include <QX11Info>
#include <QDesktopWidget>
#include <QGlobalStatic>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
enum {
LEFTSHIFT = 1,
RIGHTSHIFT = 2,
ALTGR = 4
};
class EventData
EventHandler::EventHandler(QObject *parent)
: QObject(parent)
{
public:
EventData();
//keyboard
Display *dpy;
signed char modifiers[0x100];
KeyCode keycodes[0x100];
KeyCode leftShiftCode;
KeyCode rightShiftCode;
KeyCode altGrCode;
char modifierState;
//mouse
int buttonMask;
private:
void init();
};
Q_GLOBAL_STATIC(EventData, data)
EventData::EventData()
{
init();
}
void EventData::init()
void EventHandler::setFrameBufferPlugin(const QSharedPointer<FrameBuffer> &frameBuffer)
{
dpy = QX11Info::display();
buttonMask = 0;
//initialize keycodes
KeySym key, *keymap;
int i, j, minkey, maxkey, syms_per_keycode;
memset(modifiers, -1, sizeof(modifiers));
XDisplayKeycodes(dpy, &minkey, &maxkey);
Q_ASSERT(minkey >= 8);
Q_ASSERT(maxkey < 256);
keymap = (KeySym *) XGetKeyboardMapping(dpy, minkey,
(maxkey - minkey + 1),
&syms_per_keycode);
Q_ASSERT(keymap);
for (i = minkey; i <= maxkey; i++) {
for (j = 0; j < syms_per_keycode; j++) {
key = keymap[(i-minkey)*syms_per_keycode+j];
if (key >= ' ' && key < 0x100 && i == XKeysymToKeycode(dpy, key)) {
keycodes[key] = i;
modifiers[key] = j;
}
}
}
leftShiftCode = XKeysymToKeycode(dpy, XK_Shift_L);
rightShiftCode = XKeysymToKeycode(dpy, XK_Shift_R);
altGrCode = XKeysymToKeycode(dpy, XK_Mode_switch);
XFree((char *)keymap);
fb = frameBuffer;
}
/* this function adjusts the modifiers according to mod (as from modifiers) and data->modifierState */
static void tweakModifiers(signed char mod, bool down)
QSharedPointer<FrameBuffer> EventHandler::frameBuffer()
{
bool isShift = data->modifierState & (LEFTSHIFT | RIGHTSHIFT);
if (mod < 0) {
return;
}
if (isShift && mod != 1) {
if (data->modifierState & LEFTSHIFT) {
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
down, CurrentTime);
}
if (data->modifierState & RIGHTSHIFT) {
XTestFakeKeyEvent(data->dpy, data->rightShiftCode,
down, CurrentTime);
}
}
if (!isShift && mod == 1) {
XTestFakeKeyEvent(data->dpy, data->leftShiftCode,
down, CurrentTime);
}
if ((data->modifierState & ALTGR) && mod != 2) {
XTestFakeKeyEvent(data->dpy, data->altGrCode,
!down, CurrentTime);
}
if (!(data->modifierState & ALTGR) && mod == 2) {
XTestFakeKeyEvent(data->dpy, data->altGrCode,
down, CurrentTime);
}
}
void EventHandler::handleKeyboard(bool down, rfbKeySym keySym)
{
#define ADJUSTMOD(sym,state) \
if(keySym==sym) { if(down) data->modifierState|=state; else data->modifierState&=~state; }
ADJUSTMOD(XK_Shift_L, LEFTSHIFT);
ADJUSTMOD(XK_Shift_R, RIGHTSHIFT);
ADJUSTMOD(XK_Mode_switch, ALTGR);
if (keySym >= ' ' && keySym < 0x100) {
KeyCode k;
if (down) {
tweakModifiers(data->modifiers[keySym], True);
}
k = data->keycodes[keySym];
if (k != NoSymbol) {
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
}
if (down) {
tweakModifiers(data->modifiers[keySym], False);
}
} else {
KeyCode k = XKeysymToKeycode(data->dpy, keySym);
if (k != NoSymbol) {
XTestFakeKeyEvent(data->dpy, k, down, CurrentTime);
}
}
}
void EventHandler::handlePointer(int buttonMask, int x, int y)
{
QDesktopWidget *desktopWidget = QApplication::desktop();
int screen = desktopWidget->screenNumber();
if (screen < 0) {
screen = 0;
}
XTestFakeMotionEvent(data->dpy, screen, x, y, CurrentTime);
for (int i = 0; i < 5; i++) {
if ((data->buttonMask&(1 << i)) != (buttonMask&(1 << i))) {
XTestFakeButtonEvent(data->dpy,
i + 1,
(buttonMask&(1 << i)) ? True : False,
CurrentTime);
}
}
data->buttonMask = buttonMask;
return fb;
}

View File

@@ -25,13 +25,26 @@
#ifndef EVENTS_H
#define EVENTS_H
#include "framebuffer.h"
#include "rfb.h"
#include "krfbprivate_export.h"
class EventHandler
#include <QObject>
class KRFBPRIVATE_EXPORT EventHandler : public QObject
{
Q_OBJECT
public:
static void handleKeyboard(bool down, rfbKeySym key);
static void handlePointer(int buttonMask, int x, int y);
explicit EventHandler(QObject *parent = nullptr);
virtual ~EventHandler() = default;
virtual void handleKeyboard(bool down, rfbKeySym key) = 0;
virtual void handlePointer(int buttonMask, int x, int y) = 0;
void setFrameBufferPlugin(const QSharedPointer<FrameBuffer> &frameBuffer);
QSharedPointer<FrameBuffer> frameBuffer();
private:
// Used to track framebuffer plugin which we need for xdp event plugin
QSharedPointer<FrameBuffer> fb;
};
#endif

116
krfb/eventsmanager.cpp Normal file
View File

@@ -0,0 +1,116 @@
/* This file is part of the KDE project
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
@author George Goldberg <george.goldberg@collabora.co.uk>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "eventsmanager.h"
#include "eventsplugin.h"
#include "krfbconfig.h"
#include "rfbservermanager.h"
#include "krfbdebug.h"
#include <QGlobalStatic>
#include <KPluginFactory>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <QtCore/QSharedPointer>
class EventsManagerStatic
{
public:
EventsManager instance;
};
Q_GLOBAL_STATIC(EventsManagerStatic, eventsManagerStatic)
EventsManager::EventsManager()
{
//qDebug();
loadPlugins();
}
EventsManager::~EventsManager()
{
//qDebug();
}
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());
if (eventHandler) {
eventHandler->setFrameBufferPlugin(RfbServerManager::instance()->framebuffer());
return eventHandler;
}
++iter;
}
// No valid events plugin found.
qCDebug(KRFB) << "No valid event handlers found. returning null.";
return QSharedPointer<EventHandler>();
}

62
krfb/eventsmanager.h Normal file
View File

@@ -0,0 +1,62 @@
/* This file is part of the KDE project
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
@author George Goldberg <george.goldberg@collabora.co.uk>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KRFB_EVENTSMANAGER_H
#define KRFB_EVENTSMANAGER_H
#include "events.h"
#include "krfbprivate_export.h"
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include <QtCore/QWeakPointer>
#include <QWidget>
class EventsPlugin;
class KPluginFactory;
class KRFBPRIVATE_EXPORT EventsManager : public QObject
{
Q_OBJECT
friend class EventsManagerStatic;
public:
static EventsManager *instance();
virtual ~EventsManager();
QSharedPointer<EventHandler> eventHandler();
private:
Q_DISABLE_COPY(EventsManager)
EventsManager();
void loadPlugins();
QMap<QString, EventsPlugin *> m_plugins;
QList<QWeakPointer<EventHandler> > m_eventHandlers;
};
#endif // Header guard

32
krfb/eventsplugin.cpp Normal file
View File

@@ -0,0 +1,32 @@
/* This file is part of the KDE project
Copyright (C) 2016 Oleg Chernovskiy <kanedias@xaker.ru>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "eventsplugin.h"
#include "events.h"
EventsPlugin::EventsPlugin(QObject *parent, const QVariantList &)
: QObject(parent)
{
}
EventsPlugin::~EventsPlugin()
{
}

42
krfb/eventsplugin.h Normal file
View File

@@ -0,0 +1,42 @@
/* This file is part of the KDE project
Copyright (C) 2009 Collabora Ltd <info@collabora.co.uk>
@author George Goldberg <george.goldberg@collabora.co.uk>
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 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef LIB_KRFB_EVENTSPLUGIN_H
#define LIB_KRFB_EVENTSPLUGIN_H
#include "krfbprivate_export.h"
#include <QtCore/QVariantList>
#include <QWidget>
class EventHandler;
class KRFBPRIVATE_EXPORT EventsPlugin : public QObject
{
Q_OBJECT
public:
EventsPlugin(QObject *parent, const QVariantList &args);
virtual ~EventsPlugin();
virtual EventHandler *eventHandler() = 0;
};
#endif // Header guard

View File

@@ -50,6 +50,12 @@ void FrameBuffer::getServerFormat(rfbPixelFormat &)
{
}
QVariant FrameBuffer::customProperty(const QString &property) const
{
Q_UNUSED(property)
return QVariant();
}
int FrameBuffer::depth()
{
return 32;

View File

@@ -17,6 +17,7 @@
#include <QObject>
#include <QRect>
#include <QList>
#include <QVariant>
#include <QWidget>
@@ -44,9 +45,13 @@ public:
virtual void getServerFormat(rfbPixelFormat &format);
virtual QVariant customProperty(const QString &property) const;
Q_SIGNALS:
void frameBufferChanged();
protected:
WId win;
char *fb;
char *fb = nullptr;
QList<QRect> tiles;
private:

View File

@@ -22,8 +22,8 @@
#include "framebufferplugin.h"
#include "krfbconfig.h"
#include "krfbdebug.h"
#include <QDebug>
#include <QGlobalStatic>
#include <KPluginFactory>
@@ -63,9 +63,7 @@ void FrameBufferManager::loadPlugins()
{
//qDebug();
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb"), [](const KPluginMetaData & md) {
return md.serviceTypes().contains(QStringLiteral("krfb/framebuffer"));
});
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
@@ -78,17 +76,18 @@ void FrameBufferManager::loadPlugins()
KPluginFactory *factory = KPluginLoader(data.fileName()).factory();
if (!factory) {
qDebug() << "KPluginFactory could not load the plugin:" << data.fileName();
qCDebug(KRFB) << "KPluginFactory could not load the plugin:" << data.fileName();
continue;
} else {
qDebug() << "found plugin at " << data.fileName();
qCDebug(KRFB) << "found plugin at " << data.fileName();
}
FrameBufferPlugin *plugin = factory->create<FrameBufferPlugin>(this);
auto plugin = factory->create<FrameBufferPlugin>(this);
if (plugin) {
m_plugins.insert(data.pluginId(), plugin);
qDebug() << "Loaded plugin with name " << data.pluginId();
qCDebug(KRFB) << "Loaded plugin with name " << data.pluginId();
} else {
qDebug() << "unable to load pluign for " << data.fileName();
qCDebug(KRFB) << "unable to load plugin for " << data.fileName();
}
unique.insert (data.name());
}
@@ -117,7 +116,7 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
while (iter != m_plugins.constEnd()) {
if (iter.key() == KrfbConfig::preferredFrameBufferPlugin()) {
qDebug() << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
QSharedPointer<FrameBuffer> frameBuffer(iter.value()->frameBuffer(id));
@@ -132,6 +131,6 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id)
}
// No valid framebuffer plugin found.
qDebug() << "No valid framebuffer found. returning null.";
qCDebug(KRFB) << "No valid framebuffer found. returning null.";
return QSharedPointer<FrameBuffer>();
}

View File

@@ -34,7 +34,7 @@ class KRFBPRIVATE_EXPORT FrameBufferPlugin : public QObject
Q_OBJECT
public:
FrameBufferPlugin(QObject *parent, const QVariantList &args);
explicit FrameBufferPlugin(QObject *parent, const QVariantList &args);
~FrameBufferPlugin() override;
virtual FrameBuffer *frameBuffer(WId id) = 0;

View File

@@ -24,11 +24,11 @@
#include "krfbconfig.h"
#include "sockethelpers.h"
#include "connectiondialog.h"
#include "krfbdebug.h"
#include <KNotification>
#include <KLocalizedString>
#include <QDebug>
#include <QSocketNotifier>
#include <poll.h>
#include <KConfigGroup>
@@ -41,7 +41,7 @@ struct PendingInvitationsRfbClient::Private
{}
rfbClientPtr client;
QSocketNotifier *notifier;
QSocketNotifier *notifier = nullptr;
bool askOnConnect;
};
@@ -79,7 +79,7 @@ void PendingInvitationsRfbClient::processNewClient()
i18n("Received connection from %1, on hold (waiting for confirmation)",
host));
InvitationsConnectionDialog *dialog = new InvitationsConnectionDialog(nullptr);
auto dialog = new InvitationsConnectionDialog(nullptr);
dialog->setRemoteHost(host);
dialog->setAllowRemoteControl(KrfbConfig::allowDesktopControl());
@@ -115,7 +115,7 @@ void PendingInvitationsRfbClient::onSocketActivated()
//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) {
qDebug() << "disconnected from socket signal";
qCDebug(KRFB) << "disconnected from socket signal";
d->notifier->setEnabled(false);
rfbClientConnectionGone(d->client);
break;
@@ -125,8 +125,7 @@ void PendingInvitationsRfbClient::onSocketActivated()
bool PendingInvitationsRfbClient::checkPassword(const QByteArray & encryptedPassword)
{
QByteArray password ;
qDebug() << "about to start authentication";
qCDebug(KRFB) << "about to start authentication";
if(InvitationsRfbServer::instance->allowUnattendedAccess() && vncAuthCheckPassword(
InvitationsRfbServer::instance->unattendedPassword().toLocal8Bit(),
@@ -142,10 +141,10 @@ bool PendingInvitationsRfbClient::checkPassword(const QByteArray & encryptedPass
void PendingInvitationsRfbClient::dialogAccepted()
{
InvitationsConnectionDialog *dialog = qobject_cast<InvitationsConnectionDialog *>(sender());
auto dialog = qobject_cast<InvitationsConnectionDialog *>(sender());
Q_ASSERT(dialog);
InvitationsRfbClient *client = new InvitationsRfbClient(m_rfbClient, parent());
auto client = new InvitationsRfbClient(m_rfbClient, parent());
client->setControlEnabled(dialog->allowRemoteControl());
accept(client);
}

View File

@@ -22,20 +22,29 @@
#include "invitationsrfbclient.h"
#include "krfbconfig.h"
#include "rfbservermanager.h"
#include "krfbdebug.h"
#include <QTimer>
#include <QApplication>
#include <QHostInfo>
#include <QDebug>
#include <QRandomGenerator>
#include <KLocalizedString>
#include <KUser>
#include <KRandom>
#include <KStringHandler>
#include <KWallet/KWallet>
#include <dnssd/publicservice.h>
#include <kdnssd_version.h>
#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
#include <KDNSSD/PublicService>
#else
#include <DNSSD/PublicService>
#endif
using KWallet::Wallet;
// used for KWallet folder name
static const QString s_krfbFolderName(QStringLiteral("krfb"));
//static
InvitationsRfbServer *InvitationsRfbServer::instance;
@@ -69,6 +78,9 @@ const QString& InvitationsRfbServer::desktopPassword() const
void InvitationsRfbServer::setDesktopPassword(const QString& password)
{
m_desktopPassword = password;
// this is called from GUI every time desktop password is edited.
// make sure we save settings immediately each time
saveSecuritySettings();
}
const QString& InvitationsRfbServer::unattendedPassword() const
@@ -79,6 +91,9 @@ const QString& InvitationsRfbServer::unattendedPassword() const
void InvitationsRfbServer::setUnattendedPassword(const QString& password)
{
m_unattendedPassword = password;
// this is called from GUI every time unattended password is edited.
// make sure we save settings immediately each time
saveSecuritySettings();
}
bool InvitationsRfbServer::allowUnattendedAccess() const
@@ -106,6 +121,9 @@ void InvitationsRfbServer::stop()
void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
{
m_allowUnattendedAccess = allow;
// this is called from GUI every time unattended access is toggled.
// make sure we save settings immediately each time
saveSecuritySettings();
}
InvitationsRfbServer::InvitationsRfbServer()
@@ -119,20 +137,12 @@ InvitationsRfbServer::InvitationsRfbServer()
InvitationsRfbServer::~InvitationsRfbServer()
{
stop();
KConfigGroup krfbConfig(KSharedConfig::openConfig(), "Security");
krfbConfig.writeEntry("allowUnattendedAccess", m_allowUnattendedAccess);
InvitationsRfbServer::stop(); // calling virtual funcs in destructor is bad
saveSecuritySettings();
// ^^ also saves passwords in kwallet,
// do it before closing kwallet
if (!KrfbConfig::noWallet() && m_wallet) {
closeKWallet();
} else {
krfbConfig.writeEntry("desktopPassword",
KStringHandler::obscure(m_desktopPassword));
krfbConfig.writeEntry("unattendedPassword",
KStringHandler::obscure(m_unattendedPassword));
krfbConfig.writeEntry("allowUnattendedAccess",
m_allowUnattendedAccess);
}
}
@@ -153,13 +163,6 @@ void InvitationsRfbServer::openKWallet()
void InvitationsRfbServer::closeKWallet()
{
if (m_wallet && m_wallet->isOpen()) {
const QString krfbFolderName = QStringLiteral("krfb");
if ((m_wallet->currentFolder() == krfbFolderName) ||
((m_wallet->hasFolder(krfbFolderName) || m_wallet->createFolder(krfbFolderName)) &&
m_wallet->setFolder(krfbFolderName)) ) {
m_wallet->writePassword(QStringLiteral("desktopSharingPassword"), m_desktopPassword);
m_wallet->writePassword(QStringLiteral("unattendedAccessPassword"), m_unattendedPassword);
}
delete m_wallet; // closes the wallet
m_wallet = nullptr;
}
@@ -170,25 +173,22 @@ void InvitationsRfbServer::walletOpened(bool opened)
QString desktopPassword;
QString unattendedPassword;
Q_ASSERT(m_wallet);
const QString krfbFolderName = QStringLiteral("krfb");
if( opened &&
( m_wallet->hasFolder(krfbFolderName) || m_wallet->createFolder(krfbFolderName) ) &&
m_wallet->setFolder(krfbFolderName) ) {
if(m_wallet->readPassword(QStringLiteral("desktopSharingPassword"), desktopPassword)==0 &&
if (opened && m_wallet->hasFolder(s_krfbFolderName) && m_wallet->setFolder(s_krfbFolderName) ) {
if (m_wallet->readPassword(QStringLiteral("desktopSharingPassword"), desktopPassword) == 0 &&
!desktopPassword.isEmpty()) {
m_desktopPassword = desktopPassword;
emit passwordChanged(m_desktopPassword);
}
if(m_wallet->readPassword(QStringLiteral("unattendedAccessPassword"), unattendedPassword)==0 &&
if(m_wallet->readPassword(QStringLiteral("unattendedAccessPassword"), unattendedPassword) == 0 &&
!unattendedPassword.isEmpty()) {
m_unattendedPassword = unattendedPassword;
}
} else {
qDebug() << "Could not open KWallet, Falling back to config file";
qCDebug(KRFB) << "Could not open KWallet, Falling back to config file";
KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
desktopPassword = KStringHandler::obscure(krfbConfig.readEntry(
@@ -213,7 +213,7 @@ QString InvitationsRfbServer::readableRandomString(int length)
{
QString str;
while (length) {
int r = KRandom::random() % 62;
int r = QRandomGenerator::global()->bounded(62);
r += 48;
if (r > 57) {
r += 7;
@@ -236,3 +236,31 @@ QString InvitationsRfbServer::readableRandomString(int length)
}
return str;
}
// one place to deal with all security configuration
void InvitationsRfbServer::saveSecuritySettings()
{
KConfigGroup secConfigGroup(KSharedConfig::openConfig(), "Security");
secConfigGroup.writeEntry("allowUnattendedAccess", m_allowUnattendedAccess);
if (KrfbConfig::noWallet()) {
// save passwords in config file only if not using kwallet integration
secConfigGroup.writeEntry("desktopPassword", KStringHandler::obscure(m_desktopPassword));
secConfigGroup.writeEntry("unattendedPassword", KStringHandler::obscure(m_unattendedPassword));
} else {
// using KWallet, erase possibly stored passwords from krfbrc file
secConfigGroup.deleteEntry("desktopPassword");
secConfigGroup.deleteEntry("unattendedPassword");
// update passwords in kwallet
if (m_wallet && m_wallet->isOpen()) {
if (!m_wallet->hasFolder(s_krfbFolderName)) {
m_wallet->createFolder(s_krfbFolderName);
}
if (m_wallet->currentFolder() != s_krfbFolderName) {
m_wallet->setFolder(s_krfbFolderName);
}
m_wallet->writePassword(QStringLiteral("desktopSharingPassword"), m_desktopPassword);
m_wallet->writePassword(QStringLiteral("unattendedAccessPassword"), m_unattendedPassword);
}
}
KrfbConfig::self()->save();
}

View File

@@ -52,6 +52,7 @@ public Q_SLOTS:
void toggleUnattendedAccess(bool allow);
void openKWallet();
void closeKWallet();
void saveSecuritySettings();
protected:
InvitationsRfbServer();
@@ -62,11 +63,11 @@ private Q_SLOTS:
void walletOpened(bool);
private:
KDNSSD::PublicService *m_publicService;
KDNSSD::PublicService *m_publicService = nullptr;
bool m_allowUnattendedAccess;
QString m_desktopPassword;
QString m_unattendedPassword;
KWallet::Wallet *m_wallet;
KWallet::Wallet *m_wallet = nullptr;
QString readableRandomString(int);
Q_DISABLE_COPY(InvitationsRfbServer)

34
krfb/krfb-events.desktop Normal file
View File

@@ -0,0 +1,34 @@
[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 的事件外掛程式

34
krfb/krfb-events.json Normal file
View File

@@ -0,0 +1,34 @@
{
"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

@@ -36,7 +36,7 @@ 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' de 'framebuffers' para o KRfb
Comment[pt]='Plugins' do 'Framebuffer' para o KRfb
Comment[pt_BR]=Plugins de framebuffers para o KRfb
Comment[ru]=Модуль буфера кадров для KRfb
Comment[si]=KRfb සඳහා රාමු බෆර ප්ලගින

View File

@@ -1,8 +1,8 @@
{
"KPlugin": {
"Description": "Frame Buffer plugins for KRfb",
"Description[ca@valencia]": "Connectors de «framebuffer» per al KRfb.",
"Description[ca]": "Connectors de «framebuffer» per al KRfb.",
"Description[ca@valencia]": "Connectors de «Frame Buffer» per al KRfb.",
"Description[ca]": "Connectors de «Frame Buffer» per al KRfb.",
"Description[cs]": "Moduly Frame bufferu pro KRfb",
"Description[da]": "Framebuffer-plugins til KRfb",
"Description[de]": "Framebuffer-Module für KRfb",
@@ -10,7 +10,8 @@
"Description[en_GB]": "Frame Buffer plugins for KRfb",
"Description[es]": "Complementos de framebuffer para KRfb",
"Description[et]": "KRfb kaadripuhvri pluginad",
"Description[fi]": "Kehyspuskuriliitännäinen kohteelle KRfb",
"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",
@@ -24,7 +25,7 @@
"Description[pt_BR]": "Plugins de framebuffers para o KRfb",
"Description[ru]": "Модули буфера кадров для KRfb",
"Description[sk]": "Frame Buffer modul pre KRfb",
"Description[sl]": "Vstavki slikovnih medpomnilnikov za 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",

View File

@@ -624,8 +624,8 @@ Name=Invalid Password Invitations
Name[ar]=كلمة المرور الدعوات غير صحيحة
Name[bg]=Неправилна парола за покана
Name[bs]=Neispravna šifra pozivnice
Name[ca]=Contrasenya de les invitacions no vàlides
Name[ca@valencia]=Contrasenya de les invitacions no vàlides
Name[ca]=Contrasenya no vàlida de les invitacions
Name[ca@valencia]=Contrasenya no vàlida de les invitacions
Name[cs]=Neplatné hesla výzev
Name[da]=Ugyldige adgangskodeinvitationer
Name[de]=Ungültiges Einladungs-Passwort
@@ -1213,8 +1213,8 @@ Comment[ar]=استقبال اتصال غير متوقع، إنهاء
Comment[bg]=Получена е неочаквана връзка. Прекъсване.
Comment[bn]=অপ্রত্যাশিত সংযোগ গ্রহণ করল, বাতিল করুন
Comment[bs]=Primljena je neočekivana veza, prekini
Comment[ca]=S'ha rebut una connexió inesperada, avortant
Comment[ca@valencia]=S'ha rebut una connexió inesperada, avortant
Comment[ca]=S'ha rebut una connexió inesperada, s'està interrompent
Comment[ca@valencia]=S'ha rebut una connexió inesperada, s'està interrompent
Comment[cs]=Obdrženo neočekávané spojení, přerušeno
Comment[cy]=Derbynwyd cysylltiad annisgwyl,terfynu
Comment[da]=Modtog uventet forbindelse, afbrød
@@ -1253,7 +1253,7 @@ Comment[nl]=Ontving een onverwachte verbinding, afgebroken
Comment[nn]=Fekk ei uventa tilkopling, så avbryt no
Comment[pl]=Otrzymano niespodziewane połączenie. Przerwane.
Comment[pt]=Foi recebida uma ligação inesperada, pelo que foi interrompida
Comment[pt_BR]=Conexão recebida inesperadamente; abortar
Comment[pt_BR]=Conexão recebida inesperadamente; cancelar
Comment[ro]=Conexiune neașteptată recepționată, abandonare
Comment[ru]=Получено неожиданное соединение. Отключение
Comment[si]=බලාපොරොත්තු රහිත සබඳතාවක් ලැබිනි, පිටවෙමින්

View File

@@ -1,7 +0,0 @@
[org.freedesktop.Telepathy.Client]
Interfaces=org.freedesktop.Telepathy.Client.Handler;
[org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube
org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=rfb
org.freedesktop.Telepathy.Channel.Requested b=true

View File

@@ -20,18 +20,19 @@
#include "invitationsrfbserver.h"
#include "krfbconfig.h"
#include "krfb_version.h"
#include "krfbdebug.h"
#include <KAboutData>
#include <KDBusService>
#include <KLocalizedString>
#include <KMessageBox>
#include <KWindowSystem>
#include <QDebug>
#include <QPixmap>
#include <qwindowdefs.h>
#include <QX11Info>
#include <signal.h>
#include <csignal>
#include <X11/extensions/XTest.h>
#include <QCommandLineParser>
#include <QCommandLineOption>
@@ -39,7 +40,6 @@
static const char description[] = I18N_NOOP("VNC-compatible server to share "
"desktops");
static bool checkX11Capabilities()
{
int bp1, bp2, majorv, minorv;
@@ -57,20 +57,34 @@ static bool checkX11Capabilities()
return true;
}
static void checkOldX11PluginConfig() {
if (KrfbConfig::preferredFrameBufferPlugin() == QStringLiteral("x11")) {
qDebug() << "Detected deprecated configuration: preferredFrameBufferPlugin = x11";
qCDebug(KRFB) << "Detected deprecated configuration: preferredFrameBufferPlugin = x11";
KConfigSkeletonItem *config_item = KrfbConfig::self()->findItem(
QStringLiteral("preferredFrameBufferPlugin"));
if (config_item) {
config_item->setProperty(QStringLiteral("xcb"));
KrfbConfig::self()->save();
qDebug() << " Fixed preferredFrameBufferPlugin from x11 to xcb.";
qCDebug(KRFB) << " Fixed preferredFrameBufferPlugin from x11 to xcb.";
}
}
}
static void checkWaylandPluginConfig()
{
if (KrfbConfig::preferredFrameBufferPlugin() != QStringLiteral("pw")) {
qWarning() << "Wayland: Detected invalid configuration: "
"preferredFrameBufferPlugin is not pipewire: "
<< KrfbConfig::preferredFrameBufferPlugin();
KConfigSkeletonItem *config_item = KrfbConfig::self()->findItem(
QStringLiteral("preferredFrameBufferPlugin"));
if (config_item) {
config_item->setProperty(QStringLiteral("pw"));
KrfbConfig::self()->save();
qCDebug(KRFB) << "Wayland: Fixed preferredFrameBufferPlugin to \"pw\".";
}
}
}
int main(int argc, char *argv[])
{
@@ -121,13 +135,24 @@ int main(int argc, char *argv[])
app.setQuitOnLastWindowClosed(false);
if (!checkX11Capabilities()) {
if (KWindowSystem::isPlatformX11()) {
if (!checkX11Capabilities()) {
return 1;
}
// upgrade the configuration
checkOldX11PluginConfig();
} else if (KWindowSystem::isPlatformWayland()) {
// check that default plugin in Wayland is PipeWire
checkWaylandPluginConfig();
} else {
KMessageBox::error(nullptr,
i18n("Desktop Sharing is not running under an X11 Server or Wayland.\n"
"Other display servers are currently not supported."),
i18n("Desktop Sharing Error"));
return 1;
}
// upgrade the configuration
checkOldX11PluginConfig();
//init the core
InvitationsRfbServer::init();

View File

@@ -21,7 +21,6 @@
#include <KMessageWidget>
#include <KStandardAction>
#include <KActionCollection>
#include <KLineEdit>
#include <KNewPasswordDialog>
#include <KPluginLoader>
#include <KPluginMetaData>
@@ -34,6 +33,7 @@
#include <QVector>
#include <QSet>
#include <QNetworkInterface>
#include <QHostInfo>
class TCP: public QWidget, public Ui::TCP
@@ -47,7 +47,7 @@ public:
class Security: public QWidget, public Ui::Security
{
public:
Security(QWidget *parent = nullptr) : QWidget(parent) {
explicit Security(QWidget *parent = nullptr) : QWidget(parent) {
setupUi(this);
walletWarning = new KMessageWidget(this);
walletWarning->setText(i18n("Storing passwords in config file is insecure!"));
@@ -57,7 +57,7 @@ public:
vboxLayout->addWidget(walletWarning);
// show warning when "noWallet" checkbox is checked
QObject::connect(kcfg_noWallet, &QCheckBox::toggled, [this](bool checked){
QObject::connect(kcfg_noWallet, &QCheckBox::toggled, this, [this] (bool checked) {
walletWarning->setVisible(checked);
});
}
@@ -83,10 +83,7 @@ public:
}
void fillFrameBuffersCombo() {
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(
QStringLiteral("krfb"), [](const KPluginMetaData & md) {
return md.serviceTypes().contains(QStringLiteral("krfb/framebuffer"));
});
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("krfb/framebuffer"));
QSet<QString> unique;
QVectorIterator<KPluginMetaData> i(plugins);
i.toBack();
@@ -106,11 +103,11 @@ MainWindow::MainWindow(QWidget *parent)
setAttribute(Qt::WA_DeleteOnClose, false);
m_passwordEditable = false;
m_passwordLineEdit = new KLineEdit(this);
m_passwordLineEdit = new QLineEdit(this);
m_passwordLineEdit->setVisible(false);
m_passwordLineEdit->setAlignment(Qt::AlignHCenter);
QWidget *mainWidget = new QWidget;
auto mainWidget = new QWidget;
m_ui.setupUi(mainWidget);
m_ui.krfbIconLabel->setPixmap(QIcon::fromTheme(QStringLiteral("krfb")).pixmap(128));
m_ui.enableUnattendedCheckBox->setChecked(
@@ -141,10 +138,14 @@ MainWindow::MainWindow(QWidget *parent)
continue;
if(interface.flags() & QNetworkInterface::IsRunning &&
!interface.addressEntries().isEmpty())
m_ui.addressDisplayLabel->setText(QStringLiteral("%1 : %2")
.arg(interface.addressEntries().first().ip().toString())
.arg(port));
!interface.addressEntries().isEmpty()) {
const QString hostName = QHostInfo::localHostName();
const QString ipAddress = interface.addressEntries().constFirst().ip().toString();
const QString addressLabelText = hostName.isEmpty()
? QStringLiteral("%1 : %2").arg(ipAddress).arg(port)
: QStringLiteral("%1 (%2) : %3").arg(hostName, ipAddress).arg(port);
m_ui.addressDisplayLabel->setText(addressLabelText);
}
}
//Figure out the password
@@ -251,12 +252,12 @@ void MainWindow::showConfiguration()
return;
}
KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), KrfbConfig::self());
auto dialog = new KConfigDialog(this, QStringLiteral("settings"), KrfbConfig::self());
dialog->addPage(new TCP, i18n("Network"), QStringLiteral("network-wired"));
dialog->addPage(new Security, i18n("Security"), QStringLiteral("security-high"));
dialog->addPage(new ConfigFramebuffer, i18n("Screen capture"), QStringLiteral("video-display"));
dialog->show();
connect(dialog, &KConfigDialog::settingsChanged, [this] () {
connect(dialog, &KConfigDialog::settingsChanged, this, [this] () {
// check if framebuffer plugin config has changed
if (s_prevFramebufferPlugin != KrfbConfig::preferredFrameBufferPlugin()) {
KMessageBox::information(this, i18n("To apply framebuffer plugin setting, "

View File

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

View File

@@ -12,6 +12,8 @@
<name xml:lang="el">Krfb</name>
<name xml:lang="en-GB">Krfb</name>
<name xml:lang="es">Krfb</name>
<name xml:lang="et">Krfb</name>
<name xml:lang="eu">Krfb</name>
<name xml:lang="fi">Krfb</name>
<name xml:lang="fr">Krfb</name>
<name xml:lang="gl">Krfb</name>
@@ -20,6 +22,7 @@
<name xml:lang="it">Krfb</name>
<name xml:lang="ko">Krfb</name>
<name xml:lang="nl">Krfb</name>
<name xml:lang="nn">Krfb</name>
<name xml:lang="pl">Krfb</name>
<name xml:lang="pt">Krfb</name>
<name xml:lang="pt-BR">Krfb</name>
@@ -36,55 +39,51 @@
<name xml:lang="x-test">xxKrfbxx</name>
<name xml:lang="zh-CN">Krfb</name>
<name xml:lang="zh-TW">Krfb</name>
<summary>Desktop sharing</summary>
<summary xml:lang="ca">Compartició de l'escriptori</summary>
<summary xml:lang="ca-valencia">Compartició de l'escriptori</summary>
<summary xml:lang="cs">Sdíle pracovní plochy</summary>
<summary xml:lang="da">Skrivebordsdeling</summary>
<summary xml:lang="de">Freigabe der Arbeitsfläche</summary>
<summary xml:lang="el">Κοινή χρήση επιφάνειας εργασίας</summary>
<summary xml:lang="en-GB">Desktop sharing</summary>
<summary xml:lang="es">Compartir el escritorio</summary>
<summary xml:lang="fi">Työpöydän jako</summary>
<summary xml:lang="fr">Partage de bureau</summary>
<summary xml:lang="gl">Compartición do escritorio</summary>
<summary xml:lang="ia">Compartir de scriptorio</summary>
<summary xml:lang="id">Desktop sharing</summary>
<summary xml:lang="it">Condivisione del desktop</summary>
<summary xml:lang="ko">데스크톱 공유</summary>
<summary xml:lang="nl">Bureaublad delen</summary>
<summary xml:lang="pl">Współdzielenie pulpitu</summary>
<summary xml:lang="pt">Partilha do ecrã</summary>
<summary xml:lang="pt-BR">Compartilhamento de tela</summary>
<summary xml:lang="ru">Общий рабочий стол</summary>
<summary xml:lang="sk">Zdieľanie pracovnej plochy</summary>
<summary xml:lang="sl">Souporaba namizja</summary>
<summary xml:lang="sr">Дељење површи</summary>
<summary xml:lang="sr-Latn">Deljenje površi</summary>
<summary xml:lang="sr-ijekavian">Дељење површи</summary>
<summary xml:lang="sr-ijekavianlatin">Deljenje površi</summary>
<summary xml:lang="sv">Skrivbordsdelning</summary>
<summary xml:lang="tr">Masaüstü paylaşımı</summary>
<summary xml:lang="uk">Спільне користування стільницею</summary>
<summary xml:lang="x-test">xxDesktop sharingxx</summary>
<summary xml:lang="zh-CN">桌面共享</summary>
<summary xml:lang="zh-TW">桌面分享</summary>
<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="cs">Sdílejte své pracovní prostředí na jiný počítač pomocí 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="fi">Jaa työpöytä toiselle koneelle VNC:n kautta</summary>
<summary xml:lang="fr">Partager votre bureau avec un autre ordinateur grâce à « VNC »</summary>
<summary xml:lang="ia">Compartir tu scriptorio a un altere computator via VNC</summary>
<summary xml:lang="id">Bagikan desktopmu ke komputer lainnya via VNC</summary>
<summary xml:lang="it">Condividi il desktop con un altro computer tramite VNC</summary>
<summary xml:lang="ko">내 데스크톱을 VNC로 다른 컴퓨터와 공유</summary>
<summary xml:lang="nl">Uw bureaublad delen naar een andere computer via VNC</summary>
<summary xml:lang="nn">Del skrivebordet med ei anna maskin via VNC</summary>
<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="sl">Deli namizje z drugim računalnikom prek VNC</summary>
<summary xml:lang="sv">Dela ditt skrivbord med en annan dator via VNC</summary>
<summary xml:lang="uk">Надайте вашу стільницю у спільне користування з іншим комп'ютером за допомогою VNC</summary>
<summary xml:lang="x-test">xxShare your desktop to another computer via VNCxx</summary>
<summary xml:lang="zh-CN">通过 VNC 分享您的桌面到另一台电脑</summary>
<description>
<p>Krfb Desktop Sharing is a server application that allows you to share your current session with a user on another machine, who can use a VNC client to view or even control the desktop.</p>
<p xml:lang="ca">El Krfb és una aplicació de servidor que permet compartir la vostra sessió actual amb un usuari en una altra màquina, la qual pot emprar un client VNC per 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 veure o controlar l'escriptori.</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="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>
<p xml:lang="en-GB">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="es">Krfb para compartir el escritorio es una aplicación de servidor que le permite compartir su sesión actual con un usuario de otra máquina, que puede usar un cliente VNC para ver e incluso controlar su escritorio.</p>
<p xml:lang="et">Krfb töölaua jagamine on serverirakendus, mis võimaldab jagada aktiivset seanssi mõne teise masina taga istuva kasutajaga, kes saab VNC kliendi kaudu töölauda näha või isegi juhtida.</p>
<p xml:lang="eu">Krfb Mahaigaina Partekatzea zerbitzari aplikazio bat da zure uneko saioa beste makina batean dagoen erabiltzaile batekin partekatzen uzten dizuna. Beste makinan VNC bezeroa erabil dezake zure mahaigaina ikusi edo baita kontrolatzeko ere.</p>
<p xml:lang="fi">Krfb-työpöytäjako on palvelinsovellus, jolla voit jakaa nykyisen istuntosi toisen koneen käyttäjälle, joka voi VNC-asiakkaalla nähdä tai jopa hallita työpöytääsi.</p>
<p xml:lang="fr">Le partage de bureau Krfb est une application de serveur qui vous permet de partager votre session courante avec un utilisateur sur une autre machine, qui peut utiliser un client VNC pour afficher et même contrôler le bureau.</p>
<p xml:lang="gl">Krfb é un aplicativo de servidor que permite compartir a sesión actual cun usuario que está noutro equipo, que pode usar un cliente VNC para ver ou mesmo controlar o escritorio.</p>
<p xml:lang="gl">Krfb é unha aplicación de servidor que permite compartir a sesión actual cun usuario que está noutro equipo, que pode usar un cliente VNC para ver ou mesmo controlar o escritorio.</p>
<p xml:lang="ia">Krfb Desktop Sharing es un application de servitor que te permitte compartir tu session currente con un usator sur un altere machina,le qual pote usar un cliente VNC per vider o anque controlar le scriptorio.</p>
<p xml:lang="id">Krfb Desktop Sharing adalah aplikasi server yang memungkinkan kamu untuk berbagi sesimu saat ini dengan pengguna di mesin lain, yang bisa menggunakan klien VNC untuk menampilkan atau bahkan mengendalikan desktop.</p>
<p xml:lang="it">Condivisione del desktop Krfb è un'applicazione server che permette di condividere la sessione attuale con un utente su un'altra macchina, che potrà usare un client VNC per visualizzare ed anche controllare il desktop.</p>
<p xml:lang="ko">Krfb 데스크톱 공유는 현재 세션을 다른 머신의 사용자와 VNC를 통해서 공유하거나 원격 제어를 요청할 수 있는 서버 프로그램입니다.</p>
<p xml:lang="nl">Bureaublad delen is een server-applicatie die u in staat stelt uw huidige sessie te delen met een gebruiker op een andere machine, die een VNC-client kan gebruiken om uw bureaublad te bekijken of zelfs te besturen.</p>
<p xml:lang="nn">Krfb skrivebordsdeling er eit tenar­program som lèt deg dela skrivebords­økta di med ein brukar på ei anna maskin. Vedkommande kan så bruka ein VNC-klient for å sjå og eventuelt òg styra økta.</p>
<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>
@@ -100,7 +99,7 @@
<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>
<p xml:lang="zh-TW">Krfb 桌面分享是款伺服器應用程式,它可以將您目前的桌面階段分享給一位於其他主機上的使用者,以讓他能使用 VNC 戶端檢視、甚至控制您的桌面。</p>
<p xml:lang="zh-TW">Krfb 桌面分享是款伺服器應用程式,它可以將您目前的桌面階段分享給一位於其他主機上的使用者,以讓他能使用 VNC 戶端檢視、甚至控制您的桌面。</p>
</description>
<url type="homepage">https://userbase.kde.org/Krfb</url>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=krfb</url>
@@ -114,18 +113,26 @@
<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>
<caption xml:lang="el">Κοινή χρήση επιφάνειας εργασίας με το Krfb</caption>
<caption xml:lang="en-GB">Sharing desktop with Krfb</caption>
<caption xml:lang="es">Compartiendo el escritorio con Krfb</caption>
<caption xml:lang="et">Töölaua jagamine Krfb abil</caption>
<caption xml:lang="eu">Mahaigaina Krfb-ren bidez partekatzea</caption>
<caption xml:lang="fi">Työpöydän jakaminen Krfb:llä</caption>
<caption xml:lang="fr">Partage de bureau grâce à Krfb</caption>
<caption xml:lang="gl">Compartindo o escritorio con Krfb</caption>
<caption xml:lang="ia">Compartir scriptorio con Krfb</caption>
<caption xml:lang="id">Berbagi desktop dengan Krfb</caption>
<caption xml:lang="it">Condivisone del desktop con Krfb</caption>
<caption xml:lang="ko">Krfb로 데스크톱 공유</caption>
<caption xml:lang="nl">Bureaublad delen met Krfb</caption>
<caption xml:lang="nn">Skrivebordsdeling med Krfb</caption>
<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="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="uk">Спільне використання стільниці за допомогою Krfb</caption>
<caption xml:lang="x-test">xxSharing desktop with Krfbxx</caption>
@@ -138,4 +145,10 @@
<binary>krfb</binary>
</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"/>
</releases>
</component>

View File

@@ -74,76 +74,31 @@ Name[x-test]=xxKrfbxx
Name[zh_CN]=Krfb
Name[zh_HK]=Krfb
Name[zh_TW]=桌面分享_Krfb
GenericName=Desktop Sharing
GenericName[ar]=مشاركة سطح المكتب
GenericName[bg]=Споделяне на работния плот
GenericName[bn]=ডেস্কটপ ভাগাভাগি
GenericName[br]=Rannañ ar vurev
GenericName[bs]=Dijeljenje radne površine
GenericName[ca]=Compartir l'escriptori
GenericName[ca@valencia]=Compartir l'escriptori
GenericName[cs]=Sdílení pracovní plochy
GenericName[cy]=Rhannu Penbwrdd
GenericName[da]=Skrivebordsdeling
GenericName[de]=Arbeitsfläche freigeben
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας
GenericName[en_GB]=Desktop Sharing
GenericName[eo]=Tabula komunigado
GenericName[es]=Escritorio compartido
GenericName[et]=Töölaua jagamine
GenericName[eu]=Mahaigaina partekatzea
GenericName[fa]=اشتراک رومیزی
GenericName[fi]=Työpöydän jakaminen
GenericName[fr]=Partage de bureaux
GenericName[ga]=Roinnt Deisce
GenericName[gl]=Compartimento de escritorio
GenericName[he]=שיתוף שולחנות עבודה
GenericName[hi]=डेस्कटॉप साझेदारी
GenericName[hne]=डेस्कटाप साझेदारी
GenericName[hr]=Dijeljenje radne površine
GenericName[hu]=Munkaasztal-megosztás
GenericName[ia]=Compartir de scriptorio
GenericName[id]=Desktop Sharing
GenericName[is]=Skjáborðsmiðlun
GenericName[it]=Condivisione del desktop
GenericName[ja]=デスクトップ共有
GenericName[kk]=Үстелді ортақтастыру
GenericName[km]=ការ​ចែក​រំលែក​ផ្ទៃ​តុ
GenericName[ko]=데스크톱 공유
GenericName[lt]=Dalinimasis darbalaukiu
GenericName[lv]=Darbvirsmas koplietošana
GenericName[ml]=പണിയിടം പങ്കുവെക്കല്‍
GenericName[mr]=डेस्कटॉप शेअरींग
GenericName[nb]=Delte skrivebord
GenericName[nds]=Schriefdisch-Freegaav
GenericName[ne]=डेस्कटप साझेदारी
GenericName[nl]=Bureaublad delen
GenericName[nn]=Skrivebordsdeling
GenericName[pa]=ਡੈਸਕਟਾਪ ਸ਼ੇਅਰਿੰਗ
GenericName[pl]=Współdzielenie pulpitu
GenericName[pt]=Partilha do Ecrã
GenericName[pt_BR]=Compartilhamento de ambiente de trabalho
GenericName[ro]=Partajare birou
GenericName[ru]=Общий рабочий стол
GenericName[si]=වැඩතල හවුල්
GenericName[sk]=Zdieľanie pracovnej plochy
GenericName[sl]=Souporaba namizja
GenericName[sr]=Дељење површи
GenericName[sr@ijekavian]=Дијељење површи
GenericName[sr@ijekavianlatin]=Dijeljenje površi
GenericName[sr@latin]=Deljenje površi
GenericName[sv]=Dela ut skrivbordet
GenericName[th]=ใช้งานพื้นที่ทำงานร่วมกัน
GenericName[tr]=Masaüstü Paylaşımı
GenericName[ug]=ئۈستەلئۈستىنى ھەمبەھىرلەش
GenericName[uk]=Спільні стільниці
GenericName[uz]=Ish stoli bilan boʻlishish
GenericName[uz@cyrillic]=Иш столи билан бўлишиш
GenericName[vi]=Chia sẻ màn hình nền
GenericName[x-test]=xxDesktop Sharingxx
GenericName[zh_CN]=桌面共享
GenericName[zh_HK]=桌面分享
GenericName[zh_TW]=桌面分享
GenericName=Desktop Sharing (VNC)
GenericName[ca]=Compartició de l'escriptori (VNC)
GenericName[ca@valencia]=Compartició de l'escriptori (VNC)
GenericName[cs]=Sdílení pracovní plochy (VNC)
GenericName[da]=Skrivebordsdeling (VNC)
GenericName[de]=Arbeitsflächen-Freigabe (VNC)
GenericName[el]=Κοινή χρήση επιφάνειας εργασίας (VNC)
GenericName[en_GB]=Desktop Sharing (VNC)
GenericName[es]=Escritorio compartido (VNC)
GenericName[et]=Töölaua jagamine (VNC)
GenericName[fi]=Työpöydän jakaminen (VNC)
GenericName[fr]=Partage de bureaux (VNC)
GenericName[ia]=Compartir de scriptorio (VNC)
GenericName[it]=Condivisione del desktop (VNC)
GenericName[ko]=데스크톱 공유(VNC)
GenericName[nl]=Bureaublad delen (VNC)
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[sl]=Souporaba namizja (VNC)
GenericName[sv]=Skrivbordsdelning (VNC)
GenericName[uk]=Спільні стільниці (VNC)
GenericName[x-test]=xxDesktop Sharing (VNC)xx
GenericName[zh_CN]=桌面共享 (VNC)
Comment=Desktop Sharing
Comment[af]=Werkskerm Deeling
Comment[ar]=مشاركة سطح المكتب
@@ -215,5 +170,6 @@ Comment[x-test]=xxDesktop Sharingxx
Comment[zh_CN]=桌面共享
Comment[zh_HK]=桌面分享
Comment[zh_TW]=桌面分享
Categories=Qt;KDE;System;Network;RemoteAccess;
Categories=Qt;KDE;Network;RemoteAccess;
X-DBUS-ServiceName=org.kde.krfb
X-KDE-Wayland-Interfaces=org_kde_kwin_fake_input,org_kde_kwin_remote_access_manager

View File

@@ -21,9 +21,8 @@
#include "connectiondialog.h"
#include "krfbconfig.h"
#include "sockethelpers.h"
#include "events.h"
#include "eventsmanager.h"
#include <QSocketNotifier>
#include <QDebug>
#include <poll.h>
#include <strings.h> //for bzero()
@@ -37,6 +36,7 @@ struct RfbClient::Private
bool controlEnabled;
rfbClientPtr client;
QSocketNotifier *notifier;
QSharedPointer<EventHandler> eventHandler;
QString remoteAddressString;
};
@@ -49,6 +49,8 @@ RfbClient::RfbClient(rfbClientPtr client, QObject* parent)
d->notifier = new QSocketNotifier(client->sock, QSocketNotifier::Read, this);
d->notifier->setEnabled(false);
connect(d->notifier, &QSocketNotifier::activated, this, &RfbClient::onSocketActivated);
d->eventHandler = EventsManager::instance()->eventHandler();
}
RfbClient::~RfbClient()
@@ -110,14 +112,14 @@ rfbClientPtr RfbClient::getRfbClientPtr()
void RfbClient::handleKeyboardEvent(bool down, rfbKeySym keySym)
{
if (d->controlEnabled) {
EventHandler::handleKeyboard(down, keySym);
d->eventHandler->handleKeyboard(down, keySym);
}
}
void RfbClient::handleMouseEvent(int buttonMask, int x, int y)
{
if (d->controlEnabled) {
EventHandler::handlePointer(buttonMask, x, y);
d->eventHandler->handlePointer(buttonMask, x, y);
}
}
@@ -214,11 +216,11 @@ bool PendingRfbClient::vncAuthCheckPassword(const QByteArray& password, const QB
return true;
}
char passwd[MAXPWLEN];
char passwd[MAXPWLEN+1]; // +1 to make sure there's a nullptr at the end
unsigned char challenge[CHALLENGESIZE];
memcpy(challenge, m_rfbClient->authChallenge, CHALLENGESIZE);
bzero(passwd, MAXPWLEN);
memset(passwd, 0, sizeof(passwd));
if (!password.isEmpty()) {
strncpy(passwd, password.constData(),

View File

@@ -19,11 +19,12 @@
*/
#include "rfbserver.h"
#include "rfbservermanager.h"
#include "krfbdebug.h"
#include <QSocketNotifier>
#include <QApplication>
#include <QClipboard>
#include <QPointer>
#include <QDebug>
#include <QX11Info>
struct RfbServer::Private
{
@@ -91,7 +92,7 @@ bool RfbServer::start()
if (!d->screen) {
d->screen = RfbServerManager::instance()->newScreen();
if (!d->screen) {
qDebug() << "Unable to get rbfserver screen";
qCDebug(KRFB) << "Unable to get rbfserver screen";
return false;
}
@@ -108,7 +109,7 @@ bool RfbServer::start()
}
if (listeningAddress() != "0.0.0.0") {
strncpy(d->screen->thisHost, listeningAddress().data(), 254);
strncpy(d->screen->thisHost, listeningAddress().constData(), 254);
}
if (listeningPort() == 0) {
@@ -124,14 +125,14 @@ bool RfbServer::start()
d->screen->authPasswdData = (void *)nullptr;
}
qDebug() << "Starting server. Listen port:" << listeningPort()
qCDebug(KRFB) << "Starting server. Listen port:" << listeningPort()
<< "Listen Address:" << listeningAddress()
<< "Password enabled:" << passwordRequired();
rfbInitServer(d->screen);
if (!rfbIsActive(d->screen)) {
qDebug() << "Failed to start server";
qCDebug(KRFB) << "Failed to start server";
rfbShutdownServer(d->screen, false);
return false;
};
@@ -143,8 +144,11 @@ bool RfbServer::start()
d->ipv6notifier = new QSocketNotifier(d->screen->listen6Sock, QSocketNotifier::Read, this);
connect(d->ipv6notifier, &QSocketNotifier::activated, this, &RfbServer::onListenSocketActivated);
}
connect(QApplication::clipboard(), &QClipboard::dataChanged,
this, &RfbServer::krfbSendServerCutText);
if (QX11Info::isPlatformX11()) {
connect(QApplication::clipboard(), &QClipboard::dataChanged,
this, &RfbServer::krfbSendServerCutText);
}
return true;
}
@@ -162,6 +166,17 @@ void RfbServer::stop()
}
}
void RfbServer::updateFrameBuffer(char *fb, int width, int height, int depth)
{
int bpp = depth >> 3;
if (bpp != 1 && bpp != 2 && bpp != 4) {
bpp = 4;
}
rfbNewFramebuffer(d->screen, fb, width, height, 8, 3, bpp);
}
void RfbServer::updateScreen(const QList<QRect> & modifiedTiles)
{
if (d->screen) {
@@ -238,7 +253,7 @@ void RfbServer::pendingClientFinished(RfbClient *client)
rfbNewClientAction RfbServer::newClientHook(rfbClientPtr cl)
{
//qDebug() << "New client";
RfbServer *server = static_cast<RfbServer*>(cl->screen->screenData);
auto server = static_cast<RfbServer*>(cl->screen->screenData);
PendingRfbClient *pendingClient = server->newClient(cl);
connect(pendingClient, &PendingRfbClient::finished,
@@ -251,7 +266,7 @@ rfbNewClientAction RfbServer::newClientHook(rfbClientPtr cl)
void RfbServer::clientGoneHook(rfbClientPtr cl)
{
//qDebug() << "client gone";
RfbClient *client = static_cast<RfbClient*>(cl->clientData);
auto client = static_cast<RfbClient*>(cl->clientData);
RfbServerManager::instance()->removeClient(client);
client->deleteLater();
@@ -260,7 +275,7 @@ void RfbServer::clientGoneHook(rfbClientPtr cl)
//static
rfbBool RfbServer::passwordCheck(rfbClientPtr cl, const char *encryptedPassword, int len)
{
PendingRfbClient *client = static_cast<PendingRfbClient*>(cl->clientData);
auto client = static_cast<PendingRfbClient*>(cl->clientData);
Q_ASSERT(client);
return client->checkPassword(QByteArray::fromRawData(encryptedPassword, len));
}
@@ -268,14 +283,14 @@ rfbBool RfbServer::passwordCheck(rfbClientPtr cl, const char *encryptedPassword,
//static
void RfbServer::keyboardHook(rfbBool down, rfbKeySym keySym, rfbClientPtr cl)
{
RfbClient *client = static_cast<RfbClient*>(cl->clientData);
auto client = static_cast<RfbClient*>(cl->clientData);
client->handleKeyboardEvent(down ? true : false, keySym);
}
//static
void RfbServer::pointerHook(int bm, int x, int y, rfbClientPtr cl)
{
RfbClient *client = static_cast<RfbClient*>(cl->clientData);
auto client = static_cast<RfbClient*>(cl->clientData);
client->handleMouseEvent(bm, x, y);
}

View File

@@ -43,6 +43,7 @@ public Q_SLOTS:
virtual bool start();
virtual void stop();
void updateFrameBuffer(char *fb, int width, int height, int depth);
void updateScreen(const QList<QRect> & modifiedTiles);
void updateCursorPosition(const QPoint & position);

View File

@@ -29,7 +29,6 @@
#include <QDesktopWidget>
#include <QGlobalStatic>
#include <QHostInfo>
#include <QDebug>
#include <KLocalizedString>
#include <KUser>
@@ -90,7 +89,6 @@ RfbServerManager* RfbServerManager::instance()
return &s_instance->server;
}
struct RfbServerManager::Private
{
QSharedPointer<FrameBuffer> fb;
@@ -113,6 +111,11 @@ RfbServerManager::~RfbServerManager()
delete d;
}
QSharedPointer<FrameBuffer> RfbServerManager::framebuffer() const
{
return d->fb;
}
void RfbServerManager::init()
{
//qDebug();
@@ -123,10 +126,18 @@ void RfbServerManager::init()
d->desktopName = QStringLiteral("%1@%2 (shared desktop)") //FIXME check if we can use utf8
.arg(KUser().loginName(),QHostInfo::localHostName()).toLatin1();
connect(d->fb.data(), &FrameBuffer::frameBufferChanged, this, &RfbServerManager::updateFrameBuffer);
connect(&d->rfbUpdateTimer, &QTimer::timeout, this, &RfbServerManager::updateScreens);
connect(qApp, &QApplication::aboutToQuit, this, &RfbServerManager::cleanup);
}
void RfbServerManager::updateFrameBuffer()
{
Q_FOREACH(RfbServer *server, d->servers) {
server->updateFrameBuffer(d->fb->data(), d->fb->width(), d->fb->height(), d->fb->depth());
}
}
void RfbServerManager::updateScreens()
{
QList<QRect> rects = d->fb->modifiedTiles();
@@ -194,7 +205,6 @@ rfbScreenInfoPtr RfbServerManager::newScreen()
screen->paddedWidthInBytes = d->fb->paddedWidth();
d->fb->getServerFormat(screen->serverFormat);
screen->frameBuffer = d->fb->data();
screen->desktopName = d->desktopName.constData();
screen->cursor = d->myCursor;
}

View File

@@ -21,6 +21,7 @@
#define RFBSERVERMANAGER_H
#include "rfb.h"
#include "framebuffer.h"
#include <QObject>
class RfbClient;
@@ -33,12 +34,14 @@ class RfbServerManager : public QObject
public:
static RfbServerManager *instance();
QSharedPointer<FrameBuffer> framebuffer() const;
Q_SIGNALS:
void clientConnected(RfbClient *cc);
void clientDisconnected(RfbClient *cc);
private Q_SLOTS:
void init();
void updateFrameBuffer();
void updateScreens();
void cleanup();

View File

@@ -28,14 +28,13 @@
QString peerAddress(int sock)
{
const int ADDR_SIZE = 50;
struct sockaddr sa;
struct sockaddr sa = {};
socklen_t salen = sizeof(struct sockaddr);
if (getpeername(sock, &sa, &salen) == 0) {
if (sa.sa_family == AF_INET) {
struct sockaddr_in *si = (struct sockaddr_in *)&sa;
auto si = (struct sockaddr_in *)&sa;
return QString::fromLatin1(inet_ntoa(si->sin_addr));
}
@@ -53,12 +52,11 @@ QString peerAddress(int sock)
unsigned short peerPort(int sock)
{
struct sockaddr sa;
struct sockaddr sa = {};
socklen_t salen = sizeof(struct sockaddr);
if (getpeername(sock, &sa, &salen) == 0) {
struct sockaddr_in *si = (struct sockaddr_in *)&sa;
auto si = (struct sockaddr_in *)&sa;
return ntohs(si->sin_port);
}
@@ -67,14 +65,13 @@ unsigned short peerPort(int sock)
QString localAddress(int sock)
{
const int ADDR_SIZE = 50;
struct sockaddr sa;
struct sockaddr sa = {};
socklen_t salen = sizeof(struct sockaddr);
if (getsockname(sock, &sa, &salen) == 0) {
if (sa.sa_family == AF_INET) {
struct sockaddr_in *si = (struct sockaddr_in *)&sa;
auto si = (struct sockaddr_in *)&sa;
return QString::fromLatin1(inet_ntoa(si->sin_addr));
}
@@ -92,12 +89,11 @@ QString localAddress(int sock)
unsigned short localPort(int sock)
{
struct sockaddr sa;
struct sockaddr sa = {};
socklen_t salen = sizeof(struct sockaddr);
if (getsockname(sock, &sa, &salen) == 0) {
struct sockaddr_in *si = (struct sockaddr_in *)&sa;
auto si = (struct sockaddr_in *)&sa;
return ntohs(si->sin_port);
}

View File

@@ -18,6 +18,8 @@
#ifndef TRAYICON_H
#define TRAYICON_H
#include <QHash>
#include <KStatusNotifierItem>
class RfbClient;

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB