Dharma wrote:
> Hi all,
>
>       Sorry I think I didn't explain my doubt clearly. 
>
>       Support we have two DFBTerms say DFBTerm1 and DFBTerm2. 
>       DFBTerm1 will have a window manager and DFBTerm2 will have a window
> manager .
>
>       Current focus is in DFBTerm2 ,now when I click the DFBTerm1 window ,
>       The focus goes to DFBTerm1. 
>       DFBTerm1 is one process and DFBTerm2 is another process. 
>       To shift the focus, I guess, DFBTerm2 will receive FOCUS_OUT Event
> and 
>       DFBTerm1 will receive FOCUS_IN Event.  Then MOUSE_CLICK will be 
>       Passed to DFBTerm1. 
>
>       I want to know who is taking care of the above, i.e. 
>       how the decision        is taken,to which  process to send the mouse
> event.
>       Since each Process is having its own window manager.
>
> Regards,
> Dharma
>
>       
>       
>       
>       
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Denis Oliver Kropp
> Sent: Wednesday, August 02, 2006 10:40 PM
> To: [EMAIL PROTECTED]
> Cc: [email protected]; [email protected]; 'Unger Richard'
> Subject: Re: [directfb-users] [directfb-dev] Some doubts about window
> manager
>
> Dharma wrote:
>   
>> Hi,
>>      I saw the code . I thought the same way. I have one more doubt .
>> Suppose say we have a DFBTERM of whose x,y,width,height is 0,0,100,100 
>> And we have another DFBTERM whose x,y,width,height is 0,0,100,100 and the 
>> Screen width,screen height is 600,480. 
>>
>>      When I click in some place in the screen, it calls
>> dfb_input_dispatcher() which calls fusion_reactor_dispatch().
>> I think the Reactor is for calling process functions. Here it calls 
>> _dfb_windowstack_inputdevice_listener(), 
>>
>> Is it passing events(mouse click) to DFBTERM1
>> _dfb_windowstack_inputdevice_listener and to
>> DFBTERM2_dfb_windowstack_inputdevice_listener ?
>>     
>
> No, the _dfb_windowstack_inputdevice_listener is a global
> reaction which means that it can run globally and is executed
> synchronously by the caller of fusion_reactor_dispatch,
> no matter which Fusionee attached the reaction.
>
> So this function still runs in the master only and calls the WM
> which decides which window the event should go to. It creates a
> window event and dispatches it to the window via its reactor.
>
> Input Driver => (InputReactor) -> windowstack input listener -> WM 
> process input => (WindowReactor)
>
>
> Via the window reactor the event will be dispatched to the corresponding
> process which has local reactions, e.g. to store the event in a local
> event queue (DirectFBEventBuffer).
>
>   
Hi,

Suppose you have two apps, DFBTerm1 and DFBTerm2 and if DFBTerm1 was 
created first (i.e its the master) then it will create the window 
manager (dfb_wm_initialize) and DFBTerm2 will simply join the DFBTerm1's 
wm (dfb_wm_join).
The CoreWindowStack (defined in windows_internal.h) contains all window 
stacking information and is a completely shared.
If DFBTerm1 has focus, then it means 
CoreWindowStack->StackData->focussed_window=DFBTerm1. So when a key is 
pressed, the flow from dfb_input_dispatch to the handling of the event is:

-dfb_input_dispatch()
-_dfb_windowstack_input_device_listener()
-dfb_wm_process_input()
-wm_process_input()
-handle_key_press()
-get_keyboard_window() [Lookup the owner and grab the key, Here 
CoreWindowStack->StackData->keyboard_window is assigned focussed_window 
i.e DFBTerm1]
-If keypress was for a window, send_key_window()
-post_event()

If you move your mouse pointer over DFBTerm2, then it becomes a 
handle_axis_motion event(), and the flow from wm_process_input() becomes,

-wm_process_input()
-handle_axis_motion()
-handle_motion() [It updates the cursor information in CoreWindowStack]
-update_focus()
-window_at_pointer() [Tries to get the window at pointer i.e DFBTerm2]
-switch_focus() [sends FOCUS_OUT to DFBTerm1 and FOCUS_IN to DFBTerm2]

So now, CoreWindowStack->StackData->focussed_window becomes DFBTerm2 and 
the procedure repeats based on the input.

This was my understanding of how events are delivered to different 
windows. Please correct me if i am wrong.


Regards,
Amar M. Balutkar



_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to