]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.031 v7.3.031
authorBram Moolenaar <Bram@vim.org>
Wed, 20 Oct 2010 17:17:48 +0000 (19:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 20 Oct 2010 17:17:48 +0000 (19:17 +0200)
Problem:    Can't pass the X window ID to another application.
Solution:   Add v:windowid. (Christian J. Robinson, Lech Lorens)

runtime/doc/eval.txt
src/eval.c
src/gui.c
src/os_unix.c
src/version.c
src/vim.h

index f8ac2727d54b61abec3336caeb93bd73c2ae271c..d37fe2ab334c935e0ef7ceb042e891a6f6dca9d7 100644 (file)
@@ -1657,6 +1657,11 @@ v:version        Version number of Vim: Major version number times 100 plus
                                        *v:warningmsg* *warningmsg-variable*
 v:warningmsg   Last given warning message.  It's allowed to set this variable.
 
+                                       *v:windowid* *windowid-variable*
+v:windowid     When any X11 based GUI is running or when running in a
+               terminal and Vim connects to the X server (|-X|) this will be
+               set to the window ID.  Otherwise the value is zero.
+
 ==============================================================================
 4. Builtin Functions                                   *functions*
 
index 699598be087e200a6eeed370f969e93fab3dbf46..1216dc67298b094d6238815ce8f09f07003aa503 100644 (file)
@@ -362,6 +362,7 @@ static struct vimvar
     {VV_NAME("operator",        VAR_STRING), VV_RO},
     {VV_NAME("searchforward",   VAR_NUMBER), 0},
     {VV_NAME("oldfiles",        VAR_LIST), 0},
+    {VV_NAME("windowid",        VAR_NUMBER), VV_RO},
 };
 
 /* shorthand */
index 6029e3b7c017a06e51026ac16f75959ab0da7a59..89d8d5a883684ae0bbbf3a4bae1ae486e6a2ce04 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -105,8 +105,18 @@ gui_start()
 
 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
     if (gui.in_use)
+    {
+# ifdef FEAT_EVAL
+       Window  x11_window;
+       Display *x11_display;
+
+       if (gui_get_x11_windis(&x11_window, &x11_display) == OK)
+           set_vim_var_nr(VV_WINDOWID, (long)x11_window);
+# endif
+
        /* Display error messages in a dialog now. */
        display_errors();
+    }
 #endif
 
 #if defined(MAY_FORK) && !defined(__QNXNTO__)
index 150bdad6d833d5c92a1b143410671620fa8c563b..9fcebd6a37ef548e0328441d53dbeb19dfa9985c 100644 (file)
@@ -1738,6 +1738,11 @@ get_x11_windis()
     }
     if (x11_window == 0 || x11_display == NULL)
        return (result = FAIL);
+
+# ifdef FEAT_EVAL
+    set_vim_var_nr(VV_WINDOWID, (long)x11_window);
+# endif
+
     return (result = OK);
 }
 
index e776e1d52fb5a3c8c8ba84e1b4fe159c7ce655aa..e5164d362051f7804e42c51f59e4d5a08cfee55e 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    31,
 /**/
     30,
 /**/
index 6c846c1d7e3991a8b3a7867799685e337bd69808..5b74203307a3d9e7c4632bde69951ffebe89ba91 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -1842,7 +1842,8 @@ typedef int proftime_T;       /* dummy for function prototypes */
 #define VV_OP          52
 #define VV_SEARCHFORWARD 53
 #define VV_OLDFILES    54
-#define VV_LEN         55      /* number of v: vars */
+#define VV_WINDOWID    55
+#define VV_LEN         56      /* number of v: vars */
 
 #ifdef FEAT_CLIPBOARD