Loading ...
Sorry, an error occurred while loading the content.

Patch 5.6.083 (extra)

Expand Messages
  • Bram Moolenaar
    Patch 5.6.083 (extra) Problem: Win32: The visual beep can t be seen. (Eric Roesinger) Solution: Flush the output before waiting with GdiFlush(). (Maurice
    Message 1 of 1 , Jun 5, 2000
    • 0 Attachment
      Patch 5.6.083 (extra)
      Problem: Win32: The visual beep can't be seen. (Eric Roesinger)
      Solution: Flush the output before waiting with GdiFlush(). (Maurice S. Barnum)
      Also: Allow specifying the delay in t_vb for the GUI.
      Files: src/gui.c, src/gui_amiga.c, src/gui_gtk_x11.c, src/gui_mac.c,
      src/gui_riscos.c, src/gui_w32.c, src/gui_x11.c, src/gui_beos.cc,
      src/proto/gui_amiga.pro, src/proto/gui_gtk_x11.pro,
      src/proto/gui_mac.pro, src/proto/gui_riscos.pro,
      src/proto/gui_w32.pro, src/proto/gui_x11.pro,
      src/proto/gui_beos.pro


      *** ../vim-5.6.82/src/gui.c Wed Apr 5 16:30:51 2000
      --- src/gui.c Sat Apr 15 20:14:04 2000
      ***************
      *** 1296,1302 ****
      gui_stop_highlight(arg1);
      break;
      case 'f': /* flash the window (visual bell) */
      ! gui_mch_flash();
      break;
      default:
      p = s + 1; /* Skip the ESC */
      --- 1296,1302 ----
      gui_stop_highlight(arg1);
      break;
      case 'f': /* flash the window (visual bell) */
      ! gui_mch_flash(arg1 == 0 ? 20 : arg1);
      break;
      default:
      p = s + 1; /* Skip the ESC */
      *** ../vim-5.6.82/src/gui_amiga.c Thu Jun 1 19:54:27 2000
      --- src/gui_amiga.c Sun Apr 16 11:47:11 2000
      ***************
      *** 1070,1076 ****
      }

      void
      ! gui_mch_flash(void)
      {
      D("gui_mch_flash");
      }
      --- 1070,1076 ----
      }

      void
      ! gui_mch_flash(int msec)
      {
      D("gui_mch_flash");
      }
      *** ../vim-5.6.82/src/gui_gtk_x11.c Fri Jun 2 14:40:00 2000
      --- src/gui_gtk_x11.c Fri Jun 2 14:29:18 2000
      ***************
      *** 2551,2557 ****
      }

      void
      ! gui_mch_flash()
      {
      GdkGCValues values;
      GdkGC *invert_gc;
      --- 2601,2607 ----
      }

      void
      ! gui_mch_flash(int msec)
      {
      GdkGCValues values;
      GdkGC *invert_gc;
      ***************
      *** 2587,2593 ****
      FILL_Y((int) Rows) + gui.border_offset);

      gdk_flush();
      ! ui_delay(20L, TRUE); /* wait 1/50 of a second */
      gdk_draw_rectangle(gui.drawarea->window, invert_gc,
      TRUE,
      0, 0,
      --- 2637,2643 ----
      FILL_Y((int) Rows) + gui.border_offset);

      gdk_flush();
      ! ui_delay((long)msec, TRUE); /* wait so many msec */
      gdk_draw_rectangle(gui.drawarea->window, invert_gc,
      TRUE,
      0, 0,
      *** ../vim-5.6.82/src/gui_mac.c Thu Jun 1 19:54:27 2000
      --- src/gui_mac.c Sun Apr 30 11:35:48 2000
      ***************
      *** 1114,1120 ****
      }

      void
      ! gui_mch_flash()
      {
      /* Do a visual beep by reversing the foreground and background colors */
      Rect rc;
      --- 1223,1230 ----
      }

      void
      ! gui_mch_flash(msec)
      ! int msec;
      {
      /* Do a visual beep by reversing the foreground and background colors */
      Rect rc;
      ***************
      *** 1128,1134 ****
      rc.bottom = gui.num_rows * gui.char_height;
      InvertRect(&rc);

      ! ui_delay(20L, TRUE); /* wait 1/50 of a second */

      InvertRect(&rc);
      }
      --- 1238,1244 ----
      rc.bottom = gui.num_rows * gui.char_height;
      InvertRect(&rc);

      ! ui_delay((long)msec, TRUE); /* wait for some msec */

      InvertRect(&rc);
      }
      *** ../vim-5.6.82/src/gui_riscos.c Thu Jun 1 19:54:27 2000
      --- src/gui_riscos.c Sun Apr 16 11:58:05 2000
      ***************
      *** 1304,1311 ****
      * Visual bell.
      */
      void
      ! gui_mch_flash(void)
      {
      }


      --- 1304,1312 ----
      * Visual bell.
      */
      void
      ! gui_mch_flash(int msec)
      {
      + /* TODO */
      }


      *** ../vim-5.6.82/src/gui_w32.c Thu Jun 1 19:54:27 2000
      --- src/gui_w32.c Tue Apr 18 10:36:37 2000
      ***************
      *** 3580,3586 ****
      }

      void
      ! gui_mch_flash(void)
      {
      RECT rc;

      --- 3580,3586 ----
      }

      void
      ! gui_mch_flash(int msec)
      {
      RECT rc;

      ***************
      *** 3592,3599 ****
      rc.right = gui.num_cols * gui.char_width;
      rc.bottom = gui.num_rows * gui.char_height;
      InvertRect(s_hdc, &rc);

      ! ui_delay(20L, TRUE); /* wait 1/50 of a second */

      InvertRect(s_hdc, &rc);
      }
      --- 3592,3600 ----
      rc.right = gui.num_cols * gui.char_width;
      rc.bottom = gui.num_rows * gui.char_height;
      InvertRect(s_hdc, &rc);
      + GdiFlush(); /* make sure it's displayed */

      ! ui_delay((long)msec, TRUE); /* wait for a few msec */

      InvertRect(s_hdc, &rc);
      }
      ***************
      *** 3983,3989 ****
      void
      gui_mch_flush(void)
      {
      ! /* Is anything needed here? */
      }

      static void
      --- 3984,3990 ----
      void
      gui_mch_flush(void)
      {
      ! GdiFlush();
      }

      static void
      *** ../vim-5.6.82/src/gui_x11.c Wed Mar 29 12:35:54 2000
      --- src/gui_x11.c Sun Apr 16 12:02:10 2000
      ***************
      *** 1889,1902 ****
      }

      void
      ! gui_mch_flash()
      {
      /* Do a visual beep by reversing the foreground and background colors */
      XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
      FILL_X((int)Columns) + gui.border_offset,
      FILL_Y((int)Rows) + gui.border_offset);
      XSync(gui.dpy, False);
      ! ui_delay(20L, TRUE); /* wait 1/50 of a second */
      XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
      FILL_X((int)Columns) + gui.border_offset,
      FILL_Y((int)Rows) + gui.border_offset);
      --- 1898,1912 ----
      }

      void
      ! gui_mch_flash(msec)
      ! int msec;
      {
      /* Do a visual beep by reversing the foreground and background colors */
      XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
      FILL_X((int)Columns) + gui.border_offset,
      FILL_Y((int)Rows) + gui.border_offset);
      XSync(gui.dpy, False);
      ! ui_delay((long)msec, TRUE); /* wait for a few msec */
      XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
      FILL_X((int)Columns) + gui.border_offset,
      FILL_Y((int)Rows) + gui.border_offset);
      *** ../vim-5.6.82/src/gui_beos.cc Sat Jan 15 13:38:14 2000
      --- src/gui_beos.cc Sat Apr 15 20:24:03 2000
      ***************
      *** 2664,2670 ****
      }

      void
      ! gui_mch_flash()
      {
      /* Do a visual beep by reversing the foreground and background colors */

      --- 2664,2670 ----
      }

      void
      ! gui_mch_flash(int msec)
      {
      /* Do a visual beep by reversing the foreground and background colors */

      ***************
      *** 2674,2680 ****
      gui.vimTextArea->SetDrawingMode(B_OP_INVERT);
      gui.vimTextArea->FillRect(rect);
      gui.vimTextArea->Sync();
      ! snooze(20 * 1000); /* wait 1/50 of a second */
      gui.vimTextArea->FillRect(rect);
      gui.vimTextArea->SetDrawingMode(B_OP_COPY);
      gui.vimTextArea->Flush();
      --- 2674,2680 ----
      gui.vimTextArea->SetDrawingMode(B_OP_INVERT);
      gui.vimTextArea->FillRect(rect);
      gui.vimTextArea->Sync();
      ! snooze(msec * 1000); /* wait for a few msec */
      gui.vimTextArea->FillRect(rect);
      gui.vimTextArea->SetDrawingMode(B_OP_COPY);
      gui.vimTextArea->Flush();
      *** ../vim-5.6.82/src/proto/gui_amiga.pro Sun Jan 16 14:23:21 2000
      --- src/proto/gui_amiga.pro Sat Apr 15 20:18:24 2000
      ***************
      *** 31,37 ****
      void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
      int gui_mch_haskey __ARGS((char_u *name));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((void));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
      --- 31,37 ----
      void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
      int gui_mch_haskey __ARGS((char_u *name));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((int msec));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
      *** ../vim-5.6.82/src/proto/gui_gtk_x11.pro Sun Jan 16 14:23:16 2000
      --- src/proto/gui_gtk_x11.pro Sat Apr 15 20:18:47 2000
      ***************
      *** 26,32 ****
      int gui_mch_haskey __ARGS((char_u *name));
      int gui_get_x11_windis __ARGS((Window *win, Display **dis));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((void));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_draw_hollow_cursor __ARGS((GuiColor color));
      --- 26,32 ----
      int gui_mch_haskey __ARGS((char_u *name));
      int gui_get_x11_windis __ARGS((Window *win, Display **dis));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((int msec));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_draw_hollow_cursor __ARGS((GuiColor color));
      *** ../vim-5.6.82/src/proto/gui_mac.pro Wed Aug 18 21:14:31 1999
      --- src/proto/gui_mac.pro Sat Apr 15 20:19:57 2000
      ***************
      *** 47,53 ****
      void gui_mch_draw_string __PARMS((int row, int col, char_u *s, int len, int flags));
      int gui_mch_haskey __PARMS((char_u *name));
      void gui_mch_beep __PARMS((void));
      ! void gui_mch_flash __PARMS((void));
      void gui_mch_invert_rectangle __PARMS((int r, int c, int nr, int nc));
      void gui_mch_iconify __PARMS((void));
      void gui_mch_settitle __PARMS((char_u *title, char_u *icon));
      --- 47,53 ----
      void gui_mch_draw_string __PARMS((int row, int col, char_u *s, int len, int flags));
      int gui_mch_haskey __PARMS((char_u *name));
      void gui_mch_beep __PARMS((void));
      ! void gui_mch_flash __PARMS((int msec));
      void gui_mch_invert_rectangle __PARMS((int r, int c, int nr, int nc));
      void gui_mch_iconify __PARMS((void));
      void gui_mch_settitle __PARMS((char_u *title, char_u *icon));
      *** ../vim-5.6.82/src/proto/gui_riscos.pro Sat Jan 16 21:04:46 1999
      --- src/proto/gui_riscos.pro Sat Apr 15 20:20:59 2000
      ***************
      *** 20,26 ****
      void gui_mch_draw_string (int row, int col, char_u *s, int len, int flags);
      int gui_mch_haskey (char_u *name);
      void gui_mch_beep (void);
      ! void gui_mch_flash (void);
      void gui_mch_invert_rectangle (int r, int c, int nr, int nc);
      void gui_mch_iconify (void);
      void gui_mch_draw_hollow_cursor (GuiColor color);
      --- 20,26 ----
      void gui_mch_draw_string (int row, int col, char_u *s, int len, int flags);
      int gui_mch_haskey (char_u *name);
      void gui_mch_beep (void);
      ! void gui_mch_flash (int msec);
      void gui_mch_invert_rectangle (int r, int c, int nr, int nc);
      void gui_mch_iconify (void);
      void gui_mch_draw_hollow_cursor (GuiColor color);
      *** ../vim-5.6.82/src/proto/gui_w32.pro Mon Jan 24 13:09:40 2000
      --- src/proto/gui_w32.pro Sat Apr 15 20:22:08 2000
      ***************
      *** 34,40 ****
      void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
      int gui_mch_haskey __ARGS((char_u *name));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((void));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_set_foreground __ARGS((void));
      --- 34,40 ----
      void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
      int gui_mch_haskey __ARGS((char_u *name));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((int msec));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_set_foreground __ARGS((void));
      *** ../vim-5.6.82/src/proto/gui_x11.pro Sun Jan 16 14:23:17 2000
      --- src/proto/gui_x11.pro Sat Apr 15 20:23:05 2000
      ***************
      *** 23,29 ****
      int gui_mch_haskey __ARGS((char_u *name));
      int gui_get_x11_windis __ARGS((Window *win, Display **dis));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((void));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_draw_hollow_cursor __ARGS((GuiColor color));
      --- 23,29 ----
      int gui_mch_haskey __ARGS((char_u *name));
      int gui_get_x11_windis __ARGS((Window *win, Display **dis));
      void gui_mch_beep __ARGS((void));
      ! void gui_mch_flash __ARGS((int msec));
      void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
      void gui_mch_iconify __ARGS((void));
      void gui_mch_draw_hollow_cursor __ARGS((GuiColor color));
      *** ../vim-5.6.82/src/proto/gui_beos.pro Thu Jan 22 21:51:26 1998
      --- src/proto/gui_beos.pro Sat Apr 15 20:24:57 2000
      ***************
      *** 9,13 ****
      GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
      void gui_mch_set_bg_color __ARGS((GuiColor color));
      void gui_mch_set_font __ARGS((GuiFont font));
      ! void gui_mch_flush __ARGS((void));
      char_u *gui_mch_get_rgb __ARGS((GuiColor pixel));
      --- 9,13 ----
      GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
      void gui_mch_set_bg_color __ARGS((GuiColor color));
      void gui_mch_set_font __ARGS((GuiFont font));
      ! void gui_mch_flush __ARGS((int msec));
      char_u *gui_mch_get_rgb __ARGS((GuiColor pixel));
      *** ../vim-5.6.82/src/version.c Mon Jun 5 11:24:35 2000
      --- src/version.c Mon Jun 5 11:28:51 2000
      ***************
      *** 420,421 ****
      --- 420,423 ----
      { /* Add new patch number below this line */
      + /**/
      + 83,
      /**/

      --
      "I've been teaching myself to play the piano for about 5 years and now write
      most of my songs on it, mainly because I can never find any paper."
      Jeff Lynne, ELO's greatest hits

      /-/-- Bram Moolenaar --- Bram@... --- http://www.moolenaar.net --\-\
      \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
    Your message has been successfully submitted and would be delivered to recipients shortly.