aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergiusz Urbaniak <sergiusz.urbaniak@gmail.com>2015-01-03 14:15:12 +0100
committerRuss Cox <rsc@google.com>2015-06-03 15:31:21 +0000
commitfdf6ef333705c844bcf3ccf2f93b2773f1a6aa41 (patch)
tree85ccc6122c971384b97dd1cd61e2fc3d38602e99
parentd52bdd3356137cf67a3458fdee5c94fdec4337e1 (diff)
downloadplan9port-fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41.tar.gz
plan9port-fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41.tar.bz2
plan9port-fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41.zip
acme: add focus change to log
Currently new, put and del events are being logged. This patch adds a focus event to the log whenever the user changes the focus to another window. This lets programs react to files being edited in acme without the need of being restarted. Change-Id: Idf35c0d7dbfca30e79724dc9f49e44c6a4eb6a1e Reviewed-on: https://plan9port-review.googlesource.com/1140 Reviewed-by: Russ Cox <rsc@google.com>
-rw-r--r--src/cmd/acme/acme.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
index c45bc28d..2f4fe3ab 100644
--- a/src/cmd/acme/acme.c
+++ b/src/cmd/acme/acme.c
@@ -571,6 +571,12 @@ mousethread(void *v)
m = mousectl->m;
qlock(&row.lk);
t = rowwhich(&row, m.xy);
+
+ if((t!=mousetext && t!=nil && t->w!=nil) &&
+ (mousetext==nil || mousetext->w==nil || t->w->id!=mousetext->w->id)) {
+ xfidlog(t->w, "focus");
+ }
+
if(t!=mousetext && mousetext!=nil && mousetext->w!=nil){
winlock(mousetext->w, 'M');
mousetext->eq0 = ~0;