From: Michael D. Lowis Date: Fri, 16 Jun 2017 13:58:44 +0000 (-0400) Subject: Fixed bug preventing scroll region from working properly X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=5a71803526ae05baf7305d890be16008856c36ad;p=projs%2Ftide.git Fixed bug preventing scroll region from working properly --- diff --git a/lib/win.c b/lib/win.c index 7c5297e..5744607 100644 --- a/lib/win.c +++ b/lib/win.c @@ -343,9 +343,9 @@ static void onmousedrag(int state, int x, int y) { } static void onmousebtn(int btn, bool pressed, int x, int y) { - if (x < Regions[Focused].x) - x = Regions[Focused].x; WinRegion id = getregion(x, y); + if (id == FOCUSED && x < Regions[Focused].x) + id = Focused, x = Regions[Focused].x; size_t row = (y-Regions[id].y) / x11_font_height(Font); size_t col = (x-Regions[id].x) / x11_font_width(Font);