]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4201: when using the GUI CTRL-Z does not stop gvim v8.2.4201
authorBram Moolenaar <Bram@vim.org>
Mon, 24 Jan 2022 12:20:45 +0000 (12:20 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 24 Jan 2022 12:20:45 +0000 (12:20 +0000)
Problem:    When using the GUI CTRL-Z does not stop gvim.
Solution:   When using the GUI set SIGTSTP to SIG_DFL. (Andrew Maltsev,
            closes #9570)

src/os_unix.c
src/version.c

index 0af6016bb44a2ce3b591bca1be78a94f0bb17bce..a0189ea454104559b93c17cf38e465c0cf6bd139 100644 (file)
@@ -1378,7 +1378,14 @@ set_signals(void)
 
 #ifdef SIGTSTP
     // See mch_init() for the conditions under which we ignore SIGTSTP.
-    signal(SIGTSTP, ignore_sigtstp ? SIG_IGN : (RETSIGTYPE (*)())sig_tstp);
+    // In the GUI default TSTP processing is OK.
+    // Checking both gui.in_use and gui.starting because gui.in_use is not set
+    // at this point (set after menus are displayed), but gui.starting is set.
+    signal(SIGTSTP, ignore_sigtstp ? SIG_IGN
+# ifdef FEAT_GUI
+                               : gui.in_use || gui.starting ? SIG_DFL
+# endif
+                                   : (RETSIGTYPE (*)())sig_tstp);
 #endif
 #if defined(SIGCONT)
     signal(SIGCONT, sigcont_handler);
index aa0910e0fd94fde5467053e3932fb98055697cf2..1ba9e1d0264d2b82ee2c6a3ff75dec2ece98da12 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4201,
 /**/
     4200,
 /**/