Hi Kimmo,

I have discovered what I was doing wrong. My applet IDs were invalid GConf keys, that's what caused the issue.
Thank you for helping me! :)

Timur

-----Original Message----- From: HämäläinenKimmo
Sent: Wednesday, October 13, 2010 11:56 AM
To: extKristófTimur
Cc: maemo-developers@maemo.org
Subject: Re: How to create homescreen widgets from a separate process?

On Tue, 2010-10-12 at 22:24 +0200, ext Kristóf Timur wrote:
Hi Kimmo,

Thank you very much for your answer.

It is good to know what the actual mechanism does, but so far I was unable
to tell Hildon-Desktop to even care about my applets. Basically what I do is create a window and set the appropriate X properties to make it a homescreen applet. As far as I understand, Hildon-Desktop uses gconf keys to store the positions and stuff of the applets (the applets coming from hildon-home and
the osso-abook-home-applet process also have gconf keys), but for reasons
beyond my understanding, these gconf keys don't get created for my applets.

What I really need is a way to tell HD "Hey, start caring about these
applets too!"
As far as I can see, creating a window and making it a homescreen widget is
not enough to achieve this. Maybe manually setting the appropriate gconf
keys would do the trick, but I'm not really sure about this either. Could
you please give me some clues about what I should do?

Please read the code! It's all there, see how hd_home_applet_init()
reads the GConf key based on the applet ID. So if you store the modified
time to this GConf key using the correct ID (the same being in your
window).  gconftool should allow you to change GConf keys.

-Kimmo


Cheers,
Timur

-----Original Message----- From: HämäläinenKimmo
Sent: Tuesday, October 12, 2010 5:07 PM
To: extKristófTimur
Cc: maemo-developers@maemo.org
Subject: Re: How to create homescreen widgets from a separate process?

On Mon, 2010-10-11 at 14:46 +0200, ext Kristóf Timur wrote:
> Hi guys,
>
> I have an interestion question. Been trying to figure it out for quite
> some
> time now, with limited success so far.
> I would like to have a way of creating homescreen widgets from inside a
> separate (non hildon-home) process. (For example, by clicking on a > button
> from inside an application, or something like this.)
> I was able to put together a solution which is able to do this, but as > it
> turns out, it ultimately fails on some important things. It is able to
> restore the previous position of the homescreen widgets after a restart,
> but
> it is ultimately flawed as it's unable to also restore the z-order of > the > widgets (the order in which the desktop widgets are stacked on top of > each
> other).
>
> As I see it, the osso-abook-home-applet is able to do just what I want. > It
> manages the contact widgets in its own process and is also able to
> remember
> the exact homescreen position and z-order of these widgets correctly.
> So, I'm curious about how the osso-abook-home-applet is able to do this.
> It
> is closed source so I can't look at its source code. I also think that
> libhildondesktop may hold the answers that I need, but unfortunately it > is
> largely undocumented, so I can't really figure this one out on my own.

The Z ordering happens in hildon-desktop, see
hd_home_view_restack_applets() in
http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/home/hd-home-view.c

It uses "modified time" to stack the most recent uppermost. That is
reset when ever tapping on an applet (see hd_home_view_applet_press()).

Perhaps if you look at the code, you can find a way to stack it up (e.g.
storing the modified time to GConf with your applet ID, or sending a
fake ButtonPress event).

-Kimmo

>
> If anyone has a clue about how to do this, I'd be more than happy if you
> guys could help me with this.
>
> Thanks,
> Timur Kristóf
> (Venemo)
>
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers


_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to