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

Re: draw_part_cursor covered by subsequent draw_string?

Expand Messages
  • Jjgod Jiang
    ... Cool, I forgot to handle this flag, it s OK now. But I just found a new problem about cursor blinking, every 4 seconds, gui_wait_for_chars will:
    Message 1 of 4 , Jul 21, 2007
    View Source
    • 0 Attachment
      2007/7/21, Bram Moolenaar <Bram@...>:
      > gui_mch_draw_string() has flags, one of them is DRAW_TRANSP. If that's
      > present then the background is not to be erased.

      Cool, I forgot to handle this flag, it's OK now.

      But I just found a new problem about cursor blinking, every 4 seconds,
      gui_wait_for_chars will:

      gui_mch_start_blink();
      retval = gui_mch_wait_for_chars(wtime);
      gui_mch_stop_blink();

      So, when I was trying to implement cursor blinking, I got the following
      trace:

      2007-07-21 21:50:50.876 Vim[11594] gui_mch_start_blink
      2007-07-21 21:50:51.576 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:51.827 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:52.228 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:52.479 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:52.879 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:53.130 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:53.531 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:53.782 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:54.183 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:54.434 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:54.835 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:54.877 Vim[11594] gui_mch_stop_blink
      2007-07-21 21:50:54.878 Vim[11594] gui_mch_start_blink
      2007-07-21 21:50:55.578 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:55.829 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:56.230 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:56.481 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:56.882 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:57.132 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:57.533 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:57.784 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:58.185 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:58.436 Vim[11594] blinkCursorTimer: BLINK_OFF
      2007-07-21 21:50:58.837 Vim[11594] blinkCursorTimer: BLINK_ON
      2007-07-21 21:50:58.893 Vim[11594] gui_mch_stop_blink
      2007-07-21 21:50:58.895 Vim[11594] gui_mch_start_blink

      It means, for example, in 2007-07-21 21:50:54.835, blinkCursorTimer is
      getting called, it finds out that current blink_state is BLINK_ON, so it
      will undraw the cursor, then create a new timer to be fired after 0.25
      second, but only after 0.04 second, in 2007-07-21 21:50:54.878,
      gui_mch_start_blink will cause the cursor to show up again, until
      0.7 second (blink_wait time) later, it's turned off.

      Because the regular cursor off time is 0.25 second, the 0.04 second
      off time caused by gui_mch_start_blink will make cursor looked like
      a flash, which is inconsistent with the regular on and off, on and off
      period.

      Do you aware of if there is a solution to avoid this inconsistency?

      - Jiang

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... I m glad you found it. ... I would not worry about this. This is in the generic GUI code. It is probably caused by the updatetime option. -- If they
      Message 2 of 4 , Jul 21, 2007
      View Source
      • 0 Attachment
        Jjgod Jiang wrote:

        > 2007/7/21, Bram Moolenaar <Bram@...>:
        > > gui_mch_draw_string() has flags, one of them is DRAW_TRANSP. If that's
        > > present then the background is not to be erased.
        >
        > Cool, I forgot to handle this flag, it's OK now.

        I'm glad you found it.

        > But I just found a new problem about cursor blinking, every 4 seconds,
        > gui_wait_for_chars will:
        >
        > gui_mch_start_blink();
        > retval = gui_mch_wait_for_chars(wtime);
        > gui_mch_stop_blink();
        >
        > So, when I was trying to implement cursor blinking, I got the following
        > trace:
        >
        > 2007-07-21 21:50:50.876 Vim[11594] gui_mch_start_blink
        > 2007-07-21 21:50:51.576 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:51.827 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:52.228 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:52.479 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:52.879 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:53.130 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:53.531 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:53.782 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:54.183 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:54.434 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:54.835 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:54.877 Vim[11594] gui_mch_stop_blink
        > 2007-07-21 21:50:54.878 Vim[11594] gui_mch_start_blink
        > 2007-07-21 21:50:55.578 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:55.829 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:56.230 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:56.481 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:56.882 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:57.132 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:57.533 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:57.784 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:58.185 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:58.436 Vim[11594] blinkCursorTimer: BLINK_OFF
        > 2007-07-21 21:50:58.837 Vim[11594] blinkCursorTimer: BLINK_ON
        > 2007-07-21 21:50:58.893 Vim[11594] gui_mch_stop_blink
        > 2007-07-21 21:50:58.895 Vim[11594] gui_mch_start_blink
        >
        > It means, for example, in 2007-07-21 21:50:54.835, blinkCursorTimer is
        > getting called, it finds out that current blink_state is BLINK_ON, so it
        > will undraw the cursor, then create a new timer to be fired after 0.25
        > second, but only after 0.04 second, in 2007-07-21 21:50:54.878,
        > gui_mch_start_blink will cause the cursor to show up again, until
        > 0.7 second (blink_wait time) later, it's turned off.
        >
        > Because the regular cursor off time is 0.25 second, the 0.04 second
        > off time caused by gui_mch_start_blink will make cursor looked like
        > a flash, which is inconsistent with the regular on and off, on and off
        > period.
        >
        > Do you aware of if there is a solution to avoid this inconsistency?

        I would not worry about this. This is in the generic GUI code. It is
        probably caused by the 'updatetime' option.

        --
        If they don't keep on exercising their lips, he thought, their brains
        start working.
        -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.