summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-10 13:43:41 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-10 13:43:41 +0300
commit22f1d02ff1d9c7ee89a80969f2122968b9b5e1fe (patch)
treeccf0174fbd9b2a57589731ac0e30765b445b6032 /src/ui/documentwidget.c
parent4e8977f5734663956613caac058849273c4e5ac0 (diff)
Touch: Improved hover behavior
Scrolling must prevent the hover state from being updated both in documents and lists.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index c3a6d40d..e18d5283 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2585,7 +2585,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2585 return iTrue; 2585 return iTrue;
2586 } 2586 }
2587 else if (ev->type == SDL_MOUSEMOTION) { 2587 else if (ev->type == SDL_MOUSEMOTION) {
2588 if (deviceType_App() == desktop_AppDeviceType) { 2588 if (ev->motion.which != SDL_TOUCH_MOUSEID) {
2589 iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iFalse); 2589 iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iFalse);
2590 } 2590 }
2591 const iInt2 mpos = init_I2(ev->motion.x, ev->motion.y); 2591 const iInt2 mpos = init_I2(ev->motion.x, ev->motion.y);
@@ -2763,6 +2763,10 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2763 if (d->grabbedPlayer) { 2763 if (d->grabbedPlayer) {
2764 return iTrue; 2764 return iTrue;
2765 } 2765 }
2766 if (d->flags & noHoverWhileScrolling_DocumentWidgetFlag) {
2767 d->flags &= ~noHoverWhileScrolling_DocumentWidgetFlag;
2768 updateHover_DocumentWidget_(d, mouseCoord_Window(get_Window()));
2769 }
2766 iChangeFlags(d->flags, selecting_DocumentWidgetFlag, iFalse); 2770 iChangeFlags(d->flags, selecting_DocumentWidgetFlag, iFalse);
2767 iChangeFlags(d->flags, selectWords_DocumentWidgetFlag, d->click.count == 2); 2771 iChangeFlags(d->flags, selectWords_DocumentWidgetFlag, d->click.count == 2);
2768 iChangeFlags(d->flags, selectLines_DocumentWidgetFlag, d->click.count >= 3); 2772 iChangeFlags(d->flags, selectLines_DocumentWidgetFlag, d->click.count >= 3);