home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.5.027 < prev    next >
Encoding:
Internet Message Format  |  1999-10-16  |  4.1 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 5.5.027
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.5.027
  8. Problem:    Unix: os_unix.c doesn't compile when XTERM_CLIP is used but
  9.         WANT_TITLE isn't. (Barnum)
  10. Solution:   Move a few functions that are used by the X11 title and clipboard
  11.         and put another "#if" around it.
  12. Files:        src/os_unix.c
  13.  
  14.  
  15. *** ../vim-5.5.26/src/os_unix.c    Sat Sep 25 20:35:49 1999
  16. --- src/os_unix.c    Sun Oct 17 17:06:23 1999
  17. ***************
  18. *** 110,116 ****
  19.   
  20.   # ifdef WANT_TITLE
  21.   static int  get_x11_windis __ARGS((void));
  22. - static int  test_x11_window __ARGS((Display *dpy));
  23.   static void set_x11_title __ARGS((char_u *));
  24.   static void set_x11_icon __ARGS((char_u *));
  25.   # endif
  26. --- 110,115 ----
  27. ***************
  28. *** 759,769 ****
  29.       return FALSE;
  30.   }
  31.   
  32. ! #ifdef WANT_TITLE
  33. ! #if defined(HAVE_X11) && defined(WANT_X11)
  34. ! static int get_x11_thing __ARGS((int get_title, int test_only));
  35.   
  36.   /*
  37.    * X Error handler, otherwise X just exits!  (very rude) -- webb
  38. --- 758,771 ----
  39.       return FALSE;
  40.   }
  41.   
  42. ! #if defined(HAVE_X11) && defined(WANT_X11) \
  43. !     && (defined(WANT_TITLE) || defined(XTERM_CLIP))
  44. ! /*
  45. !  * A few functions shared by X11 title and clipboard code.
  46. !  */
  47. ! static int x_error_handler __ARGS((Display *dpy, XErrorEvent *error_event));
  48. ! static int x_error_check __ARGS((Display *dpy, XErrorEvent *error_event));
  49. ! static int test_x11_window __ARGS((Display *dpy));
  50.   
  51.   /*
  52.    * X Error handler, otherwise X just exits!  (very rude) -- webb
  53. ***************
  54. *** 798,803 ****
  55. --- 800,836 ----
  56.   }
  57.   
  58.   /*
  59. +  * Test if "dpy" and x11_window are valid by getting the window title.
  60. +  * I don't actually want it yet, so there may be a simpler call to use, but
  61. +  * this will cause the error handler x_error_check() to be called if anything
  62. +  * is wrong, such as the window pointer being invalid (as can happen when the
  63. +  * user changes his DISPLAY, but not his WINDOWID) -- webb
  64. +  */
  65. +     static int
  66. + test_x11_window(dpy)
  67. +     Display    *dpy;
  68. + {
  69. +     int            (*old_handler)();
  70. +     XTextProperty    text_prop;
  71. +     old_handler = XSetErrorHandler(x_error_check);
  72. +     got_x_error = FALSE;
  73. +     if (XGetWMName(dpy, x11_window, &text_prop))
  74. +     XFree((void *)text_prop.value);
  75. +     XSync(dpy, False);
  76. +     (void)XSetErrorHandler(old_handler);
  77. +     return (got_x_error ? FAIL : OK);
  78. + }
  79. + #endif
  80. + #ifdef WANT_TITLE
  81. + #if defined(HAVE_X11) && defined(WANT_X11)
  82. + static int get_x11_thing __ARGS((int get_title, int test_only));
  83. + /*
  84.    * try to get x11 window and display
  85.    *
  86.    * return FAIL for failure, OK otherwise
  87. ***************
  88. *** 926,955 ****
  89.       if (x11_window == 0 || x11_display == NULL)
  90.       return (result = FAIL);
  91.       return (result = OK);
  92. - }
  93. - /*
  94. -  * Test if "dpy" and x11_window are valid by getting the window title.
  95. -  * I don't actually want it yet, so there may be a simpler call to use, but
  96. -  * this will cause the error handler x_error_check() to be called if anything
  97. -  * is wrong, such as the window pointer being invalid (as can happen when the
  98. -  * user changes his DISPLAY, but not his WINDOWID) -- webb
  99. -  */
  100. -     static int
  101. - test_x11_window(dpy)
  102. -     Display    *dpy;
  103. - {
  104. -     int            (*old_handler)();
  105. -     XTextProperty    text_prop;
  106. -     old_handler = XSetErrorHandler(x_error_check);
  107. -     got_x_error = FALSE;
  108. -     if (XGetWMName(dpy, x11_window, &text_prop))
  109. -     XFree((void *)text_prop.value);
  110. -     XSync(dpy, False);
  111. -     (void)XSetErrorHandler(old_handler);
  112. -     return (got_x_error ? FAIL : OK);
  113.   }
  114.   
  115.   /*
  116. --- 959,964 ----
  117. *** ../vim-5.5.26/src/version.c    Sun Oct 17 16:44:57 1999
  118. --- src/version.c    Sun Oct 17 17:14:34 1999
  119. ***************
  120. *** 420,420 ****
  121. --- 420,421 ----
  122.   {   /* Add new patch number below this line */
  123. +     27,
  124.  
  125. --
  126. ARTHUR:          But if he was dying, he wouldn't bother to carve
  127.                  "Aaaaarrrrrrggghhh".  He'd just say it.
  128. BROTHER MAYNARD: It's down there carved in stone.
  129. GALAHAD:         Perhaps he was dictating.
  130.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  131.  
  132. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  133.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  134.