home *** CD-ROM | disk | FTP | other *** search
- To: vim-dev@vim.org
- Subject: Patch 6.1.093 (extra)
- Fcc: outbox
- From: Bram Moolenaar <Bram@moolenaar.net>
- MIME-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- ------------
-
- Patch 6.1.093 (extra)
- Problem: Mac and MS-Windows GUI: when scrolling while ":s" is working the
- results can be messed up, because the cursor is moved.
- Solution: Disallow direct scrolling when not waiting for a character.
- Files: src/gui_mac.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c
-
-
- *** ../vim61.092/src/gui_mac.c Fri May 17 19:29:08 2002
- --- src/gui_mac.c Sun Jun 9 19:56:56 2002
- ***************
- *** 174,179 ****
- --- 174,186 ----
- static short dragRectEnbl;
- static short dragRectControl;
-
- + /* This variable is set when waiting for an event, which is the only moment
- + * scrollbar dragging can be done directly. It's not allowed while commands
- + * are executed, because it may move the cursor and that may cause unexpected
- + * problems (e.g., while ":s" is working).
- + */
- + static int allow_scrollbar = FALSE;
- +
- /* Last mouse click caused contextual menu, (to provide proper release) */
- #ifdef USE_CTRLCLICKMENU
- static short clickIsPopup;
- ***************
- *** 1499,1504 ****
- --- 1506,1512 ----
- scrollbar_T *sb;
- int value, dragging;
- ControlHandle theControlToUse;
- + int dont_scroll_save = dont_scroll;
-
- theControlToUse = dragged_sb;
-
- ***************
- *** 1511,1517 ****
- --- 1519,1529 ----
- value = GetControl32BitValue (theControlToUse);
- dragging = TRUE;
-
- + /* When "allow_scrollbar" is FALSE still need to remember the new
- + * position, but don't actually scroll by setting "dont_scroll". */
- + dont_scroll = !allow_scrollbar;
- gui_drag_scrollbar(sb, value, dragging);
- + dont_scroll = dont_scroll_save;
- }
-
- pascal
- ***************
- *** 1524,1529 ****
- --- 1536,1542 ----
- long value;
- int page;
- int dragging = FALSE;
- + int dont_scroll_save = dont_scroll;
-
- sb = gui_find_scrollbar((long) GetControlReference (theControl));
-
- ***************
- *** 1565,1571 ****
- --- 1578,1588 ----
- else if (value < 0)
- value = 0;*/
-
- + /* When "allow_scrollbar" is FALSE still need to remember the new
- + * position, but don't actually scroll by setting "dont_scroll". */
- + dont_scroll = !allow_scrollbar;
- gui_drag_scrollbar(sb, value, dragging);
- + dont_scroll = dont_scroll_save;
-
- out_flush();
- gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max);
- ***************
- *** 3468,3473 ****
- --- 3485,3492 ----
-
- entryTick = TickCount();
-
- + allow_scrollbar = TRUE;
- +
- do
- {
- /* if (dragRectControl == kCreateEmpty)
- ***************
- *** 3483,3493 ****
- }
- /*
- * Don't use gui_mch_update() because then we will spin-lock until a
- ! * char arrives, instead we use XtAppProcessEvent() to hang until an
- * event arrives. No need to check for input_buf_full because we are
- ! * returning as soon as it contains a single char. Note that
- ! * XtAppNextEvent() may not be used because it will not return after a
- ! * timer event has arrived -- webb
- */
- /* TODO: reduce wtime accordinly??? */
- if (wtime > -1)
- --- 3502,3510 ----
- }
- /*
- * Don't use gui_mch_update() because then we will spin-lock until a
- ! * char arrives, instead we use WaitNextEventWrp() to hang until an
- * event arrives. No need to check for input_buf_full because we are
- ! * returning as soon as it contains a single char.
- */
- /* TODO: reduce wtime accordinly??? */
- if (wtime > -1)
- ***************
- *** 3501,3512 ****
- --- 3518,3533 ----
- #endif
- gui_mac_handle_event (&event);
- if (!vim_is_input_buf_empty())
- + {
- + allow_scrollbar = FALSE;
- return OK;
- + }
- }
- currentTick = TickCount();
- }
- while ((wtime == -1) || ((currentTick - entryTick) < 60*wtime/1000));
-
- + allow_scrollbar = FALSE;
- return FAIL;
- }
-
- *** ../vim61.092/src/gui_w16.c Sat May 4 22:23:07 2002
- --- src/gui_w16.c Sun Jun 9 20:02:03 2002
- ***************
- *** 81,87 ****
- #endif
-
-
- -
- #ifdef FEAT_MENU
- /*
- * Figure out how high the menu bar is at the moment.
- --- 81,86 ----
- ***************
- *** 149,154 ****
- --- 148,154 ----
- int nPos;
- #endif
- static UINT prev_code = 0; /* code of previous call */
- + int dont_scroll_save = dont_scroll;
-
- sb = gui_mswin_find_scrollbar(hwndCtl);
- if (sb == NULL)
- ***************
- *** 239,246 ****
- --- 239,252 ----
-
- /* Don't let us be interrupted here by another message. */
- s_busy_processing = TRUE;
- +
- + /* When "allow_scrollbar" is FALSE still need to remember the new
- + * position, but don't actually scroll by setting "dont_scroll". */
- + dont_scroll = !allow_scrollbar;
- +
- gui_drag_scrollbar(sb, val, dragging);
- s_busy_processing = FALSE;
- + dont_scroll = dont_scroll_save;
-
- return 0;
- }
- *** ../vim61.092/src/gui_w32.c Sat May 4 22:23:07 2002
- --- src/gui_w32.c Sun Jun 9 20:04:41 2002
- ***************
- *** 365,370 ****
- --- 365,371 ----
- int nPos;
- #endif
- static UINT prev_code = 0; /* code of previous call */
- + int dont_scroll_save = dont_scroll;
-
- sb = gui_mswin_find_scrollbar(hwndCtl);
- if (sb == NULL)
- ***************
- *** 457,464 ****
- --- 458,472 ----
-
- /* Don't let us be interrupted here by another message. */
- s_busy_processing = TRUE;
- +
- + /* When "allow_scrollbar" is FALSE still need to remember the new
- + * position, but don't actually scroll by setting "dont_scroll". */
- + dont_scroll = !allow_scrollbar;
- +
- gui_drag_scrollbar(sb, val, dragging);
- +
- s_busy_processing = FALSE;
- + dont_scroll = dont_scroll_save;
-
- return 0;
- }
- *** ../vim61.092/src/gui_w48.c Sat May 4 22:23:07 2002
- --- src/gui_w48.c Sun Jun 9 20:03:16 2002
- ***************
- *** 166,171 ****
- --- 166,179 ----
-
- static int s_need_activate = FALSE;
-
- + /* This variable is set when waiting for an event, which is the only moment
- + * scrollbar dragging can be done directly. It's not allowed while commands
- + * are executed, because it may move the cursor and that may cause unexpected
- + * problems (e.g., while ":s" is working).
- + */
- + static int allow_scrollbar = FALSE;
- +
- +
- #ifdef GLOBAL_IME
- # undef DefWindowProc
- # define DefWindowProc(a, b, c, d) global_ime_DefWindowProc(a, b, c, d)
- ***************
- *** 1655,1660 ****
- --- 1663,1670 ----
- (TIMERPROC)_OnTimer);
- }
-
- + allow_scrollbar = TRUE;
- +
- focus = gui.in_focus;
- while (!s_timed_out)
- {
- ***************
- *** 1697,1705 ****
- --- 1707,1717 ----
- ;
- s_wait_timer = 0;
- }
- + allow_scrollbar = FALSE;
- return OK;
- }
- }
- + allow_scrollbar = FALSE;
- return FAIL;
- }
-
- *** ../vim61.092/src/version.c Sun Jun 9 18:28:25 2002
- --- src/version.c Sun Jun 9 20:31:49 2002
- ***************
- *** 608,609 ****
- --- 608,611 ----
- { /* Add new patch number below this line */
- + /**/
- + 93,
- /**/
-
- --
- hundred-and-one symptoms of being an internet addict:
- 146. You experience ACTUAL physical withdrawal symptoms when away
- from your 'puter and the net.
-
- /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\
- /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
- \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
- \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
-