diff options
| author | Po Lu | 2022-04-03 09:59:14 +0800 |
|---|---|---|
| committer | Po Lu | 2022-04-03 09:59:14 +0800 |
| commit | f229710d41e85752bc1a835bae56c055a62813d9 (patch) | |
| tree | 217d476c6209b4a014a1aa7a05293bb6c325d103 /src | |
| parent | e9d4f119da48fe119d9d7a6d1b9a054c043bd517 (diff) | |
| download | emacs-f229710d41e85752bc1a835bae56c055a62813d9.tar.gz emacs-f229710d41e85752bc1a835bae56c055a62813d9.zip | |
Implement new DND features on GNUstep
* lisp/term/ns-win.el (ns-drag-n-drop): Handle special `lambda'
drag-n-drop events.
* src/nsterm.m: ([EmacsView wantsPeriodicDraggingUpdates]):
([EmacsView draggingUpdated:]): New functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nsterm.m b/src/nsterm.m index fd56094c28b..f4c1e08925c 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -8056,6 +8056,37 @@ not_in_argv (NSString *arg) | |||
| 8056 | return YES; | 8056 | return YES; |
| 8057 | } | 8057 | } |
| 8058 | 8058 | ||
| 8059 | - (BOOL) wantsPeriodicDraggingUpdates | ||
| 8060 | { | ||
| 8061 | return YES; | ||
| 8062 | } | ||
| 8063 | |||
| 8064 | - (NSDragOperation) draggingUpdated: (id <NSDraggingInfo>) sender | ||
| 8065 | { | ||
| 8066 | struct input_event ie; | ||
| 8067 | NSPoint position; | ||
| 8068 | int x, y; | ||
| 8069 | |||
| 8070 | EVENT_INIT (ie); | ||
| 8071 | ie.kind = DRAG_N_DROP_EVENT; | ||
| 8072 | |||
| 8073 | /* Get rid of mouse face. */ | ||
| 8074 | [self mouseExited: [[self window] currentEvent]]; | ||
| 8075 | |||
| 8076 | position = [self convertPoint: [sender draggingLocation] | ||
| 8077 | fromView: nil]; | ||
| 8078 | x = lrint (position.x); | ||
| 8079 | y = lrint (position.y); | ||
| 8080 | |||
| 8081 | XSETINT (ie.x, x); | ||
| 8082 | XSETINT (ie.y, y); | ||
| 8083 | XSETFRAME (ie.frame_or_window, emacsframe); | ||
| 8084 | ie.arg = Qlambda; | ||
| 8085 | ie.modifiers = 0; | ||
| 8086 | |||
| 8087 | kbd_buffer_store_event (&ie); | ||
| 8088 | return NSDragOperationGeneric; | ||
| 8089 | } | ||
| 8059 | 8090 | ||
| 8060 | -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender | 8091 | -(BOOL)performDragOperation: (id <NSDraggingInfo>) sender |
| 8061 | { | 8092 | { |