Re: anonymous gray activity circles

2009-01-04 Thread Mikus Grinbergs
 Here's a short code tour for your enjoyment.

Thank you very much, Michael.  This is very helpful.


Would it be possible for you (or someone else) to similarly 
enumerate the conditions under which 'anonymous gray activity 
circles' are made to disappear ?

I don't have difficulty with gray circles while activities are 
running (I can figure out which circle is which session) -- but it 
leaves an untidy impression when the session itself goes away, but 
the gray circle does not.  [In fact, I once saw so many leftover 
gray circles that the top bar of Frame showed arrowheads for the 
viewer to scroll back and forth within the ActivitiesTray.]

Maybe if I can understand *why* gray circles might persist, I might 
be able to think of a way to force leftover useless ones to go away. 
[I would guess a gray circle left behind by a defunct session 
could only be gotten rid of by restarting Sugar.]

mikus

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2009-01-04 Thread Wade Brainerd
Hey Michael,

Did you try applying Sayamindu's patch from the previous email (and did you
see the associated screenshot)?

I'm surprised it hasn't been cleaned up and pushed by the Sugar dev team by
now.

-Wade

On Sun, Jan 4, 2009 at 5:55 PM, Michael Stone mich...@laptop.org wrote:

 On Sat, Jan 03, 2009 at 02:23:41PM -0500, Chris Marshall wrote:
 Two specific questions come to mind:
 
 (1) How does Sugar know that a new top level
  window has been instantiated?  Is there a
  hook from the X server or what?

 Here's a short code tour for your enjoyment. I'll start by tracing
 backwards from what we know:

 1. Clone the sugar source code:

   git clone git://git.sugarlabs.org/sugar/mainline.git sugar

 2. We know that things including gray circles appear in the top part of
 the frame. What causes this?

   cd sugar
   find . -name '*frame*'
   # Inspiration!
   cd src/jarabe/frame

 3. Start reading files here looking for info about how the frame is
 constructed.

   Ah hah! We find out from src/jarabe/frame/frame.py that the frame
   consists of four panels.


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/frame/frame.py#line117

   What goes in the top panel? Read _create_top_panel():


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/frame/frame.py#line177

   Bingo! An ActivitiesTray()!

 4. Go find ActivitiesTray():

   First, search for ActivitiesTray. Find the import line at


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/frame/frame.py#line29

   Next, go read src/jarabe/frame/activitiestray.py looking for the
   definition of ActivitiesTray()


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/frame/activitiestray.py#line299

 5. Figure out what message causes the tray to add icons.

   Doesn't that __activity_added_cb() callback look suspicious?

   Let's figure out what causes self._home_model to generate
   'activity-added' signals.

 6. Track down self._home_model.

   Ah! In ActivitiesTray.__init__, we set it equal to shell.get_model().

   Where does the variable shell come from? From here:


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/frame/activitiestray.py#line39

 7. Track down 'get_model' in src/jarabe/model/shell.py


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/model/shell.py#line573

   So what's a ShellModel?

 8. Look more carefully at ShellModel.

   We find the definition of the 'activity-added' signal here:


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/model/shell.py#line282

   alongside several other tasty-sounding signals.

   ...

   Oooh, look at the __init__ method:


 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/model/shell.py#line310

   Doesn't that window-open signal sound interesting?

 9. Review.

   We've pretty much figured out the chain of events that results in the
   appearance of a new button on the frame's top panel's activities tray.

   Moreover, while we still don't really know why the buttons sometimes
   display gray circles vs activity icons or how to remove a button, we
   can be fairly sure that the answers lie close by, e.g.

   (where the gray circles come from:)

 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/frame/activitiestray.py#line67

   and back in jarabe.model.shell.ShellModel, which seems to be driving
   the show w.r.t. to the display and removal of items in the
   ActivitiesTray.

 10. Forward.

   The questions which remain include:

 a) What things are driving the ShellModel? Are they doing so
 correctly?

hint: nope. read

 http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/model/shell.py#line434

 http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt

(also, please help me get the ideas in the patches at the top of
  http://dev.laptop.org/git/users/mstone/sugar and
  http://dev.laptop.org/git/users/mstone/sugar-toolkit
merged which, while they won't solve your problem, may still be
generally useful.)

 b) What icon data should we be feeding into those buttons? Where
 does it come from?

hint: read
  http://standards.freedesktop.org/wm-spec/latest/

 http://standards.freedesktop.org/wm-spec/latest/ar01s05.html#id2569669
