Unset the panel menu items before activating
We need a trick to fix the behaviour of toggle buttons not to fire any signals if they are activated repeatedly, which in our use case is essential.
This commit is contained in:
parent
db599a99d5
commit
f2ece009b3
1 changed files with 6 additions and 1 deletions
|
@ -322,7 +322,12 @@ midori_panel_menu_item_activate_cb (GtkWidget* widget,
|
||||||
toolitem = g_object_get_data (G_OBJECT (widget), "toolitem");
|
toolitem = g_object_get_data (G_OBJECT (widget), "toolitem");
|
||||||
|
|
||||||
if (toolitem)
|
if (toolitem)
|
||||||
|
{
|
||||||
|
/* Unset the button before setting it ensures that
|
||||||
|
it will emit signals even if it was active before */
|
||||||
|
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (toolitem), FALSE);
|
||||||
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (toolitem), TRUE);
|
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (toolitem), TRUE);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n = midori_panel_page_num (panel, child);
|
n = midori_panel_page_num (panel, child);
|
||||||
|
@ -341,7 +346,7 @@ midori_panel_menu_item_activate_cb (GtkWidget* widget,
|
||||||
* @label: a string to use as the label
|
* @label: a string to use as the label
|
||||||
*
|
*
|
||||||
* Appends a new page to the panel. If @toolbar is specified it will
|
* Appends a new page to the panel. If @toolbar is specified it will
|
||||||
* be packaged above @child.
|
* be packed above @child.
|
||||||
*
|
*
|
||||||
* In the case of an error, -1 is returned.
|
* In the case of an error, -1 is returned.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue