Don't quit in the middle of transferring an incremental selection.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 12 Feb 2011 16:45:58 +0000 (16:45 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 12 Feb 2011 16:45:58 +0000 (16:45 +0000)
(ICCCM 2.2)

git-svn-id: svn://svn.tartarus.org/sgt/utils@9089 cda61777-01e9-0310-a592-d414129be87e

xcopy/xcopy.c

index 1c030b3..da1f6ac 100644 (file)
@@ -610,10 +610,13 @@ void run_X(void) {
                 return;
             }
         } else {
+            int exiting = False;
+
             switch (ev.type) {
               case SelectionClear:
                 /* Selection has been cleared by another app. */
-                return;
+                exiting = True;
+                break;
               case SelectionRequest:
                 e2.xselection.type = SelectionNotify;
                 e2.xselection.requestor = ev.xselectionrequest.requestor;
@@ -664,6 +667,8 @@ void run_X(void) {
                 nincrs = j;
                 break;
             }
+            if (nincrs == 0 && exiting)
+                return;
         }
     }
 }