Add fullscreen and topmost+fullscreen profile condition modes
New match types for application conditions: - "fullscreen": app has a fullscreen window on any monitor (detected via EnumWindows, works even when another window is focused on a different display) - "topmost_fullscreen": app is the focused foreground window AND fullscreen Optimizes profile evaluation to only call expensive detection methods when needed: WMI process enumeration (~3s) is skipped when no condition uses "running" mode; foreground/fullscreen checks (<1ms each) are called selectively based on active match types. Filters false positives from fullscreen detection by excluding desktop/shell process windows, tool windows, and non-activatable overlay windows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -67,7 +67,7 @@ function createProfileCard(profile) {
|
||||
const parts = profile.conditions.map(c => {
|
||||
if (c.condition_type === 'application') {
|
||||
const apps = (c.apps || []).join(', ');
|
||||
const matchLabel = c.match_type === 'topmost' ? t('profiles.condition.application.match_type.topmost') : t('profiles.condition.application.match_type.running');
|
||||
const matchLabel = t('profiles.condition.application.match_type.' + (c.match_type || 'running'));
|
||||
return `<span class="stream-card-prop stream-card-prop-full">${t('profiles.condition.application')}: ${apps} (${matchLabel})</span>`;
|
||||
}
|
||||
return `<span class="stream-card-prop">${c.condition_type}</span>`;
|
||||
@@ -212,6 +212,8 @@ function addProfileConditionRow(condition) {
|
||||
<select class="condition-match-type">
|
||||
<option value="running" ${matchType === 'running' ? 'selected' : ''}>${t('profiles.condition.application.match_type.running')}</option>
|
||||
<option value="topmost" ${matchType === 'topmost' ? 'selected' : ''}>${t('profiles.condition.application.match_type.topmost')}</option>
|
||||
<option value="topmost_fullscreen" ${matchType === 'topmost_fullscreen' ? 'selected' : ''}>${t('profiles.condition.application.match_type.topmost_fullscreen')}</option>
|
||||
<option value="fullscreen" ${matchType === 'fullscreen' ? 'selected' : ''}>${t('profiles.condition.application.match_type.fullscreen')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="condition-field">
|
||||
|
||||
@@ -504,6 +504,8 @@
|
||||
"profiles.condition.application.match_type.hint": "How to detect the application",
|
||||
"profiles.condition.application.match_type.running": "Running",
|
||||
"profiles.condition.application.match_type.topmost": "Topmost (foreground)",
|
||||
"profiles.condition.application.match_type.topmost_fullscreen": "Topmost + Fullscreen",
|
||||
"profiles.condition.application.match_type.fullscreen": "Fullscreen",
|
||||
"profiles.targets": "Targets:",
|
||||
"profiles.targets.hint": "Targets to start when this profile activates",
|
||||
"profiles.targets.empty": "No targets available",
|
||||
|
||||
@@ -504,6 +504,8 @@
|
||||
"profiles.condition.application.match_type.hint": "Как определять наличие приложения",
|
||||
"profiles.condition.application.match_type.running": "Запущено",
|
||||
"profiles.condition.application.match_type.topmost": "На переднем плане",
|
||||
"profiles.condition.application.match_type.topmost_fullscreen": "На переднем плане + Полный экран",
|
||||
"profiles.condition.application.match_type.fullscreen": "Полный экран",
|
||||
"profiles.targets": "Цели:",
|
||||
"profiles.targets.hint": "Цели для запуска при активации профиля",
|
||||
"profiles.targets.empty": "Нет доступных целей",
|
||||
|
||||
Reference in New Issue
Block a user