[MeeGo-touch-dev] notifications from background daemon

Patrick Ohly patrick.ohly at intel.com
Mon Aug 9 12:27:12 PDT 2010


Hello!

First, my apologies if this is off-topic for the list. It is more about
using MTF than improving it. If there is a better place for asking such
questions, please point me in the right direction.

My task is to implement a background daemon running as part of a user
session which monitors KCalExtended calendars and alerts the user based
on alarms set for calendar events.

MNotification looked suitable, but I cannot get it to display anything.
Perhaps my chroot/Xephyr setup is at fault. I do get some error output:
[...]
Could not add child element to parent element because the types are incorrect.
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)
  Serial number of failed request:  334
  Current serial number in output stream:  338
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  8 (X_MapWindow)
  Resource id in failed request:  0x2c00033
  Serial number of failed request:  335
  Current serial number in output stream:  338
[...]
GetBuffersWithFormat fails
[...]

The display changes, but no notification appears. Instead it gets
blurred and remains like that, even after killing my app.

Before I dig deeper, let me verify that I use MNotification correctly:

int main(int argc, char **argv)
{
    AlarmApp app(argc, argv);

    MNotification *notification = new MNotification("email.arrived",
                                                    "hello world");
    notification->publish();
    delete notification;

    app.exec();
}

I picked an existing notification type, just in case that it matters.

Is deleting the MNotification instance acceptable? Documentation doesn't
say much about its life cycle. Keeping it around doesn't help.

Does MNotification work without MWindow?

I might very well be that a notification is too limited for calendar
events. So I also looked at MDialog. It looks like I'll need
libmeegotouch >= 0.20.27 with the fairly new setSystem() method to
display a non-modal system dialog. MeeGo Trunk currently has 0.20.25 and
there MDialog seems to require an existing application window. Will
setSystem() allow me to show a dialog in an app which doesn't have any
MWindow?

-- 
Best Regards

Patrick Ohly
Senior Software Engineer

Intel GmbH
Open Source Technology Center               
Pützstr. 5                              Phone: +49-228-2493652
53129 Bonn
Germany



More information about the MeeGo-touch-dev mailing list