summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c1
-rw-r--r--src/ui/window.c7
-rw-r--r--src/ui/window.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 8e4e2752..b6f3b5ce 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2683,6 +2683,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
2683 updateSize_DocumentWidget(d); 2683 updateSize_DocumentWidget(d);
2684 showOrHidePinningIndicator_DocumentWidget_(d); 2684 showOrHidePinningIndicator_DocumentWidget_(d);
2685 updateFetchProgress_DocumentWidget_(d); 2685 updateFetchProgress_DocumentWidget_(d);
2686 updateHover_Window(window_Widget(w));
2686 } 2687 }
2687 init_Anim(&d->sideOpacity, 0); 2688 init_Anim(&d->sideOpacity, 0);
2688 init_Anim(&d->altTextOpacity, 0); 2689 init_Anim(&d->altTextOpacity, 0);
diff --git a/src/ui/window.c b/src/ui/window.c
index 83dae427..352b0797 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -952,6 +952,10 @@ static void applyCursor_Window_(iWindow *d) {
952 } 952 }
953} 953}
954 954
955void updateHover_Window(iWindow *d) {
956 d->hover = hitChild_Window(d, mouseCoord_Window(d, 0));
957}
958
955iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { 959iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
956 iMainWindow *mw = (type_Window(d) == main_WindowType ? as_MainWindow(d) : NULL); 960 iMainWindow *mw = (type_Window(d) == main_WindowType ? as_MainWindow(d) : NULL);
957 switch (ev->type) { 961 switch (ev->type) {
@@ -1149,6 +1153,9 @@ iBool dispatchEvent_Window(iWindow *d, const SDL_Event *ev) {
1149} 1153}
1150 1154
1151iAnyObject *hitChild_Window(const iWindow *d, iInt2 coord) { 1155iAnyObject *hitChild_Window(const iWindow *d, iInt2 coord) {
1156 if (coord.x < 0 || coord.y < 0) {
1157 return NULL;
1158 }
1152 iForIndices(i, d->roots) { 1159 iForIndices(i, d->roots) {
1153 if (d->roots[i]) { 1160 if (d->roots[i]) {
1154 iAnyObject *hit = hitChild_Widget(d->roots[i]->widget, coord); 1161 iAnyObject *hit = hitChild_Widget(d->roots[i]->widget, coord);
diff --git a/src/ui/window.h b/src/ui/window.h
index 81fc2c06..6c921f09 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -146,6 +146,7 @@ void setUiScale_Window (iWindow *, float uiScale);
146void setCursor_Window (iWindow *, int cursor); 146void setCursor_Window (iWindow *, int cursor);
147iBool setKeyRoot_Window (iWindow *, iRoot *root); 147iBool setKeyRoot_Window (iWindow *, iRoot *root);
148iBool postContextClick_Window (iWindow *, const SDL_MouseButtonEvent *); 148iBool postContextClick_Window (iWindow *, const SDL_MouseButtonEvent *);
149void updateHover_Window (iWindow *);
149 150
150iWindow * get_Window (void); 151iWindow * get_Window (void);
151iBool isOpenGLRenderer_Window (void); 152iBool isOpenGLRenderer_Window (void);