Evil hack to keep the entry context menu working with our

title/address behavior.
This commit is contained in:
Marco Pesenti Gritti 2007-06-13 20:19:28 +02:00
parent d3e8ddb278
commit 3c66cb899f

View File

@ -659,6 +659,21 @@ focus_out_event_cb(GtkWidget *widget, GdkEventFocus *event)
return FALSE; return FALSE;
} }
static void
popup_unmap_cb(GtkWidget *popup, SugarAddressEntry *entry)
{
g_signal_handlers_unblock_by_func(entry, focus_out_event_cb, NULL);
}
static void
populate_popup_cb(SugarAddressEntry *entry, GtkWidget *menu)
{
g_signal_handlers_block_by_func(entry, focus_out_event_cb, NULL);
g_signal_connect(menu, "unmap",
G_CALLBACK(popup_unmap_cb), entry);
}
static void static void
sugar_address_entry_init(SugarAddressEntry *entry) sugar_address_entry_init(SugarAddressEntry *entry)
{ {
@ -674,4 +689,6 @@ sugar_address_entry_init(SugarAddressEntry *entry)
G_CALLBACK(entry_changed_cb), NULL); G_CALLBACK(entry_changed_cb), NULL);
g_signal_connect(entry, "button-press-event", g_signal_connect(entry, "button-press-event",
G_CALLBACK(button_press_event_cb), NULL); G_CALLBACK(button_press_event_cb), NULL);
g_signal_connect(entry, "populate-popup",
G_CALLBACK(populate_popup_cb), NULL);
} }