diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/documentwidget.c | 1 | ||||
-rw-r--r-- | src/ui/window.c | 7 | ||||
-rw-r--r-- | src/ui/window.h | 1 |
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 | ||
955 | void updateHover_Window(iWindow *d) { | ||
956 | d->hover = hitChild_Window(d, mouseCoord_Window(d, 0)); | ||
957 | } | ||
958 | |||
955 | iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | 959 | iBool 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 | ||
1151 | iAnyObject *hitChild_Window(const iWindow *d, iInt2 coord) { | 1155 | iAnyObject *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); | |||
146 | void setCursor_Window (iWindow *, int cursor); | 146 | void setCursor_Window (iWindow *, int cursor); |
147 | iBool setKeyRoot_Window (iWindow *, iRoot *root); | 147 | iBool setKeyRoot_Window (iWindow *, iRoot *root); |
148 | iBool postContextClick_Window (iWindow *, const SDL_MouseButtonEvent *); | 148 | iBool postContextClick_Window (iWindow *, const SDL_MouseButtonEvent *); |
149 | void updateHover_Window (iWindow *); | ||
149 | 150 | ||
150 | iWindow * get_Window (void); | 151 | iWindow * get_Window (void); |
151 | iBool isOpenGLRenderer_Window (void); | 152 | iBool isOpenGLRenderer_Window (void); |