diff options
Diffstat (limited to 'source/kde/kde/patch/libkscreen')
-rw-r--r-- | source/kde/kde/patch/libkscreen/7eb0390bf70fc7fb5a39bd501ffcc327a07c328a.patch | 240 | ||||
-rw-r--r-- | source/kde/kde/patch/libkscreen/cf0921f3fbde31cb94b9ccddcaba36da3a488483.patch | 219 |
2 files changed, 0 insertions, 459 deletions
diff --git a/source/kde/kde/patch/libkscreen/7eb0390bf70fc7fb5a39bd501ffcc327a07c328a.patch b/source/kde/kde/patch/libkscreen/7eb0390bf70fc7fb5a39bd501ffcc327a07c328a.patch deleted file mode 100644 index b0e5e7136..000000000 --- a/source/kde/kde/patch/libkscreen/7eb0390bf70fc7fb5a39bd501ffcc327a07c328a.patch +++ /dev/null @@ -1,240 +0,0 @@ -From 7eb0390bf70fc7fb5a39bd501ffcc327a07c328a Mon Sep 17 00:00:00 2001 -From: Ilya Pominov <ipominov@astralinux.ru> -Date: Thu, 23 Sep 2021 14:24:16 +0300 -Subject: [PATCH] XrandR: Fix impossibilty to change resolution in VirtualBox - -In VirtualBox KDE runs at low resolution, -and when you try to change the resolution through the "Screen Settings" -it returns to the original one again. -How to check: -- run KDE neon on VirtualBox -- change the resolution - -VirtualBox sets the hotplug_mode_update property, but its preferred mode -is always 800x600, and KScreen returns the resolution to 800x600. - -Now XRandRCrtc stores the timestamp of the last resolution change -request from backend, and the timestamp of the last config update from -X11. -If the changes were initiated by XRandR backend (i.e. 'timestamp of the -last config update from X11' less or equal 'last resolution change -request'), then the followPreferedMode flag in KScreenConfig is set to -false. - -BUG: 407058 ---- - backends/xcbeventlistener.cpp | 7 ++++++- - backends/xcbeventlistener.h | 2 +- - backends/xrandr/xrandr.cpp | 4 +++- - backends/xrandr/xrandr.h | 2 +- - backends/xrandr/xrandrconfig.cpp | 9 +++++++-- - backends/xrandr/xrandrcrtc.cpp | 23 +++++++++++++++++++++++ - backends/xrandr/xrandrcrtc.h | 7 +++++++ - backends/xrandr/xrandroutput.cpp | 2 +- - 8 files changed, 49 insertions(+), 7 deletions(-) - -diff --git a/backends/xcbeventlistener.cpp b/backends/xcbeventlistener.cpp -index dba81dc..4c3a527 100644 ---- a/backends/xcbeventlistener.cpp -+++ b/backends/xcbeventlistener.cpp -@@ -139,6 +139,8 @@ void XCBEventListener::handleScreenChange(xcb_generic_event_t *e) - } - - qCDebug(KSCREEN_XCB_HELPER) << "RRScreenChangeNotify"; -+ qCDebug(KSCREEN_XCB_HELPER) << "\tTimestamp: " << e2->timestamp; -+ qCDebug(KSCREEN_XCB_HELPER) << "\tConfig_timestamp: " << e2->config_timestamp; - qCDebug(KSCREEN_XCB_HELPER) << "\tWindow:" << e2->request_window; - qCDebug(KSCREEN_XCB_HELPER) << "\tRoot:" << e2->root; - qCDebug(KSCREEN_XCB_HELPER) << "\tRotation: " << rotationToString((xcb_randr_rotation_t)e2->rotation); -@@ -157,15 +159,17 @@ void XCBEventListener::handleXRandRNotify(xcb_generic_event_t *e) - if (randrEvent->subCode == XCB_RANDR_NOTIFY_CRTC_CHANGE) { - xcb_randr_crtc_change_t crtc = randrEvent->u.cc; - qCDebug(KSCREEN_XCB_HELPER) << "RRNotify_CrtcChange"; -+ qCDebug(KSCREEN_XCB_HELPER) << "\tTimestamp: " << crtc.timestamp; - qCDebug(KSCREEN_XCB_HELPER) << "\tCRTC: " << crtc.crtc; - qCDebug(KSCREEN_XCB_HELPER) << "\tMode: " << crtc.mode; - qCDebug(KSCREEN_XCB_HELPER) << "\tRotation: " << rotationToString((xcb_randr_rotation_t)crtc.rotation); - qCDebug(KSCREEN_XCB_HELPER) << "\tGeometry: " << crtc.x << crtc.y << crtc.width << crtc.height; -- Q_EMIT crtcChanged(crtc.crtc, crtc.mode, (xcb_randr_rotation_t)crtc.rotation, QRect(crtc.x, crtc.y, crtc.width, crtc.height)); -+ Q_EMIT crtcChanged(crtc.crtc, crtc.mode, (xcb_randr_rotation_t)crtc.rotation, QRect(crtc.x, crtc.y, crtc.width, crtc.height), crtc.timestamp); - - } else if (randrEvent->subCode == XCB_RANDR_NOTIFY_OUTPUT_CHANGE) { - xcb_randr_output_change_t output = randrEvent->u.oc; - qCDebug(KSCREEN_XCB_HELPER) << "RRNotify_OutputChange"; -+ qCDebug(KSCREEN_XCB_HELPER) << "\tTimestamp: " << output.timestamp; - qCDebug(KSCREEN_XCB_HELPER) << "\tOutput: " << output.output; - qCDebug(KSCREEN_XCB_HELPER) << "\tCRTC: " << output.crtc; - qCDebug(KSCREEN_XCB_HELPER) << "\tMode: " << output.mode; -@@ -181,6 +185,7 @@ void XCBEventListener::handleXRandRNotify(xcb_generic_event_t *e) - xcb_get_atom_name_reply(QX11Info::connection(), xcb_get_atom_name(QX11Info::connection(), property.atom), nullptr)); - - qCDebug(KSCREEN_XCB_HELPER) << "RRNotify_OutputProperty (ignored)"; -+ qCDebug(KSCREEN_XCB_HELPER) << "\tTimestamp: " << property.timestamp; - qCDebug(KSCREEN_XCB_HELPER) << "\tOutput: " << property.output; - qCDebug(KSCREEN_XCB_HELPER) << "\tProperty: " << xcb_get_atom_name_name(reply.data()); - qCDebug(KSCREEN_XCB_HELPER) << "\tState (newValue, Deleted): " << property.status; -diff --git a/backends/xcbeventlistener.h b/backends/xcbeventlistener.h -index 35577d9..68136d8 100644 ---- a/backends/xcbeventlistener.h -+++ b/backends/xcbeventlistener.h -@@ -30,7 +30,7 @@ Q_SIGNALS: - void outputsChanged(); - - /* Emitted only when XRandR 1.2 or newer is available */ -- void crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, const QRect &geom); -+ void crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, const QRect &geom, xcb_timestamp_t timestamp); - void outputChanged(xcb_randr_output_t output, xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_connection_t connection); - void outputPropertyChanged(xcb_randr_output_t output); - -diff --git a/backends/xrandr/xrandr.cpp b/backends/xrandr/xrandr.cpp -index 71cbd77..115f268 100644 ---- a/backends/xrandr/xrandr.cpp -+++ b/backends/xrandr/xrandr.cpp -@@ -45,6 +45,7 @@ XRandR::XRandR() - qRegisterMetaType<xcb_randr_mode_t>("xcb_randr_mode_t"); - qRegisterMetaType<xcb_randr_connection_t>("xcb_randr_connection_t"); - qRegisterMetaType<xcb_randr_rotation_t>("xcb_randr_rotation_t"); -+ qRegisterMetaType<xcb_timestamp_t>("xcb_timestamp_t"); - - // Use our own connection to make sure that we won't mess up Qt's connection - // if something goes wrong on our side. -@@ -143,7 +144,7 @@ void XRandR::outputChanged(xcb_randr_output_t output, xcb_randr_crtc_t crtc, xcb - qCDebug(KSCREEN_XRANDR) << "Output" << xOutput->id() << ": connected =" << xOutput->isConnected() << ", enabled =" << xOutput->isEnabled(); - } - --void XRandR::crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, const QRect &geom) -+void XRandR::crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, const QRect &geom, xcb_timestamp_t timestamp) - { - XRandRCrtc *xCrtc = s_internalConfig->crtc(crtc); - if (!xCrtc) { -@@ -152,6 +153,7 @@ void XRandR::crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr - xCrtc->update(mode, rotation, geom); - } - -+ xCrtc->updateConfigTimestamp(timestamp); - m_configChangeCompressor->start(); - } - -diff --git a/backends/xrandr/xrandr.h b/backends/xrandr/xrandr.h -index 91dd7aa..6b998c8 100644 ---- a/backends/xrandr/xrandr.h -+++ b/backends/xrandr/xrandr.h -@@ -44,7 +44,7 @@ public: - - private: - void outputChanged(xcb_randr_output_t output, xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_connection_t connection); -- void crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, const QRect &geom); -+ void crtcChanged(xcb_randr_crtc_t crtc, xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, const QRect &geom, xcb_timestamp_t timestamp); - void screenChanged(xcb_randr_rotation_t rotation, const QSize &sizePx, const QSize &sizeMm); - - static quint8 *getXProperty(xcb_randr_output_t output, xcb_atom_t atom, size_t &len); -diff --git a/backends/xrandr/xrandrconfig.cpp b/backends/xrandr/xrandrconfig.cpp -index fa0929c..5cbf4c7 100644 ---- a/backends/xrandr/xrandrconfig.cpp -+++ b/backends/xrandr/xrandrconfig.cpp -@@ -504,6 +504,8 @@ bool XRandRConfig::disableOutput(const OutputPtr &kscreenOutput) const - XCB_NONE, - xOutput->isConnected() ? XCB_RANDR_CONNECTION_CONNECTED : XCB_RANDR_CONNECTION_DISCONNECTED, - kscreenOutput->isPrimary()); -+ if (xOutput->crtc()) -+ xOutput->crtc()->updateTimestamp(reply->timestamp); - } - return (reply->status == XCB_RANDR_SET_CONFIG_SUCCESS); - } -@@ -573,7 +575,7 @@ bool XRandRConfig::changeOutput(const KScreen::OutputPtr &kscreenOutput) const - << "\n" - << "\tCRTC:" << xOutput->crtc()->crtc() << "\n" - << "\tPos:" << kscreenOutput->pos() << "\n" -- << "\tMode:" << modeId << kscreenOutput->currentMode() << "\n" -+ << "\tMode:" << kscreenOutput->currentMode() << "Preferred:" << kscreenOutput->preferredModeId() << "\n" - << "\tRotation:" << kscreenOutput->rotation(); - - if (!sendConfig(kscreenOutput, xOutput->crtc())) { -@@ -605,6 +607,9 @@ bool XRandRConfig::sendConfig(const KScreen::OutputPtr &kscreenOutput, XRandRCrt - qCDebug(KSCREEN_XRANDR) << "\tResult: unknown (error)"; - return false; - } -- qCDebug(KSCREEN_XRANDR) << "\tResult: " << reply->status; -+ -+ crtc->updateTimestamp(reply->timestamp); -+ -+ qCDebug(KSCREEN_XRANDR) << "\tResult: " << reply->status << " timestamp: " << reply->timestamp; - return (reply->status == XCB_RANDR_SET_CONFIG_SUCCESS); - } -diff --git a/backends/xrandr/xrandrcrtc.cpp b/backends/xrandr/xrandrcrtc.cpp -index c3cd291..9209501 100644 ---- a/backends/xrandr/xrandrcrtc.cpp -+++ b/backends/xrandr/xrandrcrtc.cpp -@@ -16,6 +16,8 @@ XRandRCrtc::XRandRCrtc(xcb_randr_crtc_t crtc, XRandRConfig *config) - , m_crtc(crtc) - , m_mode(0) - , m_rotation(XCB_RANDR_ROTATION_ROTATE_0) -+ , m_timestamp(XCB_CURRENT_TIME) -+ , m_configTimestamp(XCB_CURRENT_TIME) - { - update(); - } -@@ -111,3 +113,24 @@ void XRandRCrtc::update(xcb_randr_mode_t mode, xcb_randr_rotation_t rotation, co - m_geometry = geom; - m_rotation = rotation; - } -+ -+void XRandRCrtc::updateTimestamp(const xcb_timestamp_t tmstamp) -+{ -+ if (tmstamp > m_timestamp) { -+ qCDebug(KSCREEN_XRANDR) << "XRandRCrtc " << m_crtc << " m_timestamp update " << m_timestamp << " => " << tmstamp; -+ m_timestamp = tmstamp; -+ } -+} -+ -+void XRandRCrtc::updateConfigTimestamp(const xcb_timestamp_t tmstamp) -+{ -+ if (tmstamp > m_configTimestamp) { -+ qCDebug(KSCREEN_XRANDR) << "XRandRCrtc " << m_crtc << " m_configTimestamp update" << m_configTimestamp << " => " << tmstamp; -+ m_configTimestamp = tmstamp; -+ } -+} -+ -+bool XRandRCrtc::isChangedFromOutside() const -+{ -+ return m_configTimestamp > m_timestamp; -+} -diff --git a/backends/xrandr/xrandrcrtc.h b/backends/xrandr/xrandrcrtc.h -index 4de4a09..8be23d2 100644 ---- a/backends/xrandr/xrandrcrtc.h -+++ b/backends/xrandr/xrandrcrtc.h -@@ -41,6 +41,10 @@ public: - void update(); - void update(xcb_randr_crtc_t mode, xcb_randr_rotation_t rotation, const QRect &geom); - -+ void updateTimestamp(const xcb_timestamp_t tmstamp); -+ void updateConfigTimestamp(const xcb_timestamp_t tmstamp); -+ bool isChangedFromOutside() const; -+ - private: - xcb_randr_crtc_t m_crtc; - xcb_randr_mode_t m_mode; -@@ -50,4 +54,7 @@ private: - - QVector<xcb_randr_output_t> m_possibleOutputs; - QVector<xcb_randr_output_t> m_outputs; -+ -+ xcb_timestamp_t m_timestamp; -+ xcb_timestamp_t m_configTimestamp; - }; -diff --git a/backends/xrandr/xrandroutput.cpp b/backends/xrandr/xrandroutput.cpp -index 92a39cf..4aa2290 100644 ---- a/backends/xrandr/xrandroutput.cpp -+++ b/backends/xrandr/xrandroutput.cpp -@@ -403,7 +403,7 @@ KScreen::OutputPtr XRandROutput::toKScreenOutput() const - - // See https://bugzilla.redhat.com/show_bug.cgi?id=1290586 - // QXL will be creating a new mode we need to jump to every time the display is resized -- kscreenOutput->setFollowPreferredMode(m_hotplugModeUpdate); -+ kscreenOutput->setFollowPreferredMode(m_hotplugModeUpdate && m_crtc && m_crtc->isChangedFromOutside()); - - kscreenOutput->setConnected(isConnected()); - if (isConnected()) { --- -GitLab - diff --git a/source/kde/kde/patch/libkscreen/cf0921f3fbde31cb94b9ccddcaba36da3a488483.patch b/source/kde/kde/patch/libkscreen/cf0921f3fbde31cb94b9ccddcaba36da3a488483.patch deleted file mode 100644 index 38e932be9..000000000 --- a/source/kde/kde/patch/libkscreen/cf0921f3fbde31cb94b9ccddcaba36da3a488483.patch +++ /dev/null @@ -1,219 +0,0 @@ -From cf0921f3fbde31cb94b9ccddcaba36da3a488483 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven29@gmail.com> -Date: Thu, 2 Dec 2021 16:04:20 +0000 -Subject: [PATCH] Under X11 ignore per-screen scale to compute logicalSize - ---- - src/config.cpp | 32 ++++++++++++++++++++++++++++++++ - src/config.h | 4 ++++ - src/output.cpp | 39 +++++++++------------------------------ - src/output.h | 18 ++++-------------- - 4 files changed, 49 insertions(+), 44 deletions(-) - mode change 100644 => 100755 src/output.h - -diff --git a/src/config.cpp b/src/config.cpp -index 37e1038..41abf70 100644 ---- a/src/config.cpp -+++ b/src/config.cpp -@@ -325,6 +325,7 @@ void Config::setPrimaryOutput(const OutputPtr &newPrimary) - void Config::addOutput(const OutputPtr &output) - { - d->outputs.insert(output->id(), output); -+ output->setExplicitLogicalSize(logicalSizeForOutput(*output)); - connect(output.data(), &KScreen::Output::isPrimaryChanged, d, &KScreen::Config::Private::onPrimaryOutputChanged); - - Q_EMIT outputAdded(output); -@@ -391,6 +392,37 @@ void Config::apply(const ConfigPtr &other) - setValid(other->isValid()); - } - -+QRect Config::outputGeometryForOutput(const KScreen::Output &output) const -+{ -+ QSize size = logicalSizeForOutput(output).toSize(); -+ if (!size.isValid()) { -+ return QRect(); -+ } -+ -+ return QRect(output.pos(), size); -+} -+ -+QSizeF Config::logicalSizeForOutput(const KScreen::Output &output) const -+{ -+ QSizeF size = output.enforcedModeSize(); -+ if (!size.isValid()) { -+ return QSizeF(); -+ } -+ // ignore scale where scaling is not per-output -+ if (supportedFeatures().testFlag(Feature::PerOutputScaling)) { -+ size = size / output.scale(); -+ } -+ -+ // We can't use output.size(), because it does not reflect the actual rotation() set by caller. -+ // It is only updated when we get update from KScreen, but not when user changes mode or -+ // rotation manually. -+ -+ if (!output.isHorizontal()) { -+ size = size.transposed(); -+ } -+ return size; -+} -+ - QDebug operator<<(QDebug dbg, const KScreen::ConfigPtr &config) - { - if (config) { -diff --git a/src/config.h b/src/config.h -index 551d7d0..4629dab 100644 ---- a/src/config.h -+++ b/src/config.h -@@ -190,6 +190,10 @@ public: - */ - void setTabletModeEngaged(bool engaged); - -+ QRect outputGeometryForOutput(const KScreen::Output &output) const; -+ -+ QSizeF logicalSizeForOutput(const KScreen::Output &output) const; -+ - Q_SIGNALS: - void outputAdded(const KScreen::OutputPtr &output); - void outputRemoved(int outputId); -diff --git a/src/output.cpp b/src/output.cpp -index c7f5949..a0fae28 100644 ---- a/src/output.cpp -+++ b/src/output.cpp -@@ -13,6 +13,7 @@ - #include "mode.h" - - #include <QCryptographicHash> -+#include <QGuiApplication> - #include <QRect> - #include <QScopedPointer> - #include <QStringList> -@@ -28,7 +29,7 @@ public: - , replicationSource(0) - , rotation(None) - , scale(1.0) -- , logicalSize(QSizeF()) -+ , explicitLogicalSize(QSizeF()) - , connected(false) - , enabled(false) - , primary(false) -@@ -87,7 +88,7 @@ public: - QSize size; - Rotation rotation; - qreal scale; -- QSizeF logicalSize; -+ QSizeF explicitLogicalSize; - bool connected; - bool enabled; - bool primary; -@@ -459,40 +460,18 @@ void Output::setScale(qreal factor) - Q_EMIT scaleChanged(); - } - --QSizeF Output::logicalSize() const --{ -- if (d->logicalSize.isValid()) { -- return d->logicalSize; -- } -- -- QSizeF size = enforcedModeSize(); -- if (!size.isValid()) { -- return QSizeF(); -- } -- size = size / d->scale; -- -- // We can't use d->size, because d->size does not reflect the actual rotation() set by caller. -- // It is only updated when we get update from KScreen, but not when user changes mode or -- // rotation manually. -- -- if (!isHorizontal()) { -- size = size.transposed(); -- } -- return size; --} -- - QSizeF Output::explicitLogicalSize() const - { -- return d->logicalSize; -+ return d->explicitLogicalSize; - } - --void Output::setLogicalSize(const QSizeF &size) -+void Output::setExplicitLogicalSize(const QSizeF &size) - { -- if (qFuzzyCompare(d->logicalSize.width(), size.width()) && qFuzzyCompare(d->logicalSize.height(), size.height())) { -+ if (qFuzzyCompare(d->explicitLogicalSize.width(), size.width()) && qFuzzyCompare(d->explicitLogicalSize.height(), size.height())) { - return; - } -- d->logicalSize = size; -- Q_EMIT logicalSizeChanged(); -+ d->explicitLogicalSize = size; -+ Q_EMIT explicitLogicalSizeChanged(); - } - - bool Output::isConnected() const -@@ -628,7 +607,7 @@ QSize Output::enforcedModeSize() const - - QRect Output::geometry() const - { -- QSize size = logicalSize().toSize(); -+ QSize size = explicitLogicalSize().toSize(); - if (!size.isValid()) { - return QRect(); - } -diff --git a/src/output.h b/src/output.h -old mode 100644 -new mode 100755 -index 2b23ac4..7edb74c ---- a/src/output.h -+++ b/src/output.h -@@ -47,7 +47,7 @@ public: - Q_PROPERTY(QSize sizeMm READ sizeMm CONSTANT) - Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) - Q_PROPERTY(bool followPreferredMode READ followPreferredMode WRITE setFollowPreferredMode NOTIFY followPreferredModeChanged) -- Q_PROPERTY(QSizeF logicalSize READ logicalSize WRITE setLogicalSize NOTIFY logicalSizeChanged) -+ Q_PROPERTY(QSizeF explicitLogicalSize READ explicitLogicalSize WRITE setExplicitLogicalSize NOTIFY explicitLogicalSizeChanged) - Q_PROPERTY(Capabilities capabilities READ capabilities NOTIFY capabilitiesChanged) - Q_PROPERTY(uint32_t overscan READ overscan WRITE setOverscan NOTIFY overscanChanged) - Q_PROPERTY(VrrPolicy vrrPolicy READ vrrPolicy WRITE setVrrPolicy NOTIFY vrrPolicyChanged) -@@ -311,16 +311,6 @@ public: - */ - void setScale(qreal factor); - -- /** -- * The logical size is the output's representation internal to the display server and its -- * overall screen geometry. -- * -- * returns the logical size of this output -- * -- * @since 5.18 -- */ -- QSizeF logicalSize() const; -- - /** - * The logical size is the output's representation internal to the display server and its - * overall screen geometry. -@@ -338,9 +328,9 @@ public: - * - * @param size of this output in logical space - * -- * @since 5.18 -+ * @since 5.24 - */ -- void setLogicalSize(const QSizeF &size); -+ void setExplicitLogicalSize(const QSizeF &size); - - /** - * @returns whether the mode should be changed to the new preferred mode -@@ -421,7 +411,7 @@ Q_SIGNALS: - void clonesChanged(); - void replicationSourceChanged(); - void scaleChanged(); -- void logicalSizeChanged(); -+ void explicitLogicalSizeChanged(); - void followPreferredModeChanged(bool followPreferredMode); - void capabilitiesChanged(); - void overscanChanged(); --- -GitLab - |