kwayland question

Damian Ivanov <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin,gmane.comp.kde.devel.plasma
Message-ID <CAPVS_cdc_E2jOMekiCX=9mTXOWzc40u7ogDOFwb-C_JBNwsGHQ@mail.gmail.com>
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();
}
deletene.zip (application/zip, 6 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.