Commit c9327695 authored by Andreas Fuchs's avatar Andreas Fuchs

Apply patch by Troels Henriksen to not handle events twice in some situations.

parent 5f55c93b
......@@ -1032,38 +1032,40 @@ not away."
read-frame-command will handle it and save the input line."))
#+mcclim
(defmethod frame-input-context-button-press-handler :around ((frame beirc) stream event)
(defmethod frame-input-context-button-press-handler ((frame beirc) stream event)
"Unportable method for saving the current input buffer in case
the user invokes a command while typing."
(let* ((x (pointer-event-x event))
(y (pointer-event-y event))
(window (event-sheet event))
(presentation (frame-find-innermost-applicable-presentation frame *input-context* stream x y :event event)))
(when presentation
(multiple-value-bind (p translator context)
(climi::find-innermost-presentation-match *input-context*
presentation
*application-frame*
(event-sheet event)
x y
event
0
nil)
(when p
(multiple-value-bind (object ptype options)
(call-presentation-translator translator
p
(input-context-type context)
*application-frame*
event
window
x y)
(declare (ignore object options))
(when (and ptype (presentation-subtypep ptype 'command)
(boundp 'climi::*current-input-stream*) climi::*current-input-stream*)
(restart-case (signal 'invoked-command-by-clicking)
(acknowledged ()))))))))
(call-next-method))
(if presentation
(multiple-value-bind (p translator context)
(climi::find-innermost-presentation-match *input-context*
presentation
*application-frame*
(event-sheet event)
x y
event
0
nil)
(if p
(multiple-value-bind (object ptype options)
(call-presentation-translator translator
p
(input-context-type context)
*application-frame*
event
window
x y)
(when ptype
(when (and (presentation-subtypep ptype 'command)
(boundp 'climi::*current-input-stream*) climi::*current-input-stream*)
(restart-case (signal 'invoked-command-by-clicking)
(acknowledged ())))
(funcall (cdr context) object ptype event options)))
(call-next-method)))
(call-next-method))))
(defmethod read-frame-command ((frame beirc) &key (stream *standard-input*))
(let ((bad-input nil))
......@@ -1108,14 +1110,15 @@ the user invokes a command while typing."
(simple-completion-error (c)
#+mcclim
(let ((preliminary-line (save-input-line stream frame)))
(setf (incomplete-input (current-receiver frame))
(subseq preliminary-line 0
(search (climi::completion-error-input-so-far c)
preliminary-line))
bad-input (subseq preliminary-line
(search (climi::completion-error-input-so-far c)
preliminary-line))
force-restore-input-state t))
(when (current-receiver frame)
(setf (incomplete-input (current-receiver frame))
(subseq preliminary-line 0
(search (climi::completion-error-input-so-far c)
preliminary-line))
bad-input (subseq preliminary-line
(search (climi::completion-error-input-so-far c)
preliminary-line))
force-restore-input-state t)))
(beep)
nil)))
(t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment