Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

ディスプレイ全体を翻訳対象にする実装完了

実装内容

  • StartupViewModel.csを修正してディスプレイ選択時のエラーを削除
    • ディスプレイかウィンドウかを判定するロジックを追加
    • ディスプレイの場合はDISPLAY__<番号>形式の名前を使用
    • モニターのインデックスを取得する機能を実装
  • ディスプレイ選択時の処理フローを実装
    • ディスプレイが選択された場合でもOpenTargetAsyncを呼び出す
    • モニターハンドルを適切に処理する
  • キャプチャモジュールの更新
    • WindowsGraphicsCaptureでモニターとウィンドウの両方をサポート
    • CaptureMainWindowでディスプレイ用の特別処理を追加
    • OverlayMainWindowでディスプレイ用の特別処理を追加
  • リソースファイルの更新
    • 日本語リソースから「モニターはサポート対象外です」を削除
    • 全ての翻訳リソースから対応するメッセージを削除
  • コードレビューで指摘された問題を修正
    • ポインター型の一貫性を修正(nint.ZeroIntPtr.Zero
    • EnumDisplaySettings のエラーハンドリングを追加
    • ゼロ除算の可能性を修正
  • アーキテクチャ改善
    • IProcessInfoStoreIsMonitorプロパティを追加
    • 文字列チェック(Name.StartsWith("DISPLAY__"))をIsMonitorプロパティで置き換え
  • セキュリティレビュー完了

主な変更点

  1. ディスプレイ検出: FindDisplayBySizeメソッドで全モニターを列挙し、サイズで一致判定
  2. 命名規則: ディスプレイはDISPLAY__0DISPLAY__1の形式で識別
  3. アーキテクチャ: IProcessInfoStore.IsMonitorプロパティでモニター判定を一元化
  4. キャプチャ: モニターの場合はCreateItemForMonitorを使用
  5. UI対応: オーバーレイ・キャプチャの両モードでディスプレイをサポート
  6. エラーハンドリング: API呼び出しの失敗やゼロ除算を適切に処理
Original prompt

This section details on the original issue you should resolve

<issue_title>ディスプレイ全体を翻訳対象にできるようにする</issue_title>
<issue_description>* 翻訳開始時にディスプレイを選択したときのエラーを外す

  • 翻訳対象ごとの設定には DISPLAY__0 のようにプレフィックスとディスプレイの番号を利用する</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 15, 2025 12:06
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error when selecting display for translation Support display/monitor capture with DISPLAY__<index> naming scheme Dec 15, 2025
Copilot AI requested a review from Freeesia December 15, 2025 12:17
@Freeesia
Copy link
Owner

@copilot

IProcessInfoStoreに対象がモニターかどうか判定するプロパティ追加して利用して。

…ng checks

Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot

IProcessInfoStoreに対象がモニターかどうか判定するプロパティ追加して利用して。

IProcessInfoStoreIsMonitorプロパティを追加し、全てのName.StartsWith("DISPLAY__")チェックを置き換えました。

変更内容:

  • IProcessInfoStoreインターフェースにIsMonitorプロパティを追加
  • ProcessInfoStoreSetTargetProcess時にIsMonitorを自動設定
  • WindowsGraphicsCapture, CaptureMainWindow, OverlayMainWindowの4箇所で使用

コミット: 257c22f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ディスプレイ全体を翻訳対象にできるようにする

2 participants