WindowManager & milti-proc UI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

WindowManager & milti-proc UI

Bruce Badger
I'm seeking milti-proc UI wisdom.

I am working on a system that started life ~VW2.x, and is now running
in VW7.3.1.  The system was not built with a multi-proc UI in mind,
and we are seeing some odd behavior.

Reading the GUI Devlopers Guide (really, I did) I see in the "Windows
Processes" section of chapter 3 that since 7.1 there are multiple
event queues, one per WindowManager and, by default, one WindowManager
per window.

The manual goes on to say that one can specify whether a new window
will use an existing WindowManager or not using a specific subclass of
WindowManagerUsagePolicy, one of:

 o MakeNewWindowManagerUsagePolicy
 o UseParentWindowManagerUsagePolicy

This is where I start to get confused.

The manual goes on to say that the default policy is
UseParentWindow... , but earlier in the same section I read that the
norm is for each window to have it's own WindowManager unless it is
"closely related".

Looking at our running system with an inspector I see that the windows
each have their own WindowManager (i.e. the >>hash of the
WindowManagers is different).

But this system was not written with the multi-proc UI in mind, and so
does not specify one of the above policies, and so *should* default to
using the parent WindowManager, and so all windows should use the same
WindowManager.

... but they don't.  Confusing.

OK, I go to the top window in the application (the launcher) and
explicitly set the policy to the UseParentWindow...  using the
>>postOpenWith: technique from the manual, just in case that is not
really the default after all.  This has no effect.  Each window still
ends up with it's own WindowManager.

So, before I go on a seven year mission to understand all this from
the code in the system, I thought I would seek help from the wise.
The questions I would very much apreciate answers to are:

o Is there really one event queue per WindowManager, and does that
event queue take *all* events for the respective window(s) (just
checking)?

o Which of the two policies corresponds to windows sharing a WindowManager?

o Which is the default, really?

o Is there some other magic here I should know about to get windows to
share a WindowManager?

Thanks,
     Bruce
--
Make the most of your skills - with OpenSkills
http://www.openskills.org/

Reply | Threaded
Open this post in threaded view
|

RE: WindowManager & milti-proc UI

Terry Raymond
Bruce

Each window manager manages a single event queue for its windows.

The main reason the IDE does not correspond to what is recommended
is that IDE is not a typical application. It must function in
a manner that supports development, debugging, and error recovery.

Specifically, the VisualLauncher has its own window manager and
its WindowManagerUsagePolicy is to make a new window manager.
This was done to insure, or at least increase the probability,
that the user could always open a window if his or others froze up.

So, if you open a browser from the launcher you will find that it
has its own UI process. However, if from the browser you spawn
another browser you will find that it uses the same window manager
as the first browser.

You will also find that the debugger insures it runs in its own
window manager.

Does this help?

> -----Original Message-----
> From: Bruce Badger [mailto:[hidden email]]
> Sent: Saturday, February 11, 2006 1:27 AM
> To: Vwnc
> Subject: WindowManager & milti-proc UI
>
> I'm seeking milti-proc UI wisdom.
>
> I am working on a system that started life ~VW2.x, and is now running
> in VW7.3.1.  The system was not built with a multi-proc UI in mind,
> and we are seeing some odd behavior.
>
> Reading the GUI Devlopers Guide (really, I did) I see in the "Windows
> Processes" section of chapter 3 that since 7.1 there are multiple
> event queues, one per WindowManager and, by default, one WindowManager
> per window.
>
> The manual goes on to say that one can specify whether a new window
> will use an existing WindowManager or not using a specific subclass of
> WindowManagerUsagePolicy, one of:
>
>  o MakeNewWindowManagerUsagePolicy
>  o UseParentWindowManagerUsagePolicy
>
> This is where I start to get confused.
>
> The manual goes on to say that the default policy is
> UseParentWindow... , but earlier in the same section I read that the
> norm is for each window to have it's own WindowManager unless it is
> "closely related".
>
> Looking at our running system with an inspector I see that the windows
> each have their own WindowManager (i.e. the >>hash of the
> WindowManagers is different).
>
> But this system was not written with the multi-proc UI in mind, and so
> does not specify one of the above policies, and so *should* default to
> using the parent WindowManager, and so all windows should use the same
> WindowManager.
>
> ... but they don't.  Confusing.
>
> OK, I go to the top window in the application (the launcher) and
> explicitly set the policy to the UseParentWindow...  using the
> >>postOpenWith: technique from the manual, just in case that is not
> really the default after all.  This has no effect.  Each window still
> ends up with it's own WindowManager.
>
> So, before I go on a seven year mission to understand all this from
> the code in the system, I thought I would seek help from the wise.
> The questions I would very much apreciate answers to are:
>
> o Is there really one event queue per WindowManager, and does that
> event queue take *all* events for the respective window(s) (just
> checking)?
>
> o Which of the two policies corresponds to windows sharing a
> WindowManager?
>
> o Which is the default, really?
>
> o Is there some other magic here I should know about to get windows to
> share a WindowManager?
>
> Thanks,
>      Bruce
> --
> Make the most of your skills - with OpenSkills
> http://www.openskills.org/

