Mageia Bugzilla – Attachment 11897 Details for
Bug 27291
[KDE Frameworks 5.74] New instance of QWidgets-based KDE apps (only on X11) starts in the last known position and size, overlapping the existing instance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Tentative mgarepo patch for a fix
kxmlgui-mga27291--mgarepo-svn--1.diff (text/plain), 5.19 KB, created by
Shlomi Fish
on 2020-10-02 21:32:36 CEST
(
hide
)
Description:
Tentative mgarepo patch for a fix
Filename:
MIME Type:
Creator:
Shlomi Fish
Created:
2020-10-02 21:32:36 CEST
Size:
5.19 KB
patch
obsolete
>Index: SOURCES/9.diff >=================================================================== >--- SOURCES/9.diff (nonexistent) >+++ SOURCES/9.diff (working copy) >@@ -0,0 +1,131 @@ >+--- kxmlgui-5.74.0/src/kmainwindow.cpp.mga27291 2020-09-06 13:39:38.000000000 +0300 >++++ kxmlgui-5.74.0/src/kmainwindow.cpp 2020-10-02 22:03:04.032641690 +0300 >+@@ -263,7 +263,6 @@ >+ //d->kaccel = actionCollection()->kaccel(); >+ settingsTimer = nullptr; >+ sizeTimer = nullptr; >+- positionTimer = nullptr; >+ >+ dockResizeListener = new DockResizeListener(_q); >+ letDirtySettings = true; >+@@ -403,19 +402,6 @@ >+ } >+ } >+ >+-void KMainWindowPrivate::setPositionDirty() >+-{ >+- if (autoSaveWindowSize) { >+- if (!positionTimer) { >+- positionTimer = new QTimer(q); >+- positionTimer->setInterval(500); >+- positionTimer->setSingleShot(true); >+- QObject::connect(positionTimer, SIGNAL(timeout()), q, SLOT(_k_slotSaveAutoSavePosition())); >+- } >+- positionTimer->start(); >+- } >+-} >+- >+ KMainWindow::~KMainWindow() >+ { >+ sMemberList()->removeAll(this); >+@@ -542,10 +528,6 @@ >+ d->sizeTimer->stop(); >+ d->_k_slotSaveAutoSaveSize(); >+ } >+- if (d->positionTimer && d->positionTimer->isActive()) { >+- d->positionTimer->stop(); >+- d->_k_slotSaveAutoSavePosition(); >+- } >+ >+ if (queryClose()) { >+ // widgets will start destroying themselves at this point and we don't >+@@ -600,7 +582,6 @@ >+ // Called by session management - or if we want to save the window size anyway >+ if (d->autoSaveWindowSize) { >+ KWindowConfig::saveWindowSize(windowHandle(), cg); >+- KWindowConfig::saveWindowPosition(windowHandle(), cg); >+ } >+ >+ // One day will need to save the version number, but for now, assume 0 >+@@ -793,10 +774,6 @@ >+ void KMainWindow::setAutoSaveSettings(const KConfigGroup &group, >+ bool saveWindowSize) >+ { >+- // We re making a little assumption that if you want to save the window >+- // size, you probably also want to save the window position too >+- // This avoids having to re-implement a new version of >+- // KMainWindow::setAutoSaveSettings that handles these cases independently >+ K_D(KMainWindow); >+ d->autoSaveSettings = true; >+ d->autoSaveGroup = group; >+@@ -805,9 +782,6 @@ >+ if (!saveWindowSize && d->sizeTimer) { >+ d->sizeTimer->stop(); >+ } >+- if (!saveWindowSize && d->positionTimer) { >+- d->sizeTimer->stop(); >+- } >+ >+ // Now read the previously saved settings >+ applyMainWindowSettings(d->autoSaveGroup); >+@@ -854,8 +828,9 @@ >+ { >+ K_D(KMainWindow); >+ switch (ev->type()) { >++#if defined(Q_OS_WIN) || defined(Q_OS_OSX) >+ case QEvent::Move: >+- d->setPositionDirty(); >++#endif >+ case QEvent::Resize: >+ d->setSizeDirty(); >+ break; >+@@ -936,13 +911,6 @@ >+ } >+ } >+ >+-void KMainWindowPrivate::_k_slotSaveAutoSavePosition() >+-{ >+- if (autoSaveGroup.isValid()) { >+- KWindowConfig::saveWindowPosition(q->windowHandle(), autoSaveGroup); >+- } >+-} >+- >+ KToolBar *KMainWindow::toolBar(const QString &name) >+ { >+ QString childName = name; >+--- kxmlgui-5.74.0/src/kmainwindow.h.mga27291 2020-09-06 13:39:38.000000000 +0300 >++++ kxmlgui-5.74.0/src/kmainwindow.h 2020-10-02 22:03:04.032641690 +0300 >+@@ -642,7 +642,6 @@ >+ private: >+ Q_PRIVATE_SLOT(k_func(), void _k_slotSettingsChanged(int)) >+ Q_PRIVATE_SLOT(k_func(), void _k_slotSaveAutoSaveSize()) >+- Q_PRIVATE_SLOT(k_func(), void _k_slotSaveAutoSavePosition()) >+ }; >+ >+ >+--- kxmlgui-5.74.0/src/kmainwindow_p.h.mga27291 2020-09-06 13:39:38.000000000 +0300 >++++ kxmlgui-5.74.0/src/kmainwindow_p.h 2020-10-02 22:03:04.032641690 +0300 >+@@ -36,7 +36,6 @@ >+ KConfigGroup autoSaveGroup; >+ QTimer *settingsTimer; >+ QTimer *sizeTimer; >+- QTimer *positionTimer; >+ QRect defaultWindowSize; >+ KHelpMenu *helpMenu; >+ KMainWindow *q; >+@@ -49,7 +48,6 @@ >+ // to be set on the already running applications. >+ void _k_slotSettingsChanged(int category); >+ void _k_slotSaveAutoSaveSize(); >+- void _k_slotSaveAutoSavePosition(); >+ >+ void init(KMainWindow *_q); >+ void polish(KMainWindow *q); >+@@ -59,7 +57,6 @@ >+ }; >+ void setSettingsDirty(CallCompression callCompression = NoCompressCalls); >+ void setSizeDirty(); >+- void setPositionDirty(); >+ }; >+ >+ class KMWSessionManager : public QObject >Index: SPECS/kxmlgui.spec >=================================================================== >--- SPECS/kxmlgui.spec (revision 1631880) >+++ SPECS/kxmlgui.spec (working copy) >@@ -6,6 +6,7 @@ > > %define url_ver %(echo %{version} | cut -d. -f1-2) > %define rel 1 >+%define subrel 1 > > Summary: KDE Frameworks 5 Tier 3 solution for generating UI > Name: kxmlgui >@@ -15,6 +16,8 @@ > Group: System/Base > URL: https://www.kde.org/ > Source0: https://download.kde.org/stable/frameworks/%{url_ver}/%{name}-%{version}.tar.xz >+# Patch1: https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/9.diff >+Patch1: 9.diff > > BuildRequires: kf5-macros > >@@ -106,6 +109,7 @@ > > %prep > %setup -q >+%patch1 -p1 -b .mga27291 > > %build > %cmake_kf5 -DSYSCONF_INSTALL_DIR="%_kf5_sysconfdir"
Index: SOURCES/9.diff =================================================================== --- SOURCES/9.diff (nonexistent) +++ SOURCES/9.diff (working copy) @@ -0,0 +1,131 @@ +--- kxmlgui-5.74.0/src/kmainwindow.cpp.mga27291 2020-09-06 13:39:38.000000000 +0300 ++++ kxmlgui-5.74.0/src/kmainwindow.cpp 2020-10-02 22:03:04.032641690 +0300 +@@ -263,7 +263,6 @@ + //d->kaccel = actionCollection()->kaccel(); + settingsTimer = nullptr; + sizeTimer = nullptr; +- positionTimer = nullptr; + + dockResizeListener = new DockResizeListener(_q); + letDirtySettings = true; +@@ -403,19 +402,6 @@ + } + } + +-void KMainWindowPrivate::setPositionDirty() +-{ +- if (autoSaveWindowSize) { +- if (!positionTimer) { +- positionTimer = new QTimer(q); +- positionTimer->setInterval(500); +- positionTimer->setSingleShot(true); +- QObject::connect(positionTimer, SIGNAL(timeout()), q, SLOT(_k_slotSaveAutoSavePosition())); +- } +- positionTimer->start(); +- } +-} +- + KMainWindow::~KMainWindow() + { + sMemberList()->removeAll(this); +@@ -542,10 +528,6 @@ + d->sizeTimer->stop(); + d->_k_slotSaveAutoSaveSize(); + } +- if (d->positionTimer && d->positionTimer->isActive()) { +- d->positionTimer->stop(); +- d->_k_slotSaveAutoSavePosition(); +- } + + if (queryClose()) { + // widgets will start destroying themselves at this point and we don't +@@ -600,7 +582,6 @@ + // Called by session management - or if we want to save the window size anyway + if (d->autoSaveWindowSize) { + KWindowConfig::saveWindowSize(windowHandle(), cg); +- KWindowConfig::saveWindowPosition(windowHandle(), cg); + } + + // One day will need to save the version number, but for now, assume 0 +@@ -793,10 +774,6 @@ + void KMainWindow::setAutoSaveSettings(const KConfigGroup &group, + bool saveWindowSize) + { +- // We re making a little assumption that if you want to save the window +- // size, you probably also want to save the window position too +- // This avoids having to re-implement a new version of +- // KMainWindow::setAutoSaveSettings that handles these cases independently + K_D(KMainWindow); + d->autoSaveSettings = true; + d->autoSaveGroup = group; +@@ -805,9 +782,6 @@ + if (!saveWindowSize && d->sizeTimer) { + d->sizeTimer->stop(); + } +- if (!saveWindowSize && d->positionTimer) { +- d->sizeTimer->stop(); +- } + + // Now read the previously saved settings + applyMainWindowSettings(d->autoSaveGroup); +@@ -854,8 +828,9 @@ + { + K_D(KMainWindow); + switch (ev->type()) { ++#if defined(Q_OS_WIN) || defined(Q_OS_OSX) + case QEvent::Move: +- d->setPositionDirty(); ++#endif + case QEvent::Resize: + d->setSizeDirty(); + break; +@@ -936,13 +911,6 @@ + } + } + +-void KMainWindowPrivate::_k_slotSaveAutoSavePosition() +-{ +- if (autoSaveGroup.isValid()) { +- KWindowConfig::saveWindowPosition(q->windowHandle(), autoSaveGroup); +- } +-} +- + KToolBar *KMainWindow::toolBar(const QString &name) + { + QString childName = name; +--- kxmlgui-5.74.0/src/kmainwindow.h.mga27291 2020-09-06 13:39:38.000000000 +0300 ++++ kxmlgui-5.74.0/src/kmainwindow.h 2020-10-02 22:03:04.032641690 +0300 +@@ -642,7 +642,6 @@ + private: + Q_PRIVATE_SLOT(k_func(), void _k_slotSettingsChanged(int)) + Q_PRIVATE_SLOT(k_func(), void _k_slotSaveAutoSaveSize()) +- Q_PRIVATE_SLOT(k_func(), void _k_slotSaveAutoSavePosition()) + }; + + +--- kxmlgui-5.74.0/src/kmainwindow_p.h.mga27291 2020-09-06 13:39:38.000000000 +0300 ++++ kxmlgui-5.74.0/src/kmainwindow_p.h 2020-10-02 22:03:04.032641690 +0300 +@@ -36,7 +36,6 @@ + KConfigGroup autoSaveGroup; + QTimer *settingsTimer; + QTimer *sizeTimer; +- QTimer *positionTimer; + QRect defaultWindowSize; + KHelpMenu *helpMenu; + KMainWindow *q; +@@ -49,7 +48,6 @@ + // to be set on the already running applications. + void _k_slotSettingsChanged(int category); + void _k_slotSaveAutoSaveSize(); +- void _k_slotSaveAutoSavePosition(); + + void init(KMainWindow *_q); + void polish(KMainWindow *q); +@@ -59,7 +57,6 @@ + }; + void setSettingsDirty(CallCompression callCompression = NoCompressCalls); + void setSizeDirty(); +- void setPositionDirty(); + }; + + class KMWSessionManager : public QObject Index: SPECS/kxmlgui.spec =================================================================== --- SPECS/kxmlgui.spec (revision 1631880) +++ SPECS/kxmlgui.spec (working copy) @@ -6,6 +6,7 @@ %define url_ver %(echo %{version} | cut -d. -f1-2) %define rel 1 +%define subrel 1 Summary: KDE Frameworks 5 Tier 3 solution for generating UI Name: kxmlgui @@ -15,6 +16,8 @@ Group: System/Base URL: https://www.kde.org/ Source0: https://download.kde.org/stable/frameworks/%{url_ver}/%{name}-%{version}.tar.xz +# Patch1: https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/9.diff +Patch1: 9.diff BuildRequires: kf5-macros @@ -106,6 +109,7 @@ %prep %setup -q +%patch1 -p1 -b .mga27291 %build %cmake_kf5 -DSYSCONF_INSTALL_DIR="%_kf5_sysconfdir"
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27291
: 11897