From 7c85cc68c6e7c75839b9a0c789bd464c5a99445b Mon Sep 17 00:00:00 2001 From: slava Date: Mon, 24 Jul 2006 04:42:19 +0000 Subject: [PATCH] Minor X clipboard changes --- library/ui/x11/ui.factor | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/library/ui/x11/ui.factor b/library/ui/x11/ui.factor index a2607274bb..7f96259325 100644 --- a/library/ui/x11/ui.factor +++ b/library/ui/x11/ui.factor @@ -106,14 +106,16 @@ M: world selection-notify-event ( event world -- ) [ world-handle first selection-from-event ] keep world-focus user-input ; +: supported-type? ( atom -- ? ) + { "STRING" "UTF8_STRING" "TEXT" } + [ x-atom = ] contains-with? ; + M: world selection-request-event ( event world -- ) - drop dup XSelectionRequestEvent-target - { - { [ dup XA_STRING = ] [ drop dup set-selection-prop send-notify-success ] } - { [ dup "UTF8_STRING" = ] [ drop dup set-selection-prop send-notify-success ] } + drop dup XSelectionRequestEvent-target { + { [ dup supported-type? ] [ drop dup set-selection-prop send-notify-success ] } { [ dup "TARGETS" x-atom = ] [ drop dup set-targets-prop send-notify-success ] } { [ dup "TIMESTAMP" x-atom = ] [ drop dup set-timestamp-prop send-notify-success ] } - { [ t ] [ 2drop send-notify-failure ] } + { [ t ] [ drop send-notify-failure ] } } cond ; : close-box? ( event -- ? )