<br><br><div class="gmail_quote">On Thu, Oct 22, 2009 at 5:06 PM, Aniello Del Sorbo <span dir="ltr"><<a href="mailto:anidel@gmail.com">anidel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/10/22 Luca Donaggio <<a href="mailto:donaggio@gmail.com">donaggio@gmail.com</a>>:<br>
<div><div></div><div class="h5">> On Sat, Oct 17, 2009 at 1:03 PM, Cornelius Hald <<a href="mailto:hald@icandy.de">hald@icandy.de</a>> wrote:<br>
>><br>
>> On Sat, 2009-10-17 at 11:58 +0100, Aniello Del Sorbo wrote:<br>
>> ><br>
>> > My program doesn't ask anything when you close it, but it keeps<br>
>> > automatically saving the document in<br>
>> > a temporary file. Thus at every start it loads it up and you're back<br>
>> > where you left.<br>
>> > So I thought I would call the screenshot function at the very end,<br>
>> > while closing down the program.<br>
>> ><br>
>> > It didn't work. It didn't save the screenshot of what was there.<br>
>> ><br>
>> > So I call it when I receive the expose event (like in the example) and<br>
>> > it does work there.<br>
>> > Why is that?<br>
>> ><br>
>> > I still have to investigate it, but I thought the window would be<br>
>> > still available in my Quit function<br>
>> > when called from the destroy event.<br>
>><br>
>> I'm also calling it when quitting the application. I'm using the<br>
>> 'delete-event' on my main window. There I call it just before<br>
>> gtk_main_quit(). It's working for me...<br>
>><br>
>> Cheers!<br>
>> Conny<br>
>><br>
>><br>
>> _______________________________________________<br>
>> maemo-developers mailing list<br>
>> <a href="mailto:maemo-developers@maemo.org">maemo-developers@maemo.org</a><br>
>> <a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br>
><br>
> I'm resuming an old thread, sorry!<br>
><br>
> If I call hildon_gtk_window_take_screenshot() within the callback function<br>
> for the delete-event of the main app, just before gtk_main_quit(), it seems<br>
> that something has already happened to the main window: it complains that it<br>
> is not a GtkWindow (which usually is, as HildonWindow derives from it), but<br>
> a GdkWindow, and, of course, no screenshot were taken.<br>
><br>
> Luca Donaggio<br>
><br>
<br>
</div></div>I am doing the same and works, but then I was thinking that's it's<br>
probably best doing at the<br>
beginning, with a clean UI.<br>
<br>
I thought that doing it at the end, before closing it, would then fake<br>
a reload of the app in the state<br>
it was left when closing it.<br>
<br>
But this has an issue, which I think deserves thoughts:<br>
<br>
1) to really speed up things you should take the screenshot only once.<br>
2) if you do it at the end, before closing, for the reason above, then<br>
you've got to take the screenshot<br>
at every exit. This slows down the exit itself. And this is as much of<br>
an issue as the startup speed.<br>
<br>
Thus I thought I'll take the screenshot at the expose event and only<br>
take it if the file is not there already.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">anidel<br>
Sent from London, Eng, United Kingdom<br>
</div></div></blockquote></div><br>You're right, I moved the screenshot-taking process at the beginning too.<br>Where are the screenshots stored? Ie: which file I should check to determine if a screenshot has already been taken once?<br>
As a side fact: we should remove the existing screenshot when installing a new version of our apps, as their appearance could have changed and the stored screenshot could not reflect the current UI any more.<br><br>Luca Donaggio<br>