Ask / Submit
0

How to resolve an overlay error in release 3.1.0.11?

asked 2019-08-11 23:06:27 +0300

jsommer gravatar image

updated 2019-08-12 09:11:13 +0300

jovirkku gravatar image

My app uses an overlay that follows the approach of harbour-batteryoverlay and harbour-screentapshot. This doesn't work any more with Sailfish OS release 3.1.0.11. The log shows the following error:

[D] ViewHelper::showSettings:163 - show settings
[D] unknown:0 - Using Wayland-EGL
library "libgui.so" wasn't loaded and RTLD_NOLOAD prevented it

This is the code snipped of the showSettings method with a generic app name :

void ViewHelper::showSettings()
{
    qDebug() << "show settings";
    QDBusConnection::sessionBus().registerObject("/harbour/myapp/settings", this, 
        QDBusConnection::ExportScriptableSlots 
        | QDBusConnection::ExportScriptableSignals);

    qGuiApp->setApplicationName("MyApp Overlay Settings");
    qGuiApp->setApplicationDisplayName("MyApp Overlay Settings");

    settingsView = SailfishApp::createView();
    settingsView->setTitle("MyApp Overlay Settings");
    settingsView->rootContext()->setContextProperty("helper", this);
    settingsView->setSource(SailfishApp::pathTo("qml/settings.qml"));
    settingsView->showFullScreen();

    if (!overlayView) {
        QDBusConnection::sessionBus().connect("", "/harbour/myapp/overlay", 
            "harbour.myapp", "overlayRunning", this, SIGNAL(overlayRunning()));
    }

    QObject::connect(settingsView, SIGNAL(destroyed()), this, 
        SLOT(onSettingsDestroyed()));
    QObject::connect(settingsView, SIGNAL(closing(QQuickCloseEvent*)), this, 
        SLOT(onSettingsClosing(QQuickCloseEvent*)));
}

UPDATE

The overlay is running in the emulator, but not on an Jala Accione P target device. I also tried an Intext Aqua Fish device, that was migrated to a Jolla C device.

With the last one I have a pyotherside problem and had to add the related repository with ssu ar mer-tools first to be able to build and deploy the app. After a successfull deployment, the overlay works.

I found a discussion of the last year from Sailfish porters. The conclusion could be, that the hardware adaption of the Accione P device is buggy or some parts are missing. But the following test seem to falsify this thesis.

I installed the BatteryOverlay2 and Screentapshpt2 from the Harbour app stpre on the Accione P device. Both apps are working. So I concluded, that it could be a problem with the Kit and I installed the 3.0.1.11 target on the build server. But the same error occured.

Has someone an idea?

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-08-12 11:25:44 +0300

jsommer gravatar image

updated 2019-08-12 11:27:06 +0300

The problem was caused by different screen resolutions of the target devices. In the viewhelper.cpp class the methode showOverlay() sets the mouse region of the overlay. In my case it is a sidebar:

native->setWindowProperty(overlayView->handle(), QLatin1String("MOUSE_REGION"), QRegion(670, 1180, 40, 100));

Instead ob absolute values, I should take relative ones. So I tried to remove the line in viewhelper.cpp and call the method setMouseRegion(int x, int y, int w, int h) in my overlay.qml.

Item {
    id: root
    ...
    Item {
        id: rotationItem
        ...
        MouseArea {
            ...
            Component.onCompleted: {
                viewHelper.setMouseRegion(
                    rotationItem.width - configuration.touchWidth, 
                    rotationItem.y, 
                    configuration.touchWidth, 
                    rotationItem.height)
            }

This causes a crash of the app. I think I should set the appropiate values right in viewhelper.cpp. How can I read the creen width and height there? I'm not very familar with c++ programming for Qt.

edit flag offensive delete publish link more

Comments

check https://github.com/CODeRUS/harbour-screentapshot/blob/master/src/viewhelper.cpp there is no problem calling setTouchRegion when you need

coderus ( 2019-08-12 22:30:59 +0300 )edit

@coderus. Great project. Thanks. I use this method as quoted in my post. Unfortunately my app crashes by calling this method at this time. Maybe I have to call this methos somewhere else? Or I could get the screen resultion in the C++ class.

jsommer ( 2019-08-12 23:28:56 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2019-08-11 23:06:27 +0300

Seen: 193 times

Last updated: Aug 12