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

[jasspa] Fix for the Windows clipboard problem

Expand Messages
  • Jon Green
    I ve sent this to eGroups but is does not seem to have popped out yet after 2 days it may have got lost or is stuck somewhere - forgive me if you get this
    Message 1 of 1 , Aug 16 12:34 PM
    • 0 Attachment
      I've sent this to eGroups but is does not seem to have popped out yet after
      2 days it may have got lost or is stuck somewhere - forgive me if you get
      this multiple times while I try again !!
      Jon.
      --
      Thomas,

      Thanks for the report on the windows clipboard. A fix for the problem is
      attached - these fixes apply to the Beta2 release. (Line #'s are approx !!)

      Problem being that we should mark the clipboard as stale when another
      application requests the clipboard data. This forces us to refresh the
      clipboard when anything changes, thereby allowing the other application(s)
      to get our latest yank buffer selection.

      The best way to see the problem is to run the 'clipboard viewer' supplied
      with the Windows environments. Without the fix we only get the first
      selection, subsequent selections are missed - this is essentially the
      problem that you were experiencing. Applying the fix, then you see the
      clipboard viewer update every time that a new selection is made - hence
      the newest data is always made available.

      I have not checked the winConsole or UNIX builds yet. They may exhibit the
      same or similar problems.

      Regards
      Jon.

      cd C:/me990527/src/
      diff --context --minimal --ignore-space-change --report-identical-files --recursive "C:/me990527/Copy of src" "C:/me990527/src"

      diff --context --minimal --ignore-space-change --report-identical-files --recursive C:/me990527/Copy of src/edef.h C:/me990527/src/edef.h
      *** C:/me990527/Copy of src/edef.h Wed Jul 14 07:50:16 1999
      --- C:/me990527/src/edef.h Sat Aug 14 22:57:00 1999
      ***************
      *** 191,196 ****
      --- 191,197 ----
      #define CLIP_TRY_GET 0x01 /* We can try and get the clipbd*/
      #define CLIP_TRY_SET 0x02 /* We can try and set the clipbd*/
      #define CLIP_OWNER 0x04 /* We are the owners of clipbrd */
      + #define CLIP_STALE 0x08 /* Clipboard is stale */
      #endif
      extern unsigned long cursorBlink ; /* cursor-blink blink time */
      extern int blinkState ; /* cursor blink state */

      diff --context --minimal --ignore-space-change --report-identical-files --recursive C:/me990527/Copy of src/line.c C:/me990527/src/line.c
      *** C:/me990527/Copy of src/line.c Wed Jun 16 07:35:08 1999
      --- C:/me990527/src/line.c Sat Aug 14 23:04:50 1999
      ***************
      *** 619,625 ****
      currkill = &(thiskl->kill) ;

      #ifdef _CLIPBRD
      ! if(clipState & CLIP_TRY_SET)
      TTsetClipboard() ;
      #endif

      --- 619,625 ----
      currkill = &(thiskl->kill) ;

      #ifdef _CLIPBRD
      ! if(clipState & (CLIP_TRY_SET|CLIP_STALE))
      TTsetClipboard() ;
      #endif

      diff --context --minimal --ignore-space-change --report-identical-files --recursive "C:/me990527/Copy of src/winterm.c"
      "C:/me990527/src/winterm.c"

      *** C:/me990527/Copy of src/winterm.c Sat Aug 14 22:31:48 1999
      --- C:/me990527/src/winterm.c Sat Aug 14 23:54:02 1999
      ***************
      *** 1619,1631 ****
      void
      TTsetClipboard (void)
      {
      clipState &= ~CLIP_TRY_SET ;
      ! if(!(clipState & CLIP_OWNER) && (OpenClipboard(ttHwnd) == TRUE))
      {
      EmptyClipboard ();
      SetClipboardData (((ttfont & TTFONT_OEM) ? CF_OEMTEXT : CF_TEXT), NULL);
      CloseClipboard ();
      clipState |= CLIP_OWNER ;
      }
      }

      --- 1619,1638 ----
      void
      TTsetClipboard (void)
      {
      clipState &= ~CLIP_TRY_SET ;
      ! /* We aquire the clipboard and flush it under the following conditions;
      ! * "We do NOT own it" or "Clipboard is stale". The clipboard becomes stale
      ! * when we own it but another application has aquired our clipboard data.
      ! * In this case we need to reset the clipboard so that the application may
      ! * aquire our next data block that has changed. */
      ! if (((clipState ^ CLIP_OWNER) & (CLIP_OWNER|CLIP_STALE)) &&
      ! (OpenClipboard(ttHwnd) == TRUE))
      {
      EmptyClipboard ();
      SetClipboardData (((ttfont & TTFONT_OEM) ? CF_OEMTEXT : CF_TEXT), NULL);
      CloseClipboard ();
      clipState |= CLIP_OWNER ;
      + clipState &= ~CLIP_STALE ;
      }
      }

      ***************
      *** 5222,5228 ****
      EmptyClipboard ();
      SetClipboardData ((ttfont & TTFONT_OEM) ? CF_OEMTEXT : CF_TEXT, hmem);
      CloseClipboard ();
      }
      break;

      --- 5229,5241 ----
      EmptyClipboard ();
      SetClipboardData ((ttfont & TTFONT_OEM) ? CF_OEMTEXT : CF_TEXT, hmem);
      CloseClipboard ();
      + /* Force the stale state. If another application is pulling data
      + * from us while we are the clipboard owner we must force the
      + * clipboard to be refreshed whenever the 'yank' buffer changes.
      + * If nobody is listening then we do not care. This simply allows
      + * us to process optimally and not to continually report a
      + * clipboard change whenever we change the yank data. */
      + clipState |= CLIP_STALE;
      }
      break;

      [EXIT]

      --
      ______________________________________________________________________

      Jon Green - jon@...
      ______________________________________________________________________
    Your message has been successfully submitted and would be delivered to recipients shortly.