Terry
 
===========================================================
Terry Raymond       Smalltalk Professional Debug Package
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

Reply | Threaded
Open this post in threaded view
|

Re: WindowManager & milti-proc UI

Dennis smith-4
In reply to this post by Bruce Badger


Bruce Badger wrote:
I'm seeking milti-proc UI wisdom.

I am working on a system that started life ~VW2.x, and is now running
in VW7.3.1.  The system was not built with a multi-proc UI in mind,
and we are seeing some odd behavior.

Reading the GUI Devlopers Guide (really, I did) I see in the "Windows
Processes" section of chapter 3 that since 7.1 there are multiple
event queues, one per WindowManager and, by default, one WindowManager
per window.

The manual goes on to say that one can specify whether a new window
will use an existing WindowManager or not using a specific subclass of
WindowManagerUsagePolicy, one of:

 o MakeNewWindowManagerUsagePolicy
 o UseParentWindowManagerUsagePolicy

This is where I start to get confused.

The manual goes on to say that the default policy is
UseParentWindow... , but earlier in the same section I read that the
norm is for each window to have it's own WindowManager unless it is
"closely related".

Looking at our running system with an inspector I see that the windows
each have their own WindowManager (i.e. the >>hash of the
WindowManagers is different).

But this system was not written with the multi-proc UI in mind, and so
does not specify one of the above policies, and so *should* default to
using the parent WindowManager, and so all windows should use the same
WindowManager.

... but they don't.  Confusing.

OK, I go to the top window in the application (the launcher) and
explicitly set the policy to the UseParentWindow...  using the
  
postOpenWith: technique from the manual, just in case that is not
      
really the default after all.  This has no effect.  Each window still
ends up with it's own WindowManager.
  

What you describe should work -- here is what we do


postOpenWith: aBuilder
	builder window windowManager activeControllerProcess
		environmentAt: #WindowManagerUsagePolicy
		put: UseParentWindowManagerUsagePolicy new.

This works for us -- no problem.

We have an additional requirement, we have one control window that runs
in its own process but every window it spawns should run in a single process.
We do that by finding such a window (if one exists), and using its process,
otherwise starting new one -- it was a simple subclass of UseParentWindowManagerUsagePolicy.



So, before I go on a seven year mission to understand all this from
the code in the system, I thought I would seek help from the wise. 
The questions I would very much apreciate answers to are:

o Is there really one event queue per WindowManager, and does that
event queue take *all* events for the respective window(s) (just
checking)?

o Which of the two policies corresponds to windows sharing a WindowManager?

o Which is the default, really?

o Is there some other magic here I should know about to get windows to
share a WindowManager?

Thanks,
     Bruce
--
Make the most of your skills - with OpenSkills
http://www.openskills.org/

  

-- 
Dennis Smith                        [hidden email]
Cherniak Software Development Corporation       +1 905.771.7011
400-10 Commerce Valley Dr E                Fax: +1 905.771.6288
Thornhill, ON Canada L3T 7N7    http://www.CherniakSoftware.com
Reply | Threaded
Open this post in threaded view
|

Re: WindowManager & milti-proc UI

Bruce Badger
In reply to this post by Terry Raymond
Terry,

On 11/02/06, Terry Raymond <[hidden email]> wrote:
> Each window manager manages a single event queue for its windows.

Good.  Thanks for confirming that one.

> The main reason the IDE does not correspond to what is recommended
> is that IDE is not a typical application.

Understood.  BTW the launcher I referred to was for the application,
not the VW IDE.

> Does this help?

It does, but I have more to learn, I think.

As an aside, I think the manual could be clearer in this area.
Perhaps the primary text of the VW manuals should be in a wiki, all be
it a moderated one, so we can all help nudge the words in the right
direction.

I have tried the technique mentioned by Dennis Smith to explicitly say
that all windows opened by the application launcher should share the
WindowManager, and thus that all descendent windows should too, but
this does not seem to work for me.  ... though if the manual is right,
I should not have to do even that, because the default is that all
windows share the same WindowManager(!).

Time to work though the code.  Perhaps some funky application specific
code is getting in the way of the policy somehow.

I'll report back.

Thanks Terry & Dennis.

All the best,
    Bruce

--
Make the most of your skills - with OpenSkills
http://www.openskills.org/