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 / 6.0.055 < prev    next >
Encoding:
Internet Message Format  |  2001-10-31  |  3.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.055
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.055
  11. Problem:    GTK: The selection isn't copied the first time.
  12. Solution:   Own the selection at the right moment.
  13. Files:        src/gui_gtk_x11.c
  14.  
  15.  
  16. *** ../vim60.54/src/gui_gtk_x11.c    Thu Oct 25 10:20:46 2001
  17. --- src/gui_gtk_x11.c    Thu Nov  1 14:14:30 2001
  18. ***************
  19. *** 871,877 ****
  20.    * Selection handlers:
  21.    */
  22.   
  23.   /*ARGSUSED*/
  24.       static gint
  25.   selection_clear_event(GtkWidget * widget, GdkEventSelection * event)
  26. --- 871,876 ----
  27. ***************
  28. *** 3521,3563 ****
  29.       }
  30.   }
  31.   
  32.       void
  33.   clip_mch_lose_selection(cbd)
  34.       VimClipboard *cbd;
  35.   {
  36. !     gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom,
  37. !                 (guint32)GDK_CURRENT_TIME);
  38.       gui_mch_update();
  39.   }
  40.   
  41.   /*
  42. !  * Check whatever we allready own the selection.
  43.    */
  44.       int
  45.   clip_mch_own_selection(cbd)
  46.       VimClipboard *cbd;
  47.   {
  48. !     if (cbd == &clip_star)
  49. !     {
  50. !     /* At this point we always already own the selection - apparently */
  51.       return OK;
  52. !     }
  53. !     else
  54. !     {
  55. !     return gdk_selection_owner_get(clip_plus.gtk_sel_atom) == gui.drawarea->window;
  56. !     }
  57.   }
  58.   
  59.   /*
  60. !  * Send the current selection to the clipboard.
  61.    */
  62.       void
  63.   clip_mch_set_selection(cbd)
  64.       VimClipboard* cbd;
  65.   {
  66. -     gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom,
  67. -                 (guint32)GDK_CURRENT_TIME);
  68. -     gui_mch_update();
  69.   }
  70.   
  71.   
  72. --- 3520,3565 ----
  73.       }
  74.   }
  75.   
  76. + /*
  77. +  * Disown the selection.
  78. +  */
  79.       void
  80.   clip_mch_lose_selection(cbd)
  81.       VimClipboard *cbd;
  82.   {
  83. !     /* WEIRD: when using NULL to actually disown the selection, we lose the
  84. !      * selection the first time we own it. */
  85. !     /*
  86. !     gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, (guint32)GDK_CURRENT_TIME);
  87.       gui_mch_update();
  88. +      */
  89.   }
  90.   
  91.   /*
  92. !  * Own the selection and return OK if it worked.
  93.    */
  94.       int
  95.   clip_mch_own_selection(cbd)
  96.       VimClipboard *cbd;
  97.   {
  98. !     int r;
  99. !     r = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom,
  100. !                            (guint32)GDK_CURRENT_TIME);
  101. !     gui_mch_update();
  102. !     if (r)
  103.       return OK;
  104. !     return FAIL;
  105.   }
  106.   
  107.   /*
  108. !  * Send the current selection to the clipboard.  Do nothing for X because we
  109. !  * will fill in the selection only when requested by another app.
  110.    */
  111.       void
  112.   clip_mch_set_selection(cbd)
  113.       VimClipboard* cbd;
  114.   {
  115.   }
  116.   
  117.   
  118. *** ../vim60.54/src/version.c    Thu Nov  1 14:37:02 2001
  119. --- src/version.c    Thu Nov  1 14:38:27 2001
  120. ***************
  121. *** 608,609 ****
  122. --- 608,611 ----
  123.   {   /* Add new patch number below this line */
  124. + /**/
  125. +     55,
  126.   /**/
  127.  
  128. -- 
  129. ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot.
  130.         King of all Britons, defeator of the Saxons, sovereign of all England!
  131.    [Pause]
  132. SOLDIER: Get away!
  133.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  134.  
  135.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  136. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  137.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  138.