diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/data/preferences-dialog.glade xchat-gnome-0.26.1.new/data/preferences-dialog.glade
--- xchat-gnome-0.26.1/data/preferences-dialog.glade	2009-11-18 13:35:19.441742304 +0600
+++ xchat-gnome-0.26.1.new/data/preferences-dialog.glade	2009-11-18 13:37:50.025742263 +0600
@@ -818,6 +818,25 @@
 				      <property name="fill">False</property>
 				    </packing>
 				  </child>
+                  <child>
+                    <widget class="GtkCheckButton" id="userlist_main">
+                      <property name="visible">True</property>
+                      <property name="tooltip" translatable="yes">Show user list in main window</property>
+                      <property name="can_focus">True</property>
+                      <property name="label" translatable="yes">Show _user list in main window</property>
+                      <property name="use_underline">True</property>
+                      <property name="relief">GTK_RELIEF_NORMAL</property>
+                      <property name="focus_on_click">True</property>
+                      <property name="active">False</property>
+                      <property name="inconsistent">False</property>
+                      <property name="draw_indicator">True</property>
+                    </widget>
+                    <packing>
+                      <property name="padding">0</property>
+                      <property name="expand">False</property>
+                      <property name="fill">False</property>
+                    </packing>
+                  </child>
 				</widget>
 				<packing>
 				  <property name="padding">0</property>
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/data/xchat-gnome.glade xchat-gnome-0.26.1.new/data/xchat-gnome.glade
--- xchat-gnome-0.26.1/data/xchat-gnome.glade	2009-11-18 13:35:19.441742304 +0600
+++ xchat-gnome-0.26.1.new/data/xchat-gnome.glade	2009-11-18 13:37:50.025742263 +0600
@@ -245,6 +245,11 @@
               </packing>
             </child>
             <child>
+        <widget class="GtkHPaned" id="right_paned">
+          <property name="visible">True</property>
+          <property name="can_focus">True</property>
+
+          <child>
               <widget class="GtkVBox" id="main gui vbox">
                 <property name="visible">True</property>
                 <property name="spacing">6</property>
@@ -328,6 +333,35 @@
                   </packing>
                 </child>
               </widget>
+        <packing>
+          <property name="shrink">True</property>
+          <property name="resize">True</property>
+        </packing>
+          </child>
+
+          <child>
+        <widget class="GtkScrolledWindow" id="scrolledwindow_userlist_main">
+          <property name="visible">True</property>
+          <property name="can_focus">True</property>
+          <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+          <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+          <property name="shadow_type">GTK_SHADOW_IN</property>
+          <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+          <child>
+            <placeholder/>
+          </child>
+        </widget>
+        <packing>
+          <property name="shrink">True</property>
+          <property name="resize">True</property>
+        </packing>
+          </child>
+        </widget>
+        <packing>
+          <property name="shrink">True</property>
+          <property name="resize">True</property>
+        </packing>
             </child>
           </widget>
           <packing>
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/src/fe-gnome/apps_xchat.schemas.in xchat-gnome-0.26.1.new/src/fe-gnome/apps_xchat.schemas.in
--- xchat-gnome-0.26.1/src/fe-gnome/apps_xchat.schemas.in	2009-11-18 13:35:19.441742304 +0600
+++ xchat-gnome-0.26.1.new/src/fe-gnome/apps_xchat.schemas.in	2009-11-18 13:37:50.025742263 +0600
@@ -255,6 +255,17 @@
 		</schema>
 
 		<schema>
+			<key>/schemas/apps/xchat/main_window/userlist_in_main_window</key>
+			<applyto>/apps/xchat/main_window/userlist_in_main_window</applyto>
+			<owner>xchat</owner>
+			<type>bool</type>
+			<default>false</default>
+			<locale name="C">
+				<short>Show user list in main window</short>
+			</locale>
+		</schema>
+
+		<schema>
 			<key>/schemas/apps/xchat/channel_list/width</key>
 			<applyto>/apps/xchat/channel_list/width</applyto>
 			<owner>xchat</owner>
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/src/fe-gnome/main-window.c xchat-gnome-0.26.1.new/src/fe-gnome/main-window.c
--- xchat-gnome-0.26.1/src/fe-gnome/main-window.c	2009-11-18 13:37:48.885768582 +0600
+++ xchat-gnome-0.26.1.new/src/fe-gnome/main-window.c	2009-11-18 13:37:50.025742263 +0600
@@ -90,6 +90,8 @@
 
 static void nickname_style_set (GtkWidget *button, GtkStyle *previous_style, gpointer data);
 
