| src/ActionHandler.cc | |
| 659 | @@ -659,27 +659,17 @@ |
| 659 | |
| 660 | // find the focused window object |
| 661 | PWinObj *fo_wo = 0; |
| 662 | if (PWinObj::getFocusedPWinObj()) { |
| 663 | if (PWinObj::getFocusedPWinObj()->getType() == PWinObj::WO_CLIENT) { |
| 664 | fo_wo = PWinObj::getFocusedPWinObj()->getParent(); |
| 665 | |
| 666 | list<PMenu::Item*>::iterator it(menu->m_begin()); |
| 667 | for (; it != menu->m_end(); ++it) { |
| 668 | if ((*it)->getWORef() == fo_wo) { |
| 669 | menu->selectItem(it); |
| 670 | break; |
| 671 | } |
| 672 | } |
| 673 | fo_wo->setFocused(false); |
| 674 | if (PWinObj::isFocusedPWinObj(PWinObj::WO_CLIENT)) { |
| 675 | fo_wo = PWinObj::getFocusedPWinObj()->getParent(); |
| 676 | |
| 677 | } else { |
| 678 | #ifdef DEBUG |
| 679 | cerr << __FILE__ << "@" << __LINE__ << ": " |
| 680 | << "ActionHandler(" << this << ")::actionFocusToggle(" |
| 681 | << button << "," << raise << "," << off << "," << mru << ")" |
| 682 | << endl << " *** focused PWinObj != WO_FRAME" << endl; |
| 683 | #endif // DEBUG |
| 684 | list<PMenu::Item*>::iterator it(menu->m_begin()); |
| 685 | for (; it != menu->m_end(); ++it) { |
| 686 | if ((*it)->getWORef() == fo_wo) { |
| 687 | menu->selectItem(it); |
| 688 | break; |
| 689 | } |
| 690 | } |
| 691 | fo_wo->setFocused(false); |
| 692 | } |
| 693 | |
| 694 | if (Config::instance()->getShowFrameList()) { |
| ... | |
| src/PWinObj.hh | |
| 52 | @@ -52,6 +52,10 @@ |
| 52 | static inline void setFocusedPWinObj(PWinObj *wo) { _focused_wo = wo; } |
| 53 | //! @brief Sets the PWinObj representing the root Window. |
| 54 | static inline void setRootPWinObj(PWinObj *wo) { _root_wo = wo; } |
| 55 | //! @brief Checks if focused window is of type |
| 56 | static inline bool isFocusedPWinObj(Type type) { |
| 57 | return _focused_wo ? _focused_wo->getType() == type : false; |
| 58 | } |
| 59 | |
| 60 | //! @brief Searches for the PWinObj matching Window win. |
| 61 | //! @param win Window to match PWinObjs against. |
| ... | |
| src/WindowManager.cc | |
| 1214 | @@ -1214,7 +1214,8 @@ |
| 1214 | #endif // HARBOUR |
| 1215 | |
| 1216 | if (wo_type != PWinObj::WO_MENU |
| 1217 | && wo_type != PWinObj::WO_CMD_DIALOG && wo_type != PWinObj::WO_SEARCH_DIALOG |
| 1218 | && wo_type != PWinObj::WO_CMD_DIALOG |
| 1219 | && wo_type != PWinObj::WO_SEARCH_DIALOG |
| 1220 | && ! PWinObj::getFocusedPWinObj()) { |
| 1221 | findWOAndFocus(wo_search); |
| 1222 | } |
| ... | |
| 1961 | @@ -1960,11 +1961,7 @@ |
| 1961 | void |
| 1962 | WindowManager::hideAllMenus(void) |
| 1963 | { |
| 1963 | bool do_focus = false; |
| 1964 | PWinObj *wo = PWinObj::getFocusedPWinObj(); |
| 1965 | if (wo && wo->getType() == PWinObj::WO_MENU) { |
| 1966 | do_focus = true; |
| 1967 | } |
| 1969 | bool do_focus = PWinObj::isFocusedPWinObj(PWinObj::WO_MENU); |
| 1970 | |
| 1971 | map<std::string, PMenu*>::iterator it(_menu_map.begin()); |
| 1972 | for (; it != _menu_map.end(); ++it) { |
| ... | |