[hackers] [surf] fixing double calling functions from contextmenu. || Enno Boland (tox)

From: <hg_AT_suckless.org>
Date: Sat, 17 Oct 2009 06:54:59 +0000 (UTC)

changeset: 130:a5db79d487c8
tag: tip
user: Enno Boland (tox) <tox_AT_s01.de>
date: Sat Oct 17 08:57:23 2009 +0200
files: surf.c
description:
fixing double calling functions from contextmenu.

diff -r 192af450a2cf -r a5db79d487c8 surf.c
--- a/surf.c Sat Oct 17 08:38:46 2009 +0200
+++ b/surf.c Sat Oct 17 08:57:23 2009 +0200
@@ -187,8 +187,6 @@
                 if(parent)
                         gtk_container_remove(parent, c->items[i]);
                 gtk_menu_shell_append(GTK_MENU_SHELL(m), c->items[i]);
- g_signal_connect(G_OBJECT(c->items[i]), "activate",
- G_CALLBACK(itemclick), c);
                 gtk_widget_show(c->items[i]);
         }
 }
@@ -459,8 +457,11 @@
                 die("Cannot malloc!\n");
 
         /* contextmenu */
- for(i = 0; i < LENGTH(items); i++)
+ for(i = 0; i < LENGTH(items); i++) {
                 c->items[i] = gtk_menu_item_new_with_label(items[i].label);
+ g_signal_connect(G_OBJECT(c->items[i]), "activate",
+ G_CALLBACK(itemclick), c);
+ }
 
 
         /* VBox */
Received on Sat Oct 17 2009 - 06:54:59 UTC

This archive was generated by hypermail 2.2.0 : Sat Oct 17 2009 - 07:00:06 UTC