+static void main_window_userlist_location_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data);
+
 static GtkActionEntry action_entries [] = {
 
 	/* Toplevel */
@@ -145,6 +147,7 @@
 	GtkWidget *close, *menu_vbox, *widget;
 	GtkSizeGroup *group;
 	GtkAction *action;
+    GConfClient *client;
 
 	gui.main_window = glade_xml_get_widget (gui.xml, "xchat-gnome");
 	g_signal_connect (G_OBJECT (gui.main_window), "delete-event",    G_CALLBACK (on_main_window_close),     NULL);
@@ -228,6 +231,15 @@
 	gtk_button_set_use_underline (GTK_BUTTON (gui.nick_button), FALSE);
 	g_signal_connect (G_OBJECT (gui.nick_button), "clicked",   G_CALLBACK (on_nickname_clicked), NULL);
 	g_signal_connect (G_OBJECT (GTK_BIN (gui.nick_button)->child), "style-set", G_CALLBACK (nickname_style_set),  NULL);
+    
+    client = gconf_client_get_default ();
+    
+    /* move userlist to main window if applicable */
+    main_window_set_show_userlist (gconf_client_get_bool (client, "/apps/xchat/main_window/userlist_in_main_window", NULL));
+    
+	gconf_client_notify_add (client, "/apps/xchat/main_window/userlist_in_main_window", (GConfClientNotifyFunc) main_window_userlist_location_changed, NULL, NULL, NULL);
+
+    g_object_unref (client);
 }
 
 void
@@ -748,3 +760,27 @@
 
 	set_nickname_color (gui.current_session->server);
 }
+
+static void
+main_window_userlist_location_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+{
+    GConfValue *value = gconf_entry_get_value (entry);
+    main_window_set_show_userlist (gconf_value_get_bool (value));
+}
+
+void
+main_window_set_show_userlist (gboolean show_in_main_window)
+{
+    if (show_in_main_window)
+    {
+        gtk_widget_hide (gui.userlist_toggle);
+        gtk_widget_show (glade_xml_get_widget (gui.xml, "scrolledwindow_userlist_main"));
+        gtk_widget_reparent (GTK_WIDGET (gui.userlist), glade_xml_get_widget (gui.xml, "scrolledwindow_userlist_main"));                              
+    }
+    else
+    {
+        gtk_widget_show (gui.userlist_toggle);
+        gtk_widget_hide (glade_xml_get_widget (gui.xml, "scrolledwindow_userlist_main"));
+        gtk_widget_reparent (GTK_WIDGET (gui.userlist), glade_xml_get_widget (gui.xml, "scrolledwindow_userlist"));                              
+    }
+}
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/src/fe-gnome/main-window.h xchat-gnome-0.26.1.new/src/fe-gnome/main-window.h
--- xchat-gnome-0.26.1/src/fe-gnome/main-window.h	2009-11-18 13:35:19.441742304 +0600
+++ xchat-gnome-0.26.1.new/src/fe-gnome/main-window.h	2009-11-18 13:37:50.025742263 +0600
@@ -30,5 +30,6 @@
 void rename_main_window     (gchar *server, gchar *channel);
 void set_nickname_label     (struct server *serv, char *newnick);
 void set_nickname_color     (struct server *serv);
+void main_window_set_show_userlist (gboolean show_in_main_window);
 
 #endif
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/src/fe-gnome/preferences-page-irc.c xchat-gnome-0.26.1.new/src/fe-gnome/preferences-page-irc.c
--- xchat-gnome-0.26.1/src/fe-gnome/preferences-page-irc.c	2009-11-18 13:35:19.445744145 +0600
+++ xchat-gnome-0.26.1.new/src/fe-gnome/preferences-page-irc.c	2009-11-18 13:37:50.025742263 +0600
@@ -30,6 +30,7 @@
 #include "preferences-dialog.h"
 #include "util.h"
 #include "conversation-panel.h"
