Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plasma 6 compatibility #73

Open
guiodic opened this issue Jan 22, 2024 · 54 comments
Open

Plasma 6 compatibility #73

guiodic opened this issue Jan 22, 2024 · 54 comments

Comments

@guiodic
Copy link

guiodic commented Jan 22, 2024

Hi, is an update planned for Plasma 6?

Thank you!

@guiodic
Copy link
Author

guiodic commented Feb 28, 2024

Plasma 6 was released today. I hope this decoration can be updated to the new DE. Thank you!

@guiodic
Copy link
Author

guiodic commented Mar 14, 2024

Sorry, a gentle bump :)

@AntarEspadas
Copy link

I am also curious if an update is planned

@abolast
Copy link

abolast commented Mar 21, 2024

I regret not having learned C++. C++ is too difficult.
Similarly, this tool can improve my work efficiency.

@guiodic
Copy link
Author

guiodic commented Apr 2, 2024

I am seeing that @Zren is prioritizing widgets, I hope he has time for this decoration, much of the work I think has already been done. I really can't get by without the LIM!

@nicman23
Copy link

nicman23 commented Apr 9, 2024

I am independently working on it, I just need to figure out kconfig but it is so boring as I do not use the kconfig menu, as I always just changed the source code

@guiodic
Copy link
Author

guiodic commented Apr 9, 2024 via email

@guiodic
Copy link
Author

guiodic commented Apr 11, 2024

@nicman23 do you have any news? Is it possible to test the decoration?

@nicman23
Copy link

sorry guys it is a tough month, i might just upload whatever i have already done but yeah i have not worked at it at all

@guiodic
Copy link
Author

guiodic commented Apr 11, 2024

Thank you very much! I dont care kconfig for now, default options are ok for me, I will eventually change source code. Or, if present, the values in kwinrc.

@guiodic
Copy link
Author

guiodic commented Apr 15, 2024

@nicman23 sorry to bother you but... any news?

@nicman23
Copy link

sorry here is the wip code https://github.com/nicman23/material-decoration but still no progress since my first message

@guiodic
Copy link
Author

guiodic commented Apr 19, 2024

thank you. I tried to build it. I receive an error on qtdbusmenu so I tried commenting the line in cmake but then I receive another error on "FindQt.cmake".
Well, I will wait...

@Anarcraft
Copy link

On my test machine I don't see a package named "Qt6" which this would parse to:
find_package(QT NAMES Qt${QT_VERSION_MAJOR})
It may be the package named "Qt6-base".

@guiodic
Copy link
Author

guiodic commented Apr 19, 2024

On my test machine I don't see a package named "Qt6" which this would parse to: find_package(QT NAMES Qt${QT_VERSION_MAJOR}) It may be the package named "Qt6-base".

I presume "package" in cmake refers to QT internal names, not to the packages from the distribution.

@Anarcraft
Copy link

On my test machine I don't see a package named "Qt6" which this would parse to: find_package(QT NAMES Qt${QT_VERSION_MAJOR}) It may be the package named "Qt6-base".

I presume "package" in cmake refers to QT internal names, not to the packages from the distribution.

Oh, OK, I don't know much about cmake.

@guiodic
Copy link
Author

guiodic commented Apr 23, 2024

@nicman23 sorry to bother you again ...

@nicman23
Copy link

i ll take a crack at it if i have no work today

@nicman23
Copy link

nicman23 commented Apr 24, 2024

i did make it compile but it does not show up in system config. if at all possible @Zren could you take a look?

it is not buy any way ready - i have removed the configuration for now - but it should had worked (?)

just for reference it compiles with qt6 and kf6

@guiodic
Copy link
Author

guiodic commented Apr 24, 2024

thank you. I still receive this error:

CMake Error at /usr/lib/cmake/Qt6DBus/Qt6DBusMacros.cmake:64 (qt5_add_dbus_interface):
Unknown CMake command "qt5_add_dbus_interface".
Call Stack (most recent call first):
src/libdbusmenuqt/CMakeLists.txt:24 (qt_add_dbus_interface)

