src/video/windows/SDL_windowsevents.c
changeset 10379 84be6396b68b
parent 10377 7fde2d881171
child 10387 3b789a491509
equal deleted inserted replaced
10378:cb7f88c92a2e 10379:84be6396b68b
   196     }
   196     }
   197 
   197 
   198     return code;
   198     return code;
   199 }
   199 }
   200 
   200 
       
   201 static SDL_bool
       
   202 WIN_ShouldIgnoreFocusClick()
       
   203 {
       
   204     const char *hint = "1";//SDL_GetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH);
       
   205     return (!hint || (*hint == '0')) ? SDL_TRUE : SDL_FALSE;
       
   206 }
   201 
   207 
   202 void
   208 void
   203 WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID)
   209 WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, SDL_bool bSDLMousePressed, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID)
   204 {
   210 {
   205     if (data->focus_click_pending & SDL_BUTTON(button)) {
   211     if (data->focus_click_pending & SDL_BUTTON(button)) {
   208             data->focus_click_pending &= ~SDL_BUTTON(button);
   214             data->focus_click_pending &= ~SDL_BUTTON(button);
   209             if (!data->focus_click_pending) {
   215             if (!data->focus_click_pending) {
   210                 WIN_UpdateClipCursor(data->window);
   216                 WIN_UpdateClipCursor(data->window);
   211             }
   217             }
   212         }
   218         }
   213         return;
   219         if (WIN_ShouldIgnoreFocusClick()) {
       
   220             return;
       
   221         }
   214     }
   222     }
   215 
   223 
   216     if (bwParamMousePressed && !bSDLMousePressed) {
   224     if (bwParamMousePressed && !bSDLMousePressed) {
   217         SDL_SendMouseButton(data->window, mouseID, SDL_PRESSED, button);
   225         SDL_SendMouseButton(data->window, mouseID, SDL_PRESSED, button);
   218     } else if (!bwParamMousePressed && bSDLMousePressed) {
   226     } else if (!bwParamMousePressed && bSDLMousePressed) {