+#include "main-window.h"
 
 G_DEFINE_TYPE(PreferencesPageIrc, preferences_page_irc, PREFERENCES_PAGE_TYPE)
 
@@ -265,6 +266,19 @@
 	}
 }
 
+static void
+userlist_main_changed (GtkToggleButton *button, gpointer data)
+{
+	gboolean active;
+    GConfClient *client = gconf_client_get_default ();
+
+	active = gtk_toggle_button_get_active (button);
+	main_window_set_show_userlist (active);
+
+	gconf_client_set_bool (client, "/apps/xchat/main_window/userlist_in_main_window", active, NULL);
+    g_object_unref (client);
+}
+
 PreferencesPageIrc*
 preferences_page_irc_new (gpointer prefs_dialog, GladeXML *xml)
 {
@@ -297,6 +311,7 @@
 	GW(auto_logging);
 	GW(show_timestamps);
 	GW(show_marker);
+	GW(userlist_main);
 #undef GW
 
 	GtkIconTheme *theme = gtk_icon_theme_get_default ();
@@ -316,6 +331,7 @@
 	g_signal_connect (G_OBJECT (page->show_timestamps),  "toggled",  G_CALLBACK (bool_changed),     "/apps/xchat/irc/showtimestamps");
 	g_signal_connect (G_OBJECT (page->auto_logging),     "toggled",  G_CALLBACK (auto_logging_changed), NULL);
 	g_signal_connect (G_OBJECT (page->show_marker),      "toggled",  G_CALLBACK (show_marker_changed), NULL);
+	g_signal_connect (G_OBJECT (page->userlist_main),    "toggled",  G_CALLBACK (userlist_main_changed), NULL);
 	g_signal_connect (G_OBJECT (page->highlight_add),    "clicked",  G_CALLBACK (highlight_add),    page);
 	g_signal_connect (G_OBJECT (page->highlight_edit),   "clicked",  G_CALLBACK (highlight_edit),   page);
 	g_signal_connect (G_OBJECT (page->highlight_remove), "clicked",  G_CALLBACK (highlight_remove), page);
@@ -385,7 +401,10 @@
 	toggle = gconf_client_get_bool (p->gconf, "/apps/xchat/irc/showtimestamps", NULL);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->show_timestamps), toggle);
 
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->auto_logging), prefs.logging);
+	toggle = gconf_client_get_bool (p->gconf, "/apps/xchat/main_window/userlist_in_main_window", NULL);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->userlist_main), toggle);
+
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->auto_logging), prefs.logging);
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (page->show_marker), prefs.show_marker);
 	/* highlight list */
 	page->highlight_store = gtk_list_store_new (1, G_TYPE_STRING);
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/src/fe-gnome/preferences-page-irc.h xchat-gnome-0.26.1.new/src/fe-gnome/preferences-page-irc.h
--- xchat-gnome-0.26.1/src/fe-gnome/preferences-page-irc.h	2009-11-18 13:35:19.445744145 +0600
+++ xchat-gnome-0.26.1.new/src/fe-gnome/preferences-page-irc.h	2009-11-18 13:37:50.025742263 +0600
@@ -58,6 +58,7 @@
 	GtkWidget *auto_logging;
 	GtkWidget *show_timestamps;
 	GtkWidget *show_marker;
+	GtkWidget *userlist_main;
 
 	GtkListStore *highlight_store;
 	GtkTreeViewColumn *highlight_column;
diff -Nur -x '*.orig' -x '*~' xchat-gnome-0.26.1/src/fe-gnome/userlist-gui.c xchat-gnome-0.26.1.new/src/fe-gnome/userlist-gui.c
--- xchat-gnome-0.26.1/src/fe-gnome/userlist-gui.c	2008-10-14 04:02:16.000000000 +0700
+++ xchat-gnome-0.26.1.new/src/fe-gnome/userlist-gui.c	2009-11-18 13:44:29.881748373 +0600
@@ -363,7 +363,7 @@
 static void
 userlist_grab (void)
 {
-	if (have_grab) {
+	if (have_grab || !gtk_widget_get_visible (gui.userlist_toggle)) {
 		return;
 	}
 