@guiodic
Copy link
Author

guiodic commented Apr 24, 2024

and if I comment the qt dbusmenu including in cmake, thei I receive this other error:
CMake Error at /usr/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2829 (message):
qt_generate_foreign_qml_types() is only available in Qt 6.
Call Stack (most recent call first):
/usr/lib/cmake/Qt6Qml/Qt6QmlConfig.cmake:145 (include)
/usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
/usr/lib/cmake/KF6Config/KF6ConfigConfig.cmake:53 (find_dependency)
/usr/share/ECM/find-modules/FindKF6.cmake:52 (find_package)
src/CMakeLists.txt:13 (find_package)

(I'm on Manjaro unstable, it's pretty the same of arch)

@guiodic
Copy link
Author

guiodic commented Apr 24, 2024

p.s. I use this command to build:
cmake -DCMAKE_INSTALL_PREFIX=/usr ..

@nicman23
Copy link

try cmake -DQT_MAJOR_VERSION=6 -DCMAKE_INSTALL_PREFIX=/usr ..

@guiodic
Copy link
Author

guiodic commented Apr 25, 2024

yes, it works! thank you! but it has not shadow

@guiodic
Copy link
Author

guiodic commented Apr 25, 2024

i tried to add this to kdecoration_materialrc

[Common]
MenuAlwaysShow=true
ShadowStrength=128

but the shadow doesn't show. Anyway the menu works

@nicman23
Copy link

nicman23 commented Apr 25, 2024

what? tf, it does not work on my machine :D

E: huh the .so is installed in the wrong folder. i do not care to look into it right now, i just did a

cp src/materialdecoration.so /usr/lib/qt6/plugins/org.kde.kdecoration2/

and it worked lol

@guiodic
Copy link
Author

guiodic commented Apr 26, 2024

@nicman23 I hope the shadows can be restored.

@nicman23
Copy link

i do not use them so probably eh maybe

@guiodic
Copy link
Author

guiodic commented Apr 27, 2024

i do not use them so probably eh maybe

Please 🙏🙏🙏

@guiodic
Copy link
Author

guiodic commented Apr 30, 2024

@nicman23 can you at least make some suggestions? I tried fiddling with the code but couldn't solve the shadow problem. Thank you!

@Zren some love for this bug? Thanks!

@guiodic
Copy link
Author

guiodic commented May 6, 2024

Sorry again @nicman23 ...

@guiodic
Copy link
Author

guiodic commented May 12, 2024

To restore shadows, in the Decoration.cc, line 567

