Re: Refining the concept of focus



Owen,

Some requests for clarification below.

> 
> To fully implement the XEMBED spec, some refinement of how GTK+ deals with 
focus
> was necessary.
> 
> The following patch adds three properties:
> 
>  GtkWidget::is_focus - is this focus the focus widget within it's (in-process) 
GtkWindow
>  GtkWindow::is_active - is the (possibly out-of-process) toplevel of the 
window the X focus
>  GtkWIndow::has_toplevel_focus - does this toplevel window contain the focus 
widget
> 
> 
>  +----------- GtkWindow (A)--------------+
>  |                                       |
>  | GtkPlug (B)------+ GtkPlug-(D)------+ |
>  | | GtkEntry (C)-+ | | GtkEntry (E)-+ | |
>  | | |            | | | |[focus here]  | | |
>  | | +------------+ | | +------------+ | |
>  | +----------------+ +----------------+ |
>  +---------------------------------------+
> 
> So, in a situation like the above, we might have 
> 
>  is_focus set on C and E

Is is_focus set on the GtkSockets which connect to B and D?

>  is_active set on A, B, and D

I expected that only D would have is_active set. It seems I do not understand 
what is_active means.


>  has_toplevel_focus set on A and E 

I assume you mean A and D here.


Padraig

> 
> is_focus is quite useful independent of embedding
> is_active is relatively useful independent of embedding ... the most important
>   use would be a theme that wanted to draw active widgets differently.
> has_toplevel_focus is really an internal implementation detail.
> 
> I've made is_active and has_toplevel_focus read-only with private settors,
> because
> 
>  - The setters just reflect state changes, and have no meaning to an app
>  - Making properties read-only will reduce the chance
>    of people trying to use them to change the focused window. (And will keep 
them
>    from appearing in GUI-builders.)
> 
> GtkWidget::has-focus really should be read-only with GtkWidget::is-focus
> being the only read-write property, but making that change at this point
> isn't possible.
> 
> Regards,
>                                         Owen
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]