From: Michael D. Lowis Date: Fri, 3 Feb 2017 14:13:34 +0000 (-0500) Subject: Fixed an issue where dragging with the left button would change the selection in... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=a6dc7dd2bc60f1cb3b68b96afd05e286fa234417;p=projs%2Ftide.git Fixed an issue where dragging with the left button would change the selection in multiple regions --- diff --git a/xedit.c b/xedit.c index 1d2b0a0..8295dae 100644 --- a/xedit.c +++ b/xedit.c @@ -212,18 +212,19 @@ int main(int argc, char** argv) { static void mouse_handler(MouseAct act, MouseBtn btn, int x, int y) { enum RegionId id = getregion(x, y); - if (id != TAGS && id != EDIT) return; - if (Focused != id) Focused = id; size_t row = (y-Regions[id].y) / x11_font_height(Font); size_t col = (x-Regions[id].x) / x11_font_width(Font); if (act == MOUSE_ACT_MOVE) { if (MouseBtns[MOUSE_BTN_LEFT].pressed) { + enum RegionId region = MouseBtns[MOUSE_BTN_LEFT].region; if (MouseBtns[MOUSE_BTN_LEFT].count == 1) { - view_setcursor(getview(id), row, col); + view_setcursor(getview(region), row, col); MouseBtns[MOUSE_BTN_LEFT].count = 0; } else { - view_selext(getview(id), row, col); + view_selext(getview(region), row, col); } + } else if (id == TAGS || id == EDIT) { + Focused = id; } } else { MouseBtns[btn].pressed = (act == MOUSE_ACT_DOWN);