Bug 418559 - QRegion is not registered to DBus
Summary: QRegion is not registered to DBus
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-06 20:18 UTC by Michail Vourlakos
Modified: 2020-03-07 08:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michail Vourlakos 2020-03-06 20:18:25 UTC
SUMMARY

In master version the setAvailableScreenRegion is not working and fails with message:

QDBusMarshaller: type `QRegion' (72) is not registered with D-BUS. Use qDBusRegisterMetaType to register it

STEPS TO REPRODUCE
1. Run Latte with latte-dock -d
2. observe the Latte output that the previous message is appearing and informs that the QDBus setAvailableScreenRegion is not applied



SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.18.1
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 trmdi 2020-03-07 02:14:04 UTC
That method wants a QList<QRect> argument, not a QRegion one. You have to convert QRegion to QList<QRect>.
See: https://phabricator.kde.org/source/plasma-workspace/browse/master/shell/strutmanager.cpp;38757fb52d81ff4bb3a923ff1d3dc4f512095a0c$87
Comment 2 Michail Vourlakos 2020-03-07 05:50:36 UTC
Git commit a7f786d87f1df4fd5a083175839e73c2ab519624 by Michail Vourlakos.
Committed on 07/03/2020 at 05:47.
Pushed by mvourlakos into branch 'master'.

change QRegion to QList for dbus plasma call

--change how dbus arguments are sent to Plasma
and a QList arguments for this

M  +18   -2    app/plasma/extended/screengeometries.cpp

https://commits.kde.org/latte-dock/a7f786d87f1df4fd5a083175839e73c2ab519624
Comment 3 Michail Vourlakos 2020-03-07 05:52:10 UTC
(In reply to trmdi from comment #1)
> That method wants a QList<QRect> argument, not a QRegion one. You have to
> convert QRegion to QList<QRect>.
> See:
> https://phabricator.kde.org/source/plasma-workspace/browse/master/shell/
> strutmanager.cpp;38757fb52d81ff4bb3a923ff1d3dc4f512095a0c$87

Can you please check that everything is fine with https://phabricator.kde.org/source/latte-dock/browse/master/app/plasma/extended/screengeometries.cpp$95 , how it sends the dbus data to plasma ?
Comment 4 trmdi 2020-03-07 08:04:34 UTC
(In reply to Michail Vourlakos from comment #3)
> (In reply to trmdi from comment #1)
> > That method wants a QList<QRect> argument, not a QRegion one. You have to
> > convert QRegion to QList<QRect>.
> > See:
> > https://phabricator.kde.org/source/plasma-workspace/browse/master/shell/
> > strutmanager.cpp;38757fb52d81ff4bb3a923ff1d3dc4f512095a0c$87
> 
> Can you please check that everything is fine with
> https://phabricator.kde.org/source/latte-dock/browse/master/app/plasma/
> extended/screengeometries.cpp$95 , how it sends the dbus data to plasma ?

With this commit, plasmashell doesn't get the data.

I think you could revert this commit, then do like this:

1, add qDBusRegisterMetaType<QList<QRect>>() in the init method.
2, Modify that part like this:
>                  m_lastAvailableRegion[scrName] = availableRegion;
>                   QList<QRect> rects;
>                   foreach (const QRect &rect, availableRegion) {
>                       rects << rect;
>                   }
>                   plasmaStrutsIface.call("setAvailableScreenRegion", LATTESERVICE, scrName, QVariant::fromValue(rects));
>                   qDebug() << " PLASMA SCREEN GEOMETRIES AVAILABLE REGION :: " << screen->name() << " : " << availableRegion;
Comment 5 Michail Vourlakos 2020-03-07 08:21:52 UTC
Git commit f31cc660b4dfdec4c64d0f269f43366a0ea8b2b2 by Michail Vourlakos.
Committed on 07/03/2020 at 08:20.
Pushed by mvourlakos into branch 'master'.

send QRegion through dbus as QList<QRect>

M  +10   -1    app/plasma/extended/screengeometries.cpp

https://commits.kde.org/latte-dock/f31cc660b4dfdec4c64d0f269f43366a0ea8b2b2