• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン5419 (tree)
日時2013-11-17 22:54:22
作者(del#1144)

ログメッセージ

ウィンドウリサイズ中のツールチップの座標がマイナスのとき、強制的にプライマリモニタに表示される問題を修正

マルチモニタ API を利用して有効な座標かチェックする
無効な座標の場合はマウスのあるモニタに表示する
http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=32424

変更サマリ

差分

--- trunk/teraterm/teraterm/vtwin.cpp (revision 5418)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 5419)
@@ -2545,6 +2545,8 @@
25452545 SIZE sz;
25462546 RECT wr;
25472547 int ix, iy;
2548+ HMODULE mod;
2549+ HMONITOR hm;
25482550
25492551 /* calculate the tip's size */
25502552
@@ -2555,14 +2557,44 @@
25552557 GetWindowRect(src, &wr);
25562558
25572559 ix = wr.left;
2558- if (ix < 16) {
2559- ix = 16;
2560- }
2560+ iy = wr.top - sz.cy;
25612561
2562- iy = wr.top - sz.cy;
2563- if (iy < 16) {
2564- iy = 16;
2562+ if (((mod = GetModuleHandle("user32.dll")) != NULL) &&
2563+ (GetProcAddress(mod,"MonitorFromPoint") != NULL)) {
2564+ // マルチモニタがサポートされている場合
2565+ POINT p;
2566+ p.x = ix;
2567+ p.y = iy;
2568+ hm = MonitorFromPoint(p, MONITOR_DEFAULTTONULL);
2569+ if (hm == NULL) {
2570+#if 1
2571+ // ツールチップがスクリーンからはみ出している場合はマウスのあるモニタに表示する
2572+ GetCursorPos(&p);
2573+ hm = MonitorFromPoint(p, MONITOR_DEFAULTTONEAREST);
2574+#else
2575+ // ツールチップがスクリーンからはみ出している場合は最も近いモニタに表示する
2576+ hm = MonitorFromPoint(p, MONITOR_DEFAULTTONEAREST);
2577+#endif
2578+ }
2579+ MONITORINFO mi;
2580+ mi.cbSize = sizeof(MONITORINFO);
2581+ GetMonitorInfo(hm, &mi);
2582+ if (ix < mi.rcMonitor.left + 16) {
2583+ ix = mi.rcMonitor.left + 16;
2584+ }
2585+ if (iy < mi.rcMonitor.top + 16) {
2586+ iy = mi.rcMonitor.top + 16;
2587+ }
25652588 }
2589+ else {
2590+ // マルチモニタがサポートされていない場合
2591+ if (ix < 16) {
2592+ ix = 16;
2593+ }
2594+ if (iy < 16) {
2595+ iy = 16;
2596+ }
2597+ }
25662598
25672599 /* Create the tip window */
25682600
--- trunk/doc/en/html/about/history.html (revision 5418)
+++ trunk/doc/en/html/about/history.html (revision 5419)
@@ -55,6 +55,7 @@
5555 <ul>
5656 <li>When the log file is opened, the "Hide dialog" function does not work well.</li>
5757 <li>Tera Term(ttermpro.exe) can not run on Windows 95/NT4.0.</li>
58+ <!--li>マルチモニタ環境において、ウィンドウのリサイズ中に表示されるツールチップの位置が有効なマイナス座標の場合でもプライマリモニタに表示される問題を修正した。</li-->
5859 </ul>
5960 </li>
6061
--- trunk/doc/ja/html/about/history.html (revision 5418)
+++ trunk/doc/ja/html/about/history.html (revision 5419)
@@ -55,6 +55,7 @@
5555 <ul>
5656 <li>ログ取得時に "ダイアログを非表示" オプションが正しく働かない問題を修正した。</li>
5757 <li>Windows 95/NT4.0で起動できなくなっていた問題を修正した。</li>
58+ <li>マルチモニタ環境において、ウィンドウのリサイズ中に表示されるツールチップの位置が有効なマイナス座標の場合でもプライマリモニタに表示される問題を修正した。</li>
5859 </ul>
5960 </li>
6061
旧リポジトリブラウザで表示