diff -ru xchat-2.6.8/src/common/cfgfiles.c xchat-2.6.8_/src/common/cfgfiles.c --- xchat-2.6.8/src/common/cfgfiles.c 2006-10-03 16:19:39.000000000 +0300 +++ xchat-2.6.8_/src/common/cfgfiles.c 2007-05-26 14:06:04.000000000 +0300 @@ -420,6 +422,7 @@ {"gui_dialog_left", P_OFFINT (dialog_left), TYPE_INT}, {"gui_dialog_top", P_OFFINT (dialog_top), TYPE_INT}, {"gui_dialog_width", P_OFFINT (dialog_width), TYPE_INT}, + {"gui_disable_close", P_OFFINT (gui_disable_close), TYPE_BOOL}, {"gui_hide_menu", P_OFFINT (hidemenu), TYPE_BOOL}, {"gui_input_spell", P_OFFINT (gui_input_spell), TYPE_BOOL}, {"gui_input_style", P_OFFINT (style_inputbox), TYPE_BOOL}, diff -ru xchat-2.6.8/src/common/xchat.h xchat-2.6.8_/src/common/xchat.h --- xchat-2.6.8/src/common/xchat.h 2006-10-14 08:50:18.000000000 +0300 +++ xchat-2.6.8_/src/common/xchat.h 2007-05-26 10:39:54.000000000 +0300 @@ -175,6 +175,7 @@ int gui_url_mod; int gui_usermenu; int gui_join_dialog; + int gui_disable_close; int dialog_left; int dialog_top; int dialog_width; diff -ru xchat-2.6.8/src/fe-gtk/menu.c xchat-2.6.8_/src/fe-gtk/menu.c --- xchat-2.6.8/src/fe-gtk/menu.c 2007-05-26 11:43:12.000000000 +0300 +++ xchat-2.6.8_/src/fe-gtk/menu.c 2007-05-26 11:42:03.000000000 +0300 @@ -73,6 +73,7 @@ #include "menu.h" static GSList *submenu_list; +static GtkWidget *menu_close_win; enum { @@ -1339,7 +1340,7 @@ #define DETACH_OFFSET (12) {0, menu_detach, GTK_STOCK_REDO, M_MENUSTOCK, 0, 0, 1, GDK_I}, /* 12 */ #define CLOSE_OFFSET (13) - {0, menu_close, GTK_STOCK_CLOSE, M_MENUSTOCK, 0, 0, 1}, + {0, menu_close, GTK_STOCK_CLOSE, M_MENUSTOCK, 0, 0, 1, GDK_w}, {0, 0, 0, M_SEP, 0, 0, 0}, {N_("_Quit"), mg_safe_quit, GTK_STOCK_QUIT, M_MENUSTOCK, 0, 0, 1, GDK_q}, /* 15 */ @@ -1827,7 +1828,7 @@ case M_MENUITEM: item = gtk_menu_item_new_with_mnemonic (_(mymenu[i].text)); normalitem: - if (mymenu[i].key != 0) + if (mymenu[i].key != 0 && (i != CLOSE_OFFSET || !prefs.gui_disable_close)) gtk_widget_add_accelerator (item, "activate", accel_group, mymenu[i].key, mymenu[i].key == GDK_F1 ? 0 : diff -ru xchat-2.6.8/src/fe-gtk/setup.c xchat-2.6.8_/src/fe-gtk/setup.c --- xchat-2.6.8/src/fe-gtk/setup.c 2006-10-08 15:09:54.000000000 +0300 +++ xchat-2.6.8_/src/fe-gtk/setup.c 2007-05-26 11:11:10.000000000 +0300 @@ -142,6 +142,9 @@ {ST_ENTRY, N_("Nick completion suffix:"), P_OFFSETNL(nick_suffix),0,0,sizeof prefs.nick_suffix}, {ST_MENU, N_("Nick completion sorted:"), P_OFFINTNL(completion_sort), 0, tabcompmenu, 0}, + {ST_HEADER, N_("Miscellaneous"),0,0,0}, + {ST_TOGGLE, N_("Disable keyboard shortcut for closing tab"), P_OFFINTNL(gui_disable_close),0,0,0}, + #if 0 /* obsolete */ {ST_HEADER, N_("Input Box Codes"),0,0,0}, {ST_TOGGLE, N_("Interpret %nnn as an ASCII value"), P_OFFINTNL(perc_ascii),0,0,0}, @@ -1756,6 +1759,8 @@ noapply = TRUE; if (DIFF (truncchans)) noapply = TRUE; + if (DIFF (gui_disable_close)) + noapply = TRUE; if (color_change || (DIFF (away_size_max)) || (DIFF (away_track))) do_ulist = TRUE;