Autoactivation problem in BonoboControlFrame



Hi Michael,

just discovered a little problem in the autoactivation code of
the BonoboControlFrame:

Currently, the ControlFrame activates its Control each time it
gets the "focus_in" signal and deactives it when it gets the
"focus_out" signal.

This is of course what it is supposed to do - however, when you
leave the application window with the mouse, you don't seem to
get a "focus_out" signal, but you get a "focus_in" signal next
time you enter the application window again.

As a result, your Control is activated multiple times when you
leave its application window with the mouse and enter it again.

In impl_Bonobo_Control_activate() we have this:

===
	if (control->priv->automerge && control->priv->active != activated) {
		if (activated)
			bonobo_control_auto_merge (control);
		else
			bonobo_control_auto_unmerge (control);
	}

	gtk_signal_emit (GTK_OBJECT (control), control_signals [ACTIVATE], (gboolean) activated);
===

This means that the merging only takes place when there's actually
a state change - but we still emit the ACTIVATE signal multiple times.

This means that components must use the same `priv->active != activated'
check when merging/unmerging their menus to avoid that they're merged
multiple times.

Wouldn't it be better to only emit this signal when there's a state
change ?

===
	if (control->priv->automerge && control->priv->active != activated) {
		if (activated)
			bonobo_control_auto_merge (control);
		else
			bonobo_control_auto_unmerge (control);

                gtk_signal_emit (GTK_OBJECT (control), control_signals [ACTIVATE], (gboolean) activated);
        }
===

-- 
Martin Baulig
martin gnome org (private)
baulig suse de (work)




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