]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.520
- up to 7.3.600
[packages/vim.git] / 7.3.520
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.520
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.520
11 Problem:    Gvim starts up slow on Unbuntu 12.04.
12 Solution:   Move the call to gui_mch_init_check() to after fork(). (Yasuhiro
13             Matsumoto)  Do check $DISPLAY being set.
14 Files:      src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro
15
16
17 *** ../vim-7.3.519/src/gui.c    2011-10-20 21:27:57.000000000 +0200
18 --- src/gui.c   2012-05-18 16:53:14.000000000 +0200
19 ***************
20 *** 270,275 ****
21 --- 270,281 ----
22       }
23       /* Child */
24   
25 + #ifdef FEAT_GUI_GTK
26 +     /* Call gtk_init_check() here after fork(). See gui_init_check(). */
27 +     if (gui_mch_init_check() != OK)
28 +       exit(1);
29 + #endif
30
31   # if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
32       /*
33        * Change our process group.  On some systems/shells a CTRL-C in the
34 ***************
35 *** 430,436 ****
36 --- 436,452 ----
37   #ifdef ALWAYS_USE_GUI
38       result = OK;
39   #else
40 + # ifdef FEAT_GUI_GTK
41 +     /*
42 +      * Note: Don't call gtk_init_check() before fork, it will be called after
43 +      * the fork. When calling it before fork, it make vim hang for a while.
44 +      * See gui_do_fork().
45 +      * Use a simpler check if the GUI window can probably be opened.
46 +      */
47 +     result = gui.dofork ? gui_mch_early_init_check() : gui_mch_init_check();
48 + # else
49       result = gui_mch_init_check();
50 + # endif
51   #endif
52       return result;
53   }
54 *** ../vim-7.3.519/src/gui_gtk_x11.c    2011-10-26 11:36:21.000000000 +0200
55 --- src/gui_gtk_x11.c   2012-05-18 17:00:45.000000000 +0200
56 ***************
57 *** 1414,1420 ****
58   }
59   
60   /*
61 !  * Check if the GUI can be started.  Called before gvimrc is sourced.
62    * Return OK or FAIL.
63    */
64       int
65 --- 1414,1442 ----
66   }
67   
68   /*
69 !  * Check if the GUI can be started.  Called before gvimrc is sourced and
70 !  * before fork().
71 !  * Return OK or FAIL.
72 !  */
73 !     int
74 ! gui_mch_early_init_check(void)
75 ! {
76 !     char_u *p;
77
78 !     /* Guess that when $DISPLAY isn't set the GUI can't start. */
79 !     p = mch_getenv((char_u *)"DISPLAY");
80 !     if (p == NULL || *p == NUL)
81 !     {
82 !       gui.dying = TRUE;
83 !       EMSG(_((char *)e_opendisp));
84 !       return FAIL;
85 !     }
86 !     return OK;
87 ! }
88
89 ! /*
90 !  * Check if the GUI can be started.  Called before gvimrc is sourced but after
91 !  * fork().
92    * Return OK or FAIL.
93    */
94       int
95 ***************
96 *** 3050,3056 ****
97   
98       for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
99       {
100 !       /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
101          * return something, instead of trying another target. Therefore only
102          * offer TARGET_HTML when it works. */
103         if (!clip_html && selection_targets[i].info == TARGET_HTML)
104 --- 3072,3078 ----
105   
106       for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
107       {
108 !       /* OpenOffice tries to use TARGET_HTML and fails when we don't
109          * return something, instead of trying another target. Therefore only
110          * offer TARGET_HTML when it works. */
111         if (!clip_html && selection_targets[i].info == TARGET_HTML)
112 *** ../vim-7.3.519/src/proto/gui_gtk_x11.pro    2011-08-10 17:44:41.000000000 +0200
113 --- src/proto/gui_gtk_x11.pro   2012-05-18 16:54:28.000000000 +0200
114 ***************
115 *** 4,9 ****
116 --- 4,10 ----
117   void gui_mch_set_blinking __ARGS((long waittime, long on, long off));
118   void gui_mch_stop_blink __ARGS((void));
119   void gui_mch_start_blink __ARGS((void));
120 + int gui_mch_early_init_check __ARGS((void));
121   int gui_mch_init_check __ARGS((void));
122   void gui_mch_show_tabline __ARGS((int showit));
123   int gui_mch_showing_tabline __ARGS((void));
124 *** ../vim-7.3.519/src/version.c        2012-05-18 16:35:17.000000000 +0200
125 --- src/version.c       2012-05-18 16:45:30.000000000 +0200
126 ***************
127 *** 716,717 ****
128 --- 716,719 ----
129   {   /* Add new patch number below this line */
130 + /**/
131 +     520,
132   /**/
133
134 -- 
135 Bad programs can be written in any language.
136
137  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
138 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
139 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
140  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.034859 seconds and 3 git commands to generate.