kwayland question

Damian Ivanov damianatorrpm at gmail.com
Wed Mar 6 07:48:48 GMT 2019


Hello,

I can't figure out what I'm doing wrong.
Any help would be appreciated.
I have attached an example but code is also below.
I try to set the example as Bottom Panel.
It is shown but it takes over the whole screen for its view strut
instead of just the height.

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    MainWindow w;
    w.show();
    using namespace KWayland::Client;

    ConnectionThread *connection = ConnectionThread::fromApplication(&app);
    if (!connection)
    {
        qDebug() << "no connection | x11?";
        //return; //else it crashes
    }
    Registry *registry = new Registry(&app);

    registry->create(connection);
    registry->setup();
    connection->roundtrip();

    PlasmaWindowManagement *m_pw = nullptr;
    m_pw = registry->createPlasmaWindowManagement(registry->interface(Registry::Interface::PlasmaWindowManagement).name,

registry->interface(Registry::Interface::PlasmaWindowManagement).version,
                                                  &app);
    const auto interface =
registry->interface(Registry::Interface::PlasmaShell);
    KWayland::Client::PlasmaShell *m_plasmaShell =
registry->createPlasmaShell(interface.name, interface.version, &app);

    Surface *surface =
Surface::fromQtWinId(qApp->allWindows().first()->winId());

    KWayland::Client::PlasmaShellSurface *m_plasmaShellSurface =
m_plasmaShell->createSurface(surface, &app);
    m_plasmaShellSurface->setSkipTaskbar(true);
    m_plasmaShellSurface->setSkipSwitcher(true);
    m_plasmaShellSurface->setRole(PlasmaShellSurface::Role::Panel);
    m_plasmaShellSurface->setPanelTakesFocus(false);

    m_plasmaShellSurface->setPanelBehavior(KWayland::Client::PlasmaShellSurface::PanelBehavior::AlwaysVisible);
    //1440 displayHeight
    //2160 displaywidth
    //WORKSFOR_LEFT height and width changed
//    m_plasmaShellSurface->setPosition(QPoint(0,0));
//    qApp->allWindows().first()->setX(0);
//    qApp->allWindows().first()->setY(0);
//    qApp->allWindows().first()->setWidth(100);
//    qApp->allWindows().first()->setHeight(2160);

    //WORKSFOR_TOP
//    m_plasmaShellSurface->setPosition(QPoint(0,0));
//    qApp->allWindows().first()->setX(0);
//    qApp->allWindows().first()->setY(0);
//    qApp->allWindows().first()->setWidth(2160);
//    qApp->allWindows().first()->setHeight(100);
    //DOESNTWORK_FOR_BOTTOM whole screen become strut and no window
    //can be placed on that screen anymore
    qApp->allWindows().first()->setX(0);
    qApp->allWindows().first()->setY(1340);
    qApp->allWindows().first()->setWidth(2160);
    qApp->allWindows().first()->setHeight(100);
    m_plasmaShellSurface->setPosition(QPoint(0,1340));

    return app.exec();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deletene.zip
Type: application/zip
Size: 6124 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190306/d75f7bd7/attachment-0001.zip>


More information about the Plasma-devel mailing list