[ekiga] Tried to trigger less signals in gtk_radio_menu_select_with_widget
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Tried to trigger less signals in gtk_radio_menu_select_with_widget
- Date: Thu, 7 Oct 2010 20:07:36 +0000 (UTC)
commit 4cc878bed36ca5657dfa7d75736ebc99a9d21550
Author: Julien Puydt <jpuydt gnome org>
Date: Thu Oct 7 15:14:38 2010 +0200
Tried to trigger less signals in gtk_radio_menu_select_with_widget
In the loop, we check and only call set_active on the two items concerned
by the change, instead of all of them (!).
lib/gui/gmmenuaddon.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/lib/gui/gmmenuaddon.c b/lib/gui/gmmenuaddon.c
index d796eaa..571becd 100644
--- a/lib/gui/gmmenuaddon.c
+++ b/lib/gui/gmmenuaddon.c
@@ -531,8 +531,22 @@ gtk_radio_menu_select_with_widget (GtkWidget *widget,
group_last_pos = g_slist_length (group) - 1; /* If length 1, last pos is 0 */
while (group) {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (group->data), (i == group_last_pos - active));
- gtk_widget_queue_draw (GTK_WIDGET (group->data));
+ GtkCheckMenuItem* item = GTK_CHECK_MENU_ITEM (group->data);
+ if (gtk_check_menu_item_get_active (item)) {
+
+ if (i != group_last_pos - active) {
+
+ gtk_check_menu_item_set_active (item, FALSE);
+ gtk_widget_queue_draw (GTK_WIDGET (item));
+ }
+ } else {
+
+ if (i == group_last_pos - active) {
+
+ gtk_check_menu_item_set_active (item, TRUE);
+ gtk_widget_queue_draw (GTK_WIDGET (item));
+ }
+ }
group = g_slist_next (group);
i++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]