]> git.mdlowis.com Git - projs/tide.git/commitdiff
keep focus in tag region when it collapses
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 21 May 2019 17:22:55 +0000 (13:22 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 21 May 2019 17:22:55 +0000 (13:22 -0400)
TODO.md
src/tide.c

diff --git a/TODO.md b/TODO.md
index 79e52aba08d22c11c18c75c3f2c61e0f82c02f9f..06bae82a2d05cebf48a38c8c0ca892982d9bc8b3 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -4,7 +4,6 @@
 
 ## STAGING
 
-* tide: move mouse when tag region collapses
 * tfetch: read rules from rcfile in home and curr dir
 * tfetch: ls results instead of pcmanfm on right click directory
 * tide: gap buffer does not handle UTF-8 currently
index 53f3e91ab4ec023811747c1c67536855240a853b..e590bacdf63221e4222423264b9f0d9d30fdd04a 100644 (file)
@@ -192,6 +192,7 @@ static void xredraw(XConf* x) {
     size_t tagregsz = (tagrows * x->tagfont->height) + 7;
     size_t editrows = (x->height - tagregsz) / x->font->height ;
     /* draw the regions to the window */
+    int olddiv = Divider;
     drawcsr csr = { .w = x->width, .h = x->height };
     csr.x += ScrollWidth + 1;
     draw_statbox(x, win_view(EDIT)->buffer.status);
@@ -203,6 +204,11 @@ static void xredraw(XConf* x) {
     draw_rect(x, WinBdr, x->width-1, 0,  1, x->height);
     XCopyArea(x->display, x->pixmap, x->self, x->gc, 0, 0, x->width, x->height, 0, 0);
     SyncMouse = false;
+    if (Divider < olddiv && Focused == TAGS) {
+        int ptrx = 0, ptry = 0;
+        x11_getptr(x, &ptrx, &ptry);
+        XWarpPointer(X.display, X.self, X.self, 0, 0, X.width, X.height, ptrx, Divider-2);
+    }
     XFlush(x->display);
 }