mirror of
https://github.com/KDE/krfb
synced 2026-07-02 16:01:17 -07:00
Compare commits
9 Commits
work/nodes
...
v22.08.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e8fc32ff8 | ||
|
|
4b1e20fbd3 | ||
|
|
de4dcbbcc6 | ||
|
|
ba0edf0b6f | ||
|
|
7f26fdecab | ||
|
|
aa73ae5dc2 | ||
|
|
eab4bda53b | ||
|
|
9d9cfd2ce0 | ||
|
|
06e6cba751 |
@@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# KDE Application Version, managed by release script
|
||||
set (RELEASE_SERVICE_VERSION_MAJOR "22")
|
||||
set (RELEASE_SERVICE_VERSION_MINOR "11")
|
||||
set (RELEASE_SERVICE_VERSION_MICRO "70")
|
||||
set (RELEASE_SERVICE_VERSION_MINOR "08")
|
||||
set (RELEASE_SERVICE_VERSION_MICRO "2")
|
||||
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
|
||||
|
||||
project(krfb VERSION ${RELEASE_SERVICE_VERSION})
|
||||
|
||||
set(QT_MIN_VERSION 5.15.2)
|
||||
set(QT_MIN_VERSION 5.15.0)
|
||||
set(KF5_MIN_VERSION 5.91.0)
|
||||
|
||||
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE REQUIRED)
|
||||
@@ -21,7 +21,6 @@ include(ECMInstallIcons)
|
||||
include(ECMAddAppIcon)
|
||||
include(ECMSetupVersion)
|
||||
include(ECMQtDeclareLoggingCategory)
|
||||
include(ECMDeprecationSettings)
|
||||
include(FeatureSummary)
|
||||
include(CheckIncludeFile)
|
||||
|
||||
@@ -61,11 +60,22 @@ if(WIN32)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES})
|
||||
endif(WIN32)
|
||||
|
||||
ecm_set_disabled_deprecation_versions(
|
||||
QT 5.15.2
|
||||
KF 5.91
|
||||
add_definitions(
|
||||
-DQT_DEPRECATED_WARNINGS
|
||||
-DQT_USE_QSTRINGBUILDER
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
-DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_CAST_FROM_BYTEARRAY
|
||||
-DQT_STRICT_ITERATORS
|
||||
-DQT_NO_URL_CAST_FROM_STRING
|
||||
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
|
||||
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
||||
)
|
||||
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
|
||||
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
|
||||
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
|
||||
|
||||
find_package(LibVNCServer REQUIRED)
|
||||
|
||||
@@ -961,8 +961,8 @@ PWFrameBuffer::Private::~Private()
|
||||
}
|
||||
}
|
||||
|
||||
PWFrameBuffer::PWFrameBuffer(QObject *parent)
|
||||
: FrameBuffer (parent),
|
||||
PWFrameBuffer::PWFrameBuffer(WId winid, QObject *parent)
|
||||
: FrameBuffer (winid, parent),
|
||||
d(new Private(this))
|
||||
{
|
||||
fb = nullptr;
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
};
|
||||
using Streams = QList<Stream>;
|
||||
|
||||
PWFrameBuffer(QObject *parent = nullptr);
|
||||
PWFrameBuffer(WId winid, QObject *parent = nullptr);
|
||||
virtual ~PWFrameBuffer() override;
|
||||
|
||||
void initDBus();
|
||||
|
||||
@@ -30,9 +30,11 @@ PWFrameBufferPlugin::PWFrameBufferPlugin(QObject *parent, const QVariantList &ar
|
||||
}
|
||||
|
||||
|
||||
FrameBuffer *PWFrameBufferPlugin::frameBuffer(const QVariantMap &args)
|
||||
FrameBuffer *PWFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
auto pwfb = new PWFrameBuffer;
|
||||
//NOTE WId is irrelevant in Wayland
|
||||
|
||||
auto pwfb = new PWFrameBuffer(id);
|
||||
if (args.contains(QLatin1String("name"))) {
|
||||
pwfb->startVirtualMonitor(args[QStringLiteral("name")].toString(), args[QStringLiteral("resolution")].toSize(), args[QStringLiteral("scale")].toDouble());
|
||||
} else {
|
||||
|
||||
@@ -34,7 +34,7 @@ class PWFrameBufferPlugin: public FrameBufferPlugin
|
||||
public:
|
||||
PWFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
|
||||
FrameBuffer *frameBuffer(const QVariantMap &args) override;
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(PWFrameBufferPlugin)
|
||||
|
||||
@@ -24,7 +24,6 @@ target_link_libraries (krfb_framebuffer_qt
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
KF5::CoreAddons
|
||||
Qt::GuiPrivate
|
||||
krfbprivate
|
||||
)
|
||||
|
||||
|
||||
@@ -13,20 +13,17 @@
|
||||
#include <QRegion>
|
||||
#include <QPixmap>
|
||||
#include <QBitmap>
|
||||
#include <QApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
|
||||
const int UPDATE_TIME = 500;
|
||||
|
||||
QtFrameBuffer::QtFrameBuffer(QObject *parent)
|
||||
: FrameBuffer(parent)
|
||||
QtFrameBuffer::QtFrameBuffer(WId id, QObject *parent)
|
||||
: FrameBuffer(id, parent)
|
||||
{
|
||||
QScreen *screen = QGuiApplication::primaryScreen();
|
||||
QPlatformNativeInterface* native = qApp->platformNativeInterface();
|
||||
|
||||
if (screen) {
|
||||
win = reinterpret_cast<WId>(native->nativeResourceForScreen(QByteArrayLiteral("rootwindow"), screen));
|
||||
primaryScreen = screen;
|
||||
fbImage = screen->grabWindow(win).toImage();
|
||||
fb = new char[fbImage.sizeInBytes()];
|
||||
|
||||
@@ -22,7 +22,7 @@ class QtFrameBuffer : public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QtFrameBuffer(QObject *parent = nullptr);
|
||||
explicit QtFrameBuffer(WId id, QObject *parent = nullptr);
|
||||
|
||||
~QtFrameBuffer() override;
|
||||
|
||||
@@ -38,7 +38,6 @@ public Q_SLOTS:
|
||||
void updateFrameBuffer();
|
||||
|
||||
private:
|
||||
WId win;
|
||||
QImage fbImage;
|
||||
QTimer *t;
|
||||
QScreen *primaryScreen;
|
||||
|
||||
@@ -31,10 +31,10 @@ QtFrameBufferPlugin::QtFrameBufferPlugin(QObject *parent, const QVariantList &ar
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(const QVariantMap &args)
|
||||
FrameBuffer *QtFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
return new QtFrameBuffer;
|
||||
return new QtFrameBuffer(id);
|
||||
}
|
||||
|
||||
#include "qtframebufferplugin.moc"
|
||||
|
||||
@@ -34,7 +34,7 @@ class QtFrameBufferPlugin : public FrameBufferPlugin
|
||||
public:
|
||||
QtFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
|
||||
FrameBuffer *frameBuffer(const QVariantMap &args) override;
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QtFrameBufferPlugin)
|
||||
|
||||
@@ -20,7 +20,6 @@ add_library(krfb_framebuffer_xcb MODULE ${krfb_framebuffer_xcb_SRCS})
|
||||
target_link_libraries (krfb_framebuffer_xcb
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt::GuiPrivate
|
||||
XCB::XCB
|
||||
XCB::RENDER
|
||||
XCB::SHAPE
|
||||
|
||||
@@ -19,11 +19,10 @@
|
||||
#include <sys/shm.h>
|
||||
|
||||
#include <QX11Info>
|
||||
#include <QApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
|
||||
class KrfbXCBEventFilter: public QAbstractNativeEventFilter
|
||||
@@ -131,7 +130,6 @@ public:
|
||||
bool running;
|
||||
|
||||
QRect area; // capture area, primary monitor coordinates
|
||||
WId win;
|
||||
};
|
||||
|
||||
|
||||
@@ -146,8 +144,8 @@ static xcb_screen_t *get_xcb_screen(xcb_connection_t *conn, int screen_num) {
|
||||
|
||||
|
||||
|
||||
XCBFrameBuffer::XCBFrameBuffer(QObject *parent):
|
||||
FrameBuffer(parent), d(new XCBFrameBuffer::P)
|
||||
XCBFrameBuffer::XCBFrameBuffer(WId winid, QObject *parent):
|
||||
FrameBuffer(winid, parent), d(new XCBFrameBuffer::P)
|
||||
{
|
||||
d->running = false;
|
||||
d->damage = XCB_NONE;
|
||||
@@ -164,8 +162,6 @@ XCBFrameBuffer::XCBFrameBuffer(QObject *parent):
|
||||
|
||||
QScreen *primaryScreen = QGuiApplication::primaryScreen();
|
||||
if (primaryScreen) {
|
||||
QPlatformNativeInterface* native = qApp->platformNativeInterface();
|
||||
d->win = reinterpret_cast<WId>(native->nativeResourceForScreen(QByteArrayLiteral("rootwindow"), primaryScreen));
|
||||
qreal scaleFactor = primaryScreen->devicePixelRatio();
|
||||
d->area = { primaryScreen->geometry().topLeft() * scaleFactor,
|
||||
primaryScreen->geometry().bottomRight() * scaleFactor };
|
||||
@@ -181,7 +177,7 @@ XCBFrameBuffer::XCBFrameBuffer(QObject *parent):
|
||||
}
|
||||
|
||||
d->framebufferImage = xcb_image_get(QX11Info::connection(),
|
||||
d->win,
|
||||
this->win,
|
||||
d->area.left(),
|
||||
d->area.top(),
|
||||
d->area.width(),
|
||||
@@ -250,7 +246,7 @@ XCBFrameBuffer::XCBFrameBuffer(QObject *parent):
|
||||
// will return 1 on success (yes!)
|
||||
int shmget_res = xcb_image_shm_get(
|
||||
QX11Info::connection(),
|
||||
d->win,
|
||||
this->win,
|
||||
d->updateTile,
|
||||
d->shminfo,
|
||||
d->area.left(), // x
|
||||
@@ -558,7 +554,7 @@ QList<QRect> XCBFrameBuffer::modifiedTiles() {
|
||||
// translate whe coordinates
|
||||
xcb_shm_get_image_cookie_t sgi_cookie = xcb_shm_get_image(
|
||||
QX11Info::connection(),
|
||||
d->win,
|
||||
this->win,
|
||||
d->area.left() + r.left(),
|
||||
d->area.top() + r.top(),
|
||||
r.width(),
|
||||
@@ -613,7 +609,7 @@ QList<QRect> XCBFrameBuffer::modifiedTiles() {
|
||||
// need function that copies pixels from one image to another
|
||||
xcb_image_t *damagedImage = xcb_image_get(
|
||||
QX11Info::connection(),
|
||||
d->win,
|
||||
this->win,
|
||||
r.left(),
|
||||
r.top(),
|
||||
r.width(),
|
||||
@@ -653,7 +649,7 @@ void XCBFrameBuffer::startMonitor() {
|
||||
|
||||
d->running = true;
|
||||
d->damage = xcb_generate_id(QX11Info::connection());
|
||||
xcb_damage_create(QX11Info::connection(), d->damage, d->win,
|
||||
xcb_damage_create(QX11Info::connection(), d->damage, this->win,
|
||||
XCB_DAMAGE_REPORT_LEVEL_RAW_RECTANGLES);
|
||||
|
||||
// (currently) we do not call xcb_damage_subtract() EVER, because
|
||||
|
||||
@@ -22,7 +22,7 @@ class XCBFrameBuffer: public FrameBuffer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit XCBFrameBuffer(QObject *parent = nullptr);
|
||||
explicit XCBFrameBuffer(WId winid, QObject *parent = nullptr);
|
||||
~XCBFrameBuffer() override;
|
||||
|
||||
public:
|
||||
|
||||
@@ -29,10 +29,10 @@ XCBFrameBufferPlugin::XCBFrameBufferPlugin(QObject *parent, const QVariantList &
|
||||
{
|
||||
}
|
||||
|
||||
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(const QVariantMap &args)
|
||||
FrameBuffer *XCBFrameBufferPlugin::frameBuffer(WId id, const QVariantMap &args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
return new XCBFrameBuffer;
|
||||
return new XCBFrameBuffer(id);
|
||||
}
|
||||
|
||||
#include "xcb_framebufferplugin.moc"
|
||||
|
||||
@@ -34,7 +34,7 @@ class XCBFrameBufferPlugin: public FrameBufferPlugin
|
||||
public:
|
||||
XCBFrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
|
||||
FrameBuffer *frameBuffer(const QVariantMap &args) override;
|
||||
FrameBuffer *frameBuffer(WId id, const QVariantMap &args) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(XCBFrameBufferPlugin)
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#include <QCursor>
|
||||
|
||||
|
||||
FrameBuffer::FrameBuffer(QObject *parent)
|
||||
: QObject(parent)
|
||||
FrameBuffer::FrameBuffer(WId id, QObject *parent)
|
||||
: QObject(parent), win(id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class KRFBPRIVATE_EXPORT FrameBuffer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FrameBuffer(QObject *parent = nullptr);
|
||||
explicit FrameBuffer(WId id, QObject *parent = nullptr);
|
||||
|
||||
~FrameBuffer() override;
|
||||
|
||||
@@ -52,6 +52,7 @@ Q_SIGNALS:
|
||||
void frameBufferChanged();
|
||||
|
||||
protected:
|
||||
WId win;
|
||||
char *fb = nullptr;
|
||||
QList<QRect> tiles;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ QSharedPointer<FrameBuffer> FrameBufferManager::frameBuffer(WId id, const QVaria
|
||||
if (it.key() == KrfbConfig::preferredFrameBufferPlugin()) {
|
||||
qCDebug(KRFB) << "Using FrameBuffer:" << KrfbConfig::preferredFrameBufferPlugin();
|
||||
|
||||
QSharedPointer<FrameBuffer> frameBuffer(it.value()->frameBuffer(args));
|
||||
QSharedPointer<FrameBuffer> frameBuffer(it.value()->frameBuffer(id, args));
|
||||
if (frameBuffer) {
|
||||
m_frameBuffers.insert(id, frameBuffer.toWeakRef());
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
explicit FrameBufferPlugin(QObject *parent, const QVariantList &args);
|
||||
~FrameBufferPlugin() override;
|
||||
|
||||
virtual FrameBuffer *frameBuffer(const QVariantMap &args) = 0;
|
||||
virtual FrameBuffer *frameBuffer(WId id, const QVariantMap &args) = 0;
|
||||
};
|
||||
|
||||
#endif // Header guard
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <QSet>
|
||||
#include <QNetworkInterface>
|
||||
#include <QHostInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
class TCP: public QWidget, public Ui::TCP
|
||||
{
|
||||
@@ -219,16 +219,16 @@ void MainWindow::passwordChanged(const QString& password)
|
||||
|
||||
void MainWindow::aboutConnectionAddress()
|
||||
{
|
||||
QMessageBox::about(this,
|
||||
i18n("KDE Desktop Sharing"),
|
||||
i18n("This field contains the address of your computer and the port number, separated by a colon.\n\nThe address is just a hint - you can use any address that can reach your computer.\n\nDesktop Sharing tries to guess your address from your network configuration, but does not always succeed in doing so.\n\nIf your computer is behind a firewall it may have a different address or be unreachable for other computers."));
|
||||
KMessageBox::about(this,
|
||||
i18n("This field contains the address of your computer and the port number, separated by a colon.\n\nThe address is just a hint - you can use any address that can reach your computer.\n\nDesktop Sharing tries to guess your address from your network configuration, but does not always succeed in doing so.\n\nIf your computer is behind a firewall it may have a different address or be unreachable for other computers."),
|
||||
i18n("KDE Desktop Sharing"));
|
||||
}
|
||||
|
||||
void MainWindow::aboutUnattendedMode()
|
||||
{
|
||||
QMessageBox::about(this,
|
||||
i18n("KDE Desktop Sharing"),
|
||||
i18n("Any remote user with normal desktop sharing password will have to be authenticated.\n\nIf unattended access is on, and the remote user provides unattended mode password, desktop sharing access will be granted without explicit confirmation."));
|
||||
KMessageBox::about(this,
|
||||
i18n("Any remote user with normal desktop sharing password will have to be authenticated.\n\nIf unattended access is on, and the remote user provides unattended mode password, desktop sharing access will be granted without explicit confirmation."),
|
||||
i18n("KDE Desktop Sharing"));
|
||||
}
|
||||
|
||||
void MainWindow::showConfiguration()
|
||||
|
||||
@@ -156,9 +156,9 @@
|
||||
</provides>
|
||||
<project_group>KDE</project_group>
|
||||
<releases>
|
||||
<release version="22.08.2" date="2022-10-13"/>
|
||||
<release version="22.08.1" date="2022-09-08"/>
|
||||
<release version="22.08.0" date="2022-08-18"/>
|
||||
<release version="22.04.3" date="2022-07-07"/>
|
||||
<release version="22.04.2" date="2022-06-09"/>
|
||||
<release version="22.04.1" date="2022-05-12"/>
|
||||
<release version="22.04.0" date="2022-04-21"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
||||
@@ -11,6 +11,7 @@ Name[cs]=Virtuální monitor KRFB
|
||||
Name[el]=Εικονική οθόνη του KRFB
|
||||
Name[en_GB]=KRFBs Virtual Monitor
|
||||
Name[es]=Monitor virtual de KRFB
|
||||
Name[eu]=KRFBren alegiazko monitorea
|
||||
Name[fi]=KRFB:n virtuaalinäyttö
|
||||
Name[fr]=Moniteur virtuel « Krfb »
|
||||
Name[ia]=Virtual Monitor de KRFB
|
||||
@@ -36,6 +37,7 @@ Comment[cs]=Vzdálený virtuální monitor
|
||||
Comment[el]=Απομακρυσμένη εικονική οθόνη
|
||||
Comment[en_GB]=Remote Virtual Monitor
|
||||
Comment[es]=Monitor virtual remoto
|
||||
Comment[eu]=Urruneko alegiazko monitorea
|
||||
Comment[fi]=Virtuaalinen etänäyttö
|
||||
Comment[fr]=Moniteur virtuel distant
|
||||
Comment[ia]=Monitor Virtual Remote
|
||||
|
||||
Reference in New Issue
Block a user