diff --git a/src/gui.c b/src/gui.c
index b3d57db2e65432ef54a7584a55d6420dee51313d..88d97a326ad811c3a9573fe5a1e61f829b6c67ad 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -3420,6 +3420,28 @@ get_tabline_label(tp)
     }
 }
 
+/*
+ * Send the event for clicking to select tab page "nr".
+ * Returns TRUE if it was done, FALSE when skipped because we are already at
+ * that tab page.
+ */
+    int
+send_tabline_event(nr)
+    int	    nr;
+{
+    char_u string[3];
+
+    if (nr == tabpage_index(curtab))
+	return FALSE;
+    string[0] = CSI;
+    string[1] = KS_TABLINE;
+    string[2] = KE_FILLER;
+    add_to_input_buf(string, 3);
+    string[0] = nr;
+    add_to_input_buf_csi(string, 1);
+    return TRUE;
+}
+
 #endif
 
 /*
diff --git a/src/gui.h b/src/gui.h
index f1a9e6404649931c249d75df9acc0ca9e06272d2..90047c38fccde54d80dd081027e2f179a9643551 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -8,12 +8,10 @@
  */
 
 #ifdef FEAT_GUI_MOTIF
-# define FEAT_GUI_X11
 # include <Xm/Xm.h>
 #endif
 
 #ifdef FEAT_GUI_ATHENA
-# define FEAT_GUI_X11
 # include <X11/Intrinsic.h>
 # include <X11/StringDefs.h>
 #endif