summaryrefslogtreecommitdiff
path: root/src/ui/mediaui.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-07-23 14:58:42 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-07-23 14:58:42 +0300
commit99d980b5867b277d15d39731eb235bfa9695268e (patch)
treea5b332341bd119b7717af333b4f4381641c0c258 /src/ui/mediaui.c
parentbb401db8b648e6bc3d3f93281031b3164159bf1a (diff)
Window: Mouse wheel events vs. split mode
Only process mouse wheel events on the root over which the mouse is currently.
Diffstat (limited to 'src/ui/mediaui.c')
-rw-r--r--src/ui/mediaui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/mediaui.c b/src/ui/mediaui.c
index 22924876..b622a554 100644
--- a/src/ui/mediaui.c
+++ b/src/ui/mediaui.c
@@ -62,7 +62,7 @@ void init_PlayerUI(iPlayerUI *d, const iPlayer *player, iRect bounds) {
62} 62}
63 63
64static void drawPlayerButton_(iPaint *p, iRect rect, const char *label, int font) { 64static void drawPlayerButton_(iPaint *p, iRect rect, const char *label, int font) {
65 const iInt2 mouse = mouseCoord_Window(get_Window()); 65 const iInt2 mouse = mouseCoord_Window(get_Window(), 0);
66 const iBool isHover = contains_Rect(rect, mouse); 66 const iBool isHover = contains_Rect(rect, mouse);
67 const iBool isPressed = isHover && (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LEFT) != 0; 67 const iBool isPressed = isHover && (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LEFT) != 0;
68 const int frame = (isPressed ? uiTextCaution_ColorId : isHover ? uiHeading_ColorId : uiAnnotation_ColorId); 68 const int frame = (isPressed ? uiTextCaution_ColorId : isHover ? uiHeading_ColorId : uiAnnotation_ColorId);
@@ -159,7 +159,7 @@ void draw_PlayerUI(iPlayerUI *d, iPaint *p) {
159 dot); 159 dot);
160 /* Volume adjustment. */ 160 /* Volume adjustment. */
161 if (isAdjusting) { 161 if (isAdjusting) {
162 const iInt2 mouse = mouseCoord_Window(get_Window()); 162 const iInt2 mouse = mouseCoord_Window(get_Window(), 0);
163 const iBool isHover = contains_Rect(d->volumeRect, mouse) && 163 const iBool isHover = contains_Rect(d->volumeRect, mouse) &&
164 ~flags_Player(d->player) & volumeGrabbed_PlayerFlag; 164 ~flags_Player(d->player) & volumeGrabbed_PlayerFlag;
165 const iBool isPressed = (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LEFT) != 0; 165 const iBool isPressed = (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LEFT) != 0;