t-suw****@users*****
t-suw****@users*****
2007年 11月 11日 (日) 01:54:25 JST
Index: AquaSKK/ChangeLog diff -u AquaSKK/ChangeLog:1.52 AquaSKK/ChangeLog:1.53 --- AquaSKK/ChangeLog:1.52 Sat Nov 10 20:05:05 2007 +++ AquaSKK/ChangeLog Sun Nov 11 01:54:24 2007 @@ -1,3 +1,8 @@ +2007-11-11 Tomotaka SUWA <t.suw****@mac*****> + + * KanjiConversionMode.cpp: ãã«ãæ¤ç´¢ã¨ Spotlight æ¤ç´¢ã§åè£ã¦ã£ã³ + ãã¦ãåé¢ã«è¡¨ç¤ºãããªãä¸å ·åãä¿®æ£ã + 2007-11-10 Tomotaka SUWA <t.suw****@mac*****> * CandidatesManager.mm: ã¦ã£ã³ãã¦ã¬ãã«ã«å¯¾å¿ã Index: AquaSKK/KanjiConversionMode.cpp diff -u AquaSKK/KanjiConversionMode.cpp:1.16 AquaSKK/KanjiConversionMode.cpp:1.17 --- AquaSKK/KanjiConversionMode.cpp:1.16 Sat Nov 10 20:05:05 2007 +++ AquaSKK/KanjiConversionMode.cpp Sun Nov 11 01:54:25 2007 @@ -1,5 +1,5 @@ /* - $Id: KanjiConversionMode.cpp,v 1.16 2007/11/10 11:05:05 t-suwa Exp $ + $Id: KanjiConversionMode.cpp,v 1.17 2007/11/10 16:54:25 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -1147,6 +1147,42 @@ current_candidate_index, candidates.size(), mode); } +SInt32 getCandidatesWindowLevel(const Point& pt) { + WindowRef active; + SInt32 level; + + // ã«ã¼ã½ã«ä½ç½®ã®ã¦ã£ã³ãã¦ãåå¾ + switch(FindWindow(pt, &active)) { + case inMenuBar: // ãã«ãæ¤ç´¢ + return kCGMainMenuWindowLevel + 1; + + case inContent: // Carbon ã¦ã£ã³ã㦠+ GetWindowGroupLevel(GetWindowGroup(active), &level); + return level + 1; + } + + // ããã©ã«ãã®ã¦ã£ã³ãã¦ã¬ãã« + level = kCGFloatingWindowLevel; + + // Spotlight ã®å ´åã¯ç¹å¥ã«å¦ç + CFBundleRef mainBundle = CFBundleGetMainBundle(); + if(mainBundle) { + CFRetain(mainBundle); + CFStringRef id = CFBundleGetIdentifier(mainBundle); + CFRelease(mainBundle); + + if(id) { + CFRetain(id); + if(CFStringCompare(id, CFSTR("com.apple.spotlight"), kCFCompareCaseInsensitive) == 0) { + level = kCGPopUpMenuWindowLevel; + } + CFRelease(id); + } + } + + return level; +} + // éã¡ã³ã void openCandidatesWindow(const CppCFString& str_candidates, unsigned& window_id, @@ -1167,15 +1203,9 @@ SInt16 qd_x = offset_to_pos_params.fReplyPoint.h; SInt16 qd_y = offset_to_pos_params.fReplyPoint.v; - // Carbon ã¢ããªã§åè£ã¦ã£ã³ãã¦ãå¾ãã«åãã®ãé²ã - SInt32 level; - if(WindowRef active = ActiveNonFloatingWindow()) { - GetWindowGroupLevel(GetWindowGroup(active), &level); - ++ level; - } else { - level = kCGFloatingWindowLevel; - } - + // åè£ã¦ã£ã³ãã¦ã®ã¬ãã«ãåå¾ + SInt32 level = getCandidatesWindowLevel(offset_to_pos_params.fReplyPoint); + // ãµã¼ãã¼ã«éãä»ããCFDataãä½æã CppCFData cands_to_be_attached; cands_to_be_attached.own(str_candidates.toCFData());