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,14 +1032,14 @@ not away." ...@@ -1032,14 +1032,14 @@ not away."
read-frame-command will handle it and save the input line.")) read-frame-command will handle it and save the input line."))
#+mcclim #+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 "Unportable method for saving the current input buffer in case
the user invokes a command while typing." the user invokes a command while typing."
(let* ((x (pointer-event-x event)) (let* ((x (pointer-event-x event))
(y (pointer-event-y event)) (y (pointer-event-y event))
(window (event-sheet event)) (window (event-sheet event))
(presentation (frame-find-innermost-applicable-presentation frame *input-context* stream x y :event event))) (presentation (frame-find-innermost-applicable-presentation frame *input-context* stream x y :event event)))
(when presentation (if presentation
(multiple-value-bind (p translator context) (multiple-value-bind (p translator context)
(climi::find-innermost-presentation-match *input-context* (climi::find-innermost-presentation-match *input-context*
presentation presentation
...@@ -1049,7 +1049,7 @@ the user invokes a command while typing." ...@@ -1049,7 +1049,7 @@ the user invokes a command while typing."
event event
0 0
nil) nil)
(when p (if p
(multiple-value-bind (object ptype options) (multiple-value-bind (object ptype options)
(call-presentation-translator translator (call-presentation-translator translator
p p
...@@ -1058,12 +1058,14 @@ the user invokes a command while typing." ...@@ -1058,12 +1058,14 @@ the user invokes a command while typing."
event event
window window
x y) x y)
(declare (ignore object options)) (when ptype
(when (and ptype (presentation-subtypep ptype 'command) (when (and (presentation-subtypep ptype 'command)
(boundp 'climi::*current-input-stream*) climi::*current-input-stream*) (boundp 'climi::*current-input-stream*) climi::*current-input-stream*)
(restart-case (signal 'invoked-command-by-clicking) (restart-case (signal 'invoked-command-by-clicking)
(acknowledged ())))))))) (acknowledged ())))
(call-next-method)) (funcall (cdr context) object ptype event options)))
(call-next-method)))
(call-next-method))))
(defmethod read-frame-command ((frame beirc) &key (stream *standard-input*)) (defmethod read-frame-command ((frame beirc) &key (stream *standard-input*))
(let ((bad-input nil)) (let ((bad-input nil))
...@@ -1108,6 +1110,7 @@ the user invokes a command while typing." ...@@ -1108,6 +1110,7 @@ the user invokes a command while typing."
(simple-completion-error (c) (simple-completion-error (c)
#+mcclim #+mcclim
(let ((preliminary-line (save-input-line stream frame))) (let ((preliminary-line (save-input-line stream frame)))
(when (current-receiver frame)
(setf (incomplete-input (current-receiver frame)) (setf (incomplete-input (current-receiver frame))
(subseq preliminary-line 0 (subseq preliminary-line 0
(search (climi::completion-error-input-so-far c) (search (climi::completion-error-input-so-far c)
...@@ -1115,7 +1118,7 @@ the user invokes a command while typing." ...@@ -1115,7 +1118,7 @@ the user invokes a command while typing."
bad-input (subseq preliminary-line bad-input (subseq preliminary-line
(search (climi::completion-error-input-so-far c) (search (climi::completion-error-input-so-far c)
preliminary-line)) preliminary-line))
force-restore-input-state t)) force-restore-input-state t)))
(beep) (beep)
nil))) nil)))
(t (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