and start asking questions.

 Hope this helps,

 Michael
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2009-01-03 Thread Chris Marshall
Two specific questions come to mind:

(1) How does Sugar know that a new top level
 window has been instantiated?  Is there a
 hook from the X server or what?

(2) What sort of cleanup is needed to make
 the anonymous gray circle go away?  Do
 you have to notify Sugar or what?

I'm trying to implement some code that uses
OpenGL via the Mesa library on the XO.  As
the code re-generates display graphics, the
gray circles keep accumulating.  I would
like to keep the number of circles equal
to the number of actual top level windows
and not the total number used across the
session.

Thanks,
Chris

Tony Anderson wrote:
 I believe that these circles result from the activity initiating a new 
 top-level window. Sugar provides an activity with a window. It is 
 expected that the activity will pack it's widgets into a vbox in that 
 window. Imported activities naturally create a top-level window.
 
 Tony
 
 
 Message: 3
 Date: Tue, 30 Dec 2008 21:37:47 -0500
 From: Chris Marshall jns-cmarsh...@comcast.net
 Subject: Re: anonymous gray activity circles
 To: g...@laptop.org
 Cc: OLPC Development devel@lists.laptop.org
 Message-ID: 495adafb.40...@comcast.net
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Greg Smith wrote:
Hi Chris,
   
Unless someone else has seen this, I think we need more detail on 
 how to
reproduce it.
 
 os767 and Firefox-6 activity
 start firefox
 click on a file link to download
 exit firefox after
 left a gray circle
 
 (Actually, it almost always leaves behind one
 or more circles but I have not done exhaustive
 testing to determine how many or under what
 conditions.  It would be easier to start from
 an understanding of how the circle gets there
 to begin with (what is being used to trigger
 the circle's appearance)...
 
 --Chris
 
Can you write down the steps it takes to get a gray activity circle?
Include the version of XO software you are running:
http://wiki.laptop.org/go/What_release_am_I_running%3F
   
It may be that you are double clicking to start an activity. That can
cause a second activity instance to try and start then fail and leave an
icon in the frame. That's the only thing that comes to mind without more
detail.
   
Thanks,
   
Greg S
   
*
   
From: jns-cmarsh...@comcast.net
Subject: anonymous gray activity circles
To: devel@lists.laptop.org
   
Is there a way to prevent the
anonymous gray activity circles
in the frame?  Some X apps
seem to accumulate circles with
no way i have been able to
determine to remove dead ones.
I tried to google the list but was
not able to generate useful links.
   
--Chris
 
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.176 / Virus Database: 270.10.1/1870 - Release Date: 12/31/2008 
 8:44 AM
 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2009-01-03 Thread Tony Anderson
Compare:

http://laguna.fmedic.unam.mx/~daniel/pygtutorial/pygtutorial/getting-started.html

which creates a top-level window and

http://wiki.laptop.org/go/PyGTK/Hello_World_Tutorial

as a sugar activity.

The first has the line:

window = GtkWindow(WINDOW_TOPLEVEL) # create a top level window

while the latter has:

# Create the main container
self._main_view = gtk.VBox()

Sugar has already created the top-level window with an empty VBox, so 
the activity only needs to pack that VBox with widgets.

Essentially to eliminate the grey circle, you need to modify the 
initialization code (with the two tutorials as a guide).

Tony



Chris Marshall wrote:
 Two specific questions come to mind:
 
 (1) How does Sugar know that a new top level
 window has been instantiated?  Is there a
 hook from the X server or what?
 
 (2) What sort of cleanup is needed to make
 the anonymous gray circle go away?  Do
 you have to notify Sugar or what?
 
 I'm trying to implement some code that uses
 OpenGL via the Mesa library on the XO.  As
 the code re-generates display graphics, the
 gray circles keep accumulating.  I would
 like to keep the number of circles equal
 to the number of actual top level windows
 and not the total number used across the
 session.
 
 Thanks,
 Chris
 
 Tony Anderson wrote:
 I believe that these circles result from the activity initiating a new 
 top-level window. Sugar provides an activity with a window. It is 
 expected that the activity will pack it's widgets into a vbox in that 
 window. Imported activities naturally create a top-level window.

 Tony


 Message: 3
 Date: Tue, 30 Dec 2008 21:37:47 -0500
 From: Chris Marshall jns-cmarsh...@comcast.net
 Subject: Re: anonymous gray activity circles
 To: g...@laptop.org
 Cc: OLPC Development devel@lists.laptop.org
 Message-ID: 495adafb.40...@comcast.net
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 Greg Smith wrote:
Hi Chris,
   
Unless someone else has seen this, I think we need more detail on 
 how to
reproduce it.

 os767 and Firefox-6 activity
 start firefox
 click on a file link to download
 exit firefox after
 left a gray circle

 (Actually, it almost always leaves behind one
 or more circles but I have not done exhaustive
 testing to determine how many or under what
 conditions.  It would be easier to start from
 an understanding of how the circle gets there
 to begin with (what is being used to trigger
 the circle's appearance)...

 --Chris

Can you write down the steps it takes to get a gray activity 
 circle?
Include the version of XO software you are running:
http://wiki.laptop.org/go/What_release_am_I_running%3F
   
It may be that you are double clicking to start an activity. That 
 can
cause a second activity instance to try and start then fail and 
 leave an
icon in the frame. That's the only thing that comes to mind 
 without more
detail.
   
Thanks,
   
Greg S
   
*
   
From: jns-cmarsh...@comcast.net
Subject: anonymous gray activity circles
To: devel@lists.laptop.org
   
Is there a way to prevent the
anonymous gray activity circles
in the frame?  Some X apps
seem to accumulate circles with
no way i have been able to
determine to remove dead ones.
I tried to google the list but was
not able to generate useful links.
   
--Chris


 


 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 
 270.10.1/1870 - Release Date: 12/31/2008 8:44 AM

 
 
 .
 


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2009-01-03 Thread Chris Marshall
Thanks for the reply.  Unfortunately, I'm
not a python programmer so searching through
the source entails quite a learning curve...
Perhaps someone with real knowledge of the
internals can suggest an approach or more
specifics about where to look.

--Chris

Tony Anderson wrote:
 Hi,
 
 I didn't notice about your use of OpenGL. My remarks referred to GTK. 
 However, what I think is happening is that the application is creating a 
 new window. On non-sugar systems, they appear as separate windows. 
 However, in the case of Sugar, I think it is expected that application 
 will work in a single window. The result is in some sense 'undefined'.
 You will need to look at the source code and find where the source code 
 recreates a new window and change it to repaint the current window 
 (canvas?). Keep in mind I am reporting as an activity developer, not 
 from a real knowledge of the internals.
 
 Tony
 
 Chris Marshall wrote:
 Yes, but these are un-sugarized programs
 and they still generate gray circles.
 Doesn't that imply that window creation
 outside of sugar is being detected and
 acted upon?

 --Chris

 Tony Anderson wrote:
 Compare:

 http://laguna.fmedic.unam.mx/~daniel/pygtutorial/pygtutorial/getting-started.html
  


 which creates a top-level window and

 http://wiki.laptop.org/go/PyGTK/Hello_World_Tutorial

 as a sugar activity.

 The first has the line:

 window = GtkWindow(WINDOW_TOPLEVEL) # create a top level window

 while the latter has:

 # Create the main container
 self._main_view = gtk.VBox()

 Sugar has already created the top-level window with an empty VBox, so 
 the activity only needs to pack that VBox with widgets.

 Essentially to eliminate the grey circle, you need to modify the 
 initialization code (with the two tutorials as a guide).

 Tony



 Chris Marshall wrote:
 Two specific questions come to mind:

 (1) How does Sugar know that a new top level
 window has been instantiated?  Is there a
 hook from the X server or what?

 (2) What sort of cleanup is needed to make
 the anonymous gray circle go away?  Do
 you have to notify Sugar or what?

 I'm trying to implement some code that uses
 OpenGL via the Mesa library on the XO.  As
 the code re-generates display graphics, the
 gray circles keep accumulating.  I would
 like to keep the number of circles equal
 to the number of actual top level windows
 and not the total number used across the
 session.

 Thanks,
 Chris

 Tony Anderson wrote:
 I believe that these circles result from the activity initiating a 
 new top-level window. Sugar provides an activity with a window. It 
 is expected that the activity will pack it's widgets into a vbox in 
 that window. Imported activities naturally create a top-level window.

 Tony


 Message: 3
 Date: Tue, 30 Dec 2008 21:37:47 -0500
 From: Chris Marshall jns-cmarsh...@comcast.net
 Subject: Re: anonymous gray activity circles
 To: g...@laptop.org
 Cc: OLPC Development devel@lists.laptop.org
 Message-ID: 495adafb.40...@comcast.net
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 Greg Smith wrote:
Hi Chris,
   
Unless someone else has seen this, I think we need more detail 
 on how to
reproduce it.

 os767 and Firefox-6 activity
 start firefox
 click on a file link to download
 exit firefox after
 left a gray circle

 (Actually, it almost always leaves behind one
 or more circles but I have not done exhaustive
 testing to determine how many or under what
 conditions.  It would be easier to start from
 an understanding of how the circle gets there
 to begin with (what is being used to trigger
 the circle's appearance)...

 --Chris

Can you write down the steps it takes to get a gray activity 
 circle?
Include the version of XO software you are running:
http://wiki.laptop.org/go/What_release_am_I_running%3F
   
It may be that you are double clicking to start an activity. 
 That can
cause a second activity instance to try and start then fail 
 and leave an
icon in the frame. That's the only thing that comes to mind 
 without more
detail.
   
Thanks,
   
Greg S
   
*
   
From: jns-cmarsh...@comcast.net
Subject: anonymous gray activity circles
To: devel@lists.laptop.org
   
Is there a way to prevent the
anonymous gray activity circles
in the frame?  Some X apps
seem to accumulate circles with
no way i have been able to
determine to remove dead ones.
I tried to google the list but was
not able to generate useful links.
   
--Chris

 .

 
 
 
 
 
 No virus found in this incoming message.
 Checked by AVG - http://www.avg.com 
 Version: 8.0.176 / Virus Database: 270.10.2/1872 - Release Date: 1/2/2009 
 1:10 PM
 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2009-01-03 Thread Sayamindu Dasgupta
Vaguely related, I had did some work to avoid the gray circles: you
can see the result at:
http://dev.laptop.org/~sayamindu/standard_icons.png

The relevant patch (it needs some work) is at http://dev.laptop.org/ticket/8661

I'll resume work on it when I have some more time - in the meanwhile,
if anyone is enthusiastic enough, please feel free to take that patch
forward.

Thanks,
Sayamindu



On Sun, Jan 4, 2009 at 1:25 AM, Chris Marshall
jns-cmarsh...@comcast.net wrote:
 Yes, but these are un-sugarized programs
 and they still generate gray circles.
 Doesn't that imply that window creation
 outside of sugar is being detected and
 acted upon?

 --Chris

 Tony Anderson wrote:
 Compare:

 http://laguna.fmedic.unam.mx/~daniel/pygtutorial/pygtutorial/getting-started.html


 which creates a top-level window and

 http://wiki.laptop.org/go/PyGTK/Hello_World_Tutorial

 as a sugar activity.

 The first has the line:

 window = GtkWindow(WINDOW_TOPLEVEL) # create a top level window

 while the latter has:

 # Create the main container
 self._main_view = gtk.VBox()

 Sugar has already created the top-level window with an empty VBox, so
 the activity only needs to pack that VBox with widgets.

 Essentially to eliminate the grey circle, you need to modify the
 initialization code (with the two tutorials as a guide).

 Tony



 Chris Marshall wrote:
 Two specific questions come to mind:

 (1) How does Sugar know that a new top level
 window has been instantiated?  Is there a
 hook from the X server or what?

 (2) What sort of cleanup is needed to make
 the anonymous gray circle go away?  Do
 you have to notify Sugar or what?

 I'm trying to implement some code that uses
 OpenGL via the Mesa library on the XO.  As
 the code re-generates display graphics, the
 gray circles keep accumulating.  I would
 like to keep the number of circles equal
 to the number of actual top level windows
 and not the total number used across the
 session.

 Thanks,
 Chris

 Tony Anderson wrote:
 I believe that these circles result from the activity initiating a
 new top-level window. Sugar provides an activity with a window. It is
 expected that the activity will pack it's widgets into a vbox in that
 window. Imported activities naturally create a top-level window.

 Tony


 Message: 3
 Date: Tue, 30 Dec 2008 21:37:47 -0500
 From: Chris Marshall jns-cmarsh...@comcast.net
 Subject: Re: anonymous gray activity circles
 To: g...@laptop.org
 Cc: OLPC Development devel@lists.laptop.org
 Message-ID: 495adafb.40...@comcast.net
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 Greg Smith wrote:
Hi Chris,
   
Unless someone else has seen this, I think we need more detail
 on how to
reproduce it.

 os767 and Firefox-6 activity
 start firefox
 click on a file link to download
 exit firefox after
 left a gray circle

 (Actually, it almost always leaves behind one
 or more circles but I have not done exhaustive
 testing to determine how many or under what
 conditions.  It would be easier to start from
 an understanding of how the circle gets there
 to begin with (what is being used to trigger
 the circle's appearance)...

 --Chris

Can you write down the steps it takes to get a gray activity
 circle?
Include the version of XO software you are running:
http://wiki.laptop.org/go/What_release_am_I_running%3F
   
It may be that you are double clicking to start an activity.
 That can
cause a second activity instance to try and start then fail and
 leave an
icon in the frame. That's the only thing that comes to mind
 without more
detail.
   
Thanks,
   
Greg S
   
*
   
From: jns-cmarsh...@comcast.net
Subject: anonymous gray activity circles
To: devel@lists.laptop.org
   
Is there a way to prevent the
anonymous gray activity circles
in the frame?  Some X apps
seem to accumulate circles with
no way i have been able to
determine to remove dead ones.
I tried to google the list but was
not able to generate useful links.
   
--Chris
 ___
 Devel mailing list
 Devel@lists.laptop.org
 http://lists.laptop.org/listinfo/devel




-- 
Sayamindu Dasgupta
[http://sayamindu.randomink.org/ramblings]
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


re: anonymous gray activity circles

2008-12-30 Thread Greg Smith
Hi Chris,

Unless someone else has seen this, I think we need more detail on how to
reproduce it.

Can you write down the steps it takes to get a gray activity circle? 
Include the version of XO software you are running: 
http://wiki.laptop.org/go/What_release_am_I_running%3F

It may be that you are double clicking to start an activity. That can 
cause a second activity instance to try and start then fail and leave an 
icon in the frame. That's the only thing that comes to mind without more 
detail.

Thanks,

Greg S

*

From: jns-cmarsh...@comcast.net
Subject: anonymous gray activity circles
To: devel@lists.laptop.org

Is there a way to prevent the
anonymous gray activity circles
in the frame?  Some X apps
seem to accumulate circles with
no way i have been able to
determine to remove dead ones.
I tried to google the list but was
not able to generate useful links.

--Chris

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2008-12-30 Thread Bert Freudenberg
On 30.12.2008, at 15:19, Greg Smith wrote:

 Hi Chris,

 Unless someone else has seen this


Anyone who ever tried to run a non-sugarized application has seen this.

- Bert -

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2008-12-30 Thread Mikus Grinbergs
 Some X apps seem to accumulate circles with no way
 I have been able to determine to remove dead ones.

I happen to have sugarized Sonata.  [There appears to be some 
uncertainty in the launching of the mpd daemon that performs the 
actual playback.]  I do not mind the Sonata gray circle while the 
Activity is running.  On Joyride-2610, if I exit from Sonata by 
hovering on its gray circle in Frame, and clicking 'Stop' in the 
palette Frame shows me, the Activity seems to quit without leaving 
the gray circle behind.

But [probably depending on the state of the mpd daemon] if I exit 
from Sonata by clicking on the octagonal 'Stop sign' in the top bar, 
sometimes an anonymous gray activity circle gets left in Frame.

It would be nice if there were a way for an user to remove dead 
circles from Frame.

mikus

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: anonymous gray activity circles

2008-12-30 Thread Chris Marshall
Greg Smith wrote:
 Hi Chris,
 
 Unless someone else has seen this, I think we need more detail on how to
 reproduce it.

os767 and Firefox-6 activity
start firefox
click on a file link to download
exit firefox after
left a gray circle

(Actually, it almost always leaves behind one
or more circles but I have not done exhaustive
testing to determine how many or under what
conditions.  It would be easier to start from
an understanding of how the circle gets there
to begin with (what is being used to trigger
the circle's appearance)...

--Chris

 Can you write down the steps it takes to get a gray activity circle? 
 Include the version of XO software you are running: 
 http://wiki.laptop.org/go/What_release_am_I_running%3F
 
 It may be that you are double clicking to start an activity. That can 
 cause a second activity instance to try and start then fail and leave an 
 icon in the frame. That's the only thing that comes to mind without more 
 detail.
 
 Thanks,
 
 Greg S
 
 *
 
 From: jns-cmarsh...@comcast.net
 Subject: anonymous gray activity circles
 To: devel@lists.laptop.org
 
 Is there a way to prevent the
 anonymous gray activity circles
 in the frame?  Some X apps
 seem to accumulate circles with
 no way i have been able to
 determine to remove dead ones.
 I tried to google the list but was
 not able to generate useful links.
 
 --Chris
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel