[sugar] [PATCH] screenshots hurt

Erik Garrison erik at laptop.org
Fri Sep 12 18:21:41 EDT 2008


Further revisions to the patches to cleanup the screenshot behavior in
Sugar.  Effects are as stated previously:

On Fri, Sep 05, 2008 at 01:31:54AM -0300, Erik Garrison wrote:
>   before, screenshots taken on these events:
>     - frame visibility
>     - tabbing start
>     - activity next tab
>     - activity previous tab
>     - zoom into activity view
>     - activity close (twice)
>
>   after, screenshots taken on these events:
>     - activity close (once)
>     - activity keep / save

 ... but I have resolved an issue noted by Eben:

    "I still think this is going to be doing the wrong thing about half
the time, as long as there is no check to be sure that the activity is
visible at the time the screenshot is taken. (There also seems to be no
avoiding the fact that the Frame will be in many of them...) I'd rather
have no preview than an incorrect one."  (quoted by C. Scott @
http://dev.laptop.org/ticket/8432)

I resolved this issue by adding functionality to the Activity class
defined in activity.py which processes visibility-notify-events from X
and sets a flag Activity._visibible to True when the window is in any
state but fully obscured.  This state is publicly accessible via
Activity.is_visible().

NB. I wanted to use the gtk.gdk.VISIBILITY_UNOBSCURED to trigger this,
as it would guarantee that the frame is not in the way of the window
when the screenshot is taken, but found that this inhibited taking the
screenshot if there was a palette of any kind drawn over top of the root
Activity window.

Comments?  Please test.  This is an 8.2 target (Greg has tagged it
'polish').

Erik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sugar-no_screen_shots.patch
Type: text/x-diff
Size: 2205 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080912/0955e3cf/attachment.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sugar-toolkit_screen_shots_cleanup+visibility_notify.patch
Type: text/x-diff
Size: 3723 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080912/0955e3cf/attachment-0001.patch 


More information about the Sugar mailing list