if (!s_cachedShadow ---> if (s_cachedShadow

@guiodic
Copy link
Author

guiodic commented May 23, 2024

Is there any chance of this decoration being ported to Wayland?

@nicman23
Copy link

no

@guiodic
Copy link
Author

guiodic commented May 24, 2024

no

maybe @Zren ?

@nicman23
Copy link

no i mean it is currently not possible

@guiodic
Copy link
Author

guiodic commented May 24, 2024

no i mean it is currently not possible

Can you explain why? Thank you!

@HerrCraziDev
Copy link

no i mean it is currently not possible

Can you explain why? Thank you!

Because Wayland sucks. It's much more restrictive than X11.

Also, any progress on this ?

@guiodic
Copy link
Author

guiodic commented Jun 6, 2024

no i mean it is currently not possible

Can you explain why? Thank you!

Because Wayland sucks. It's much more restrictive than X11.

Also, any progress on this ?

I agree on Wayland sucks etc. but in this particular case I think there are no major problems, in fact the global menu and the menu button in the title bar work correctly (at least for QT apps, the GTK ones have a problem upstream)

@HerrCraziDev
Copy link

Damn I'll have to switch to Debian /s

@guiodic
Copy link
Author

guiodic commented Jan 15, 2025

@nicman23 hi, can you help me to solve the bug with libreoffice? #65

@HerrCraziDev
Copy link

I guess this is dead :'(

@guiodic
Copy link
Author

guiodic commented Jan 16, 2025

@HerrCraziDev

Hi, @nicman23 updated this to Plasma 6 and I made some little adjustment (restore shadows, remove deprecated functions). You can find it in my github: https://github.com/guiodic/material-decoration

I am trying to understand the problem. Perhaps it is related to the fact that the _KDE_NET_WM_APPMENU_OBJECT_PATH property changes.

In fact, if the gtk3 plugin of Libreoffice is used, the property in question does not change and the menu works correctly, updating.

@HerrCraziDev
Copy link

Ooh, awesome 😎 I will try it out asap tonight!

@guiodic
Copy link
Author

guiodic commented Jan 16, 2025

@HerrCraziDev If you have Arch or derivatives there is already a package
https://aur.archlinux.org/packages/material-kwin-decoration-git

@nicman23
Copy link

hey, nice! @guiodic, libreoffice and gtk apps in general never worked quite right with appmenu in general not just with the appmenu that the decoration uses. did you try libreoffice-qt?

@guiodic
Copy link
Author

guiodic commented Jan 16, 2025

hey, nice! @guiodic, libreoffice and gtk apps in general never worked quite right with appmenu in general not just with the appmenu that the decoration uses. did you try libreoffice-qt?

The problem is precisely with Libreoffice-qt. With gtk3 works just fine.
Perhaps it is related to the fact that the _KDE_NET_WM_APPMENU_OBJECT_PATH property changes.
This happens with QT (both 5 and 6, but also kf5 and kf6) whereas with gtk3 the property remains the same.

@guiodic
Copy link
Author

guiodic commented Jan 16, 2025

@nicman23 To give an example, open libreoffice starcenter (using qt5 or qt6), the menu appears. But if you start Writer from there, the menu either disappears (qt5) or the starcenter menu remains (qt6).

Using xprop I found that when you open Writer the _KDE_NET_WM_APPMENU_OBJECT_PATH property changes. Perhaps that is the problem.

@nicman23
Copy link

uh i remember i had issues with one of the versions but i guess i had them mixed up. to be honest, i really do not have time these weeks but i ll try to see what is up soon (tm)

@guiodic
Copy link
Author

guiodic commented Feb 2, 2025

uh i remember i had issues with one of the versions but i guess i had them mixed up. to be honest, i really do not have time these weeks but i ll try to see what is up soon (tm)

sorry to bother you... any news?

@guiodic
Copy link
Author

guiodic commented Feb 6, 2025

I obtained the result in this way:

void AppMenuModel::onX11WindowChanged(WId id)
{
    qApp->removeNativeEventFilter(this);
    if (m_winId.toUInt() == id) {
        qApp->installNativeEventFilter(this);
        m_delayedMenuWindowId = id;
    }
}

However, it does not seem efficient to me because it is called up every time the window changes (so even if I move it, it shrinks) and it also seems prone to memory leakage

@nicman23 do you have any suggestions?

@guiodic
Copy link
Author

guiodic commented Feb 7, 2025

Hi @nicman23

I modified lines 139-141 like this:

void (KX11Extras::*myWindowChangeSignal)(WId window, NET::Properties properties, NET::Properties2 properties2) = &KX11Extras::windowChanged;
connect(KX11Extras::self(), myWindowChangeSignal,
        this, [this](WId window, NET::Properties properties, NET::Properties2 properties2) {
            if (properties2 & NET::WM2AppMenuObjectPath) {
                qCDebug(category) << "WM2AppMenuObjectPath changed";
                QTimer::singleShot(50, this, &AppMenuModel::onWinIdChanged);
           }

But I see that the signal is triggered repeatedly (4-6 times) every time I open a window, which is why I put the QTimer, but it doesn't seem like an optimal solution. Do you have any idea why this happens? Please help me! Thanks!

@guiodic
Copy link
Author

guiodic commented Feb 7, 2025

@nicman23 I think I found a workaround, I accidentally turned it into a pull request on your repository, I actually wanted to make a pull request on my own.

Anyway if you can take a look at it and tell me what you think thanks!

nicman23#2

@nicman23
Copy link

nicman23 commented Feb 8, 2025

sorry guys I went with plasma 5 and almalinux. see you at 2032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants