We have moved to a new Sailfish OS Forum. Please start new discussions there.

How to resolve an overlay error in release

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

jsommer gravatar image

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

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 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::ExportScriptableSignals);

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

    settingsView = SailfishApp::createView();
    settingsView->setTitle("MyApp Overlay Settings");
    settingsView->rootContext()->setContextProperty("helper", this);

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

    QObject::connect(settingsView, SIGNAL(destroyed()), this, 
    QObject::connect(settingsView, SIGNAL(closing(QQuickCloseEvent*)), this, 


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 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

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

jsommer gravatar image

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

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: {
                    rotationItem.width - configuration.touchWidth, 

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


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 +0200 )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 +0200 )edit
Login/Signup to Answer

Question tools



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

Seen: 253 times

Last updated: Aug 12 '19