diff options
author | 2011-08-18 21:03:06 -0400 | |
---|---|---|
committer | 2011-08-18 21:03:06 -0400 | |
commit | e7a4d0ef3ae5c34a0b7ff9bc5b1466e700cc56a4 (patch) | |
tree | 6a495f9da7d97ebc4e067e12e14bf8ff94f48d7a /src/textadept.c | |
parent | 1c454b71dc571eb5b936903055ab420d845aa555 (diff) | |
download | textadept-e7a4d0ef3ae5c34a0b7ff9bc5b1466e700cc56a4.tar.gz textadept-e7a4d0ef3ae5c34a0b7ff9bc5b1466e700cc56a4.zip |
Fixed split view focus bug with the same buffer in two views; src/textadept.c
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/textadept.c b/src/textadept.c index f590bc90..67d76a79 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -521,10 +521,15 @@ static void switch_to_view(GtkWidget *editor) { static void s_notification(GtkWidget *editor, gint wParam, gpointer lParam, gpointer udata) { struct SCNotification *n = (struct SCNotification *)lParam; - if (focused_editor != editor && - (n->nmhdr.code == SCN_URIDROPPED || n->nmhdr.code == SCN_SAVEPOINTLEFT)) + if (focused_editor == editor || n->nmhdr.code == SCN_URIDROPPED) { + if (focused_editor != editor) switch_to_view(editor); + l_emit_scnnotification(n); + } else if (n->nmhdr.code == SCN_SAVEPOINTLEFT) { + GtkWidget *prev = focused_editor; switch_to_view(editor); - l_emit_scnnotification(n); + l_emit_scnnotification(n); + switch_to_view(prev); // do not let a split view steal focus + } } /** |