File tree Expand file tree Collapse file tree 1 file changed +16
-18
lines changed
Expand file tree Collapse file tree 1 file changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -937,26 +937,24 @@ namespace fluent_tray
937937 }
938938
939939 POINT pos ;
940- if (!GetCursorPos (&pos)) {
941- return false ;
942- }
943-
944- if (pos.x != previous_mouse_pos_.x || pos.y != previous_mouse_pos_.y ) {
945- // The mouse cursor is moved, so switch to the mouse-mode.
946- for (int i = 0 ; i < static_cast <int >(menus_.size ()) ; i ++) {
947- auto & menu = menus_[i] ;
948- auto detected_hwnd = WindowFromPoint (pos) ;
949- if (!detected_hwnd) {
950- return false ;
951- }
952- // Checks whether the mouse cursor is over the menu or not.
953- if (detected_hwnd == menu.window_handle ()) {
954- // Start selection by key from the currently selected menu.
955- select_index_ = i ;
956- break ;
940+ if (GetCursorPos (&pos)) {
941+ if (pos.x != previous_mouse_pos_.x || pos.y != previous_mouse_pos_.y ) {
942+ // The mouse cursor is moved, so switch to the mouse-mode.
943+ for (int i = 0 ; i < static_cast <int >(menus_.size ()) ; i ++) {
944+ auto & menu = menus_[i] ;
945+ auto detected_hwnd = WindowFromPoint (pos) ;
946+ if (!detected_hwnd) {
947+ return false ;
948+ }
949+ // Checks whether the mouse cursor is over the menu or not.
950+ if (detected_hwnd == menu.window_handle ()) {
951+ // Start selection by key from the currently selected menu.
952+ select_index_ = i ;
953+ break ;
954+ }
957955 }
956+ previous_mouse_pos_ = pos ;
958957 }
959- previous_mouse_pos_ = pos ;
960958 }
961959
962960 if (select_index_ < 0 ) {
You can’t perform that action at this time.
0 commit comments