Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions app/blitztext_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ def create_help_label(text: str) -> QLabel:
return label


def _apply_window_icon(window: QWidget) -> None:
"""Set the branded window icon; failures are purely cosmetic and ignored."""
try:
window.setWindowIcon(theme.create_app_icon())
except Exception: # pragma: no cover - purely cosmetic
pass


class SettingsDialog(QDialog):
"""Settings dialog for configuring BlitztextLinux."""

Expand Down Expand Up @@ -1360,10 +1368,7 @@ def _ensure_compose_window(self) -> ComposeWindow:
if self._compose_window is None:
window = ComposeWindow(self.llm_service, self.paste_service, self.config)
window.prompt_saved.connect(self._on_custom_prompt_saved)
try:
window.setWindowIcon(theme.create_app_icon())
except Exception: # pragma: no cover - rein kosmetisch
pass
_apply_window_icon(window)
self._compose_window = window
return self._compose_window

Expand Down Expand Up @@ -1409,10 +1414,7 @@ def _on_history_count_changed(self, count: int) -> None:
def _ensure_main_window(self) -> MainWindow:
if self._main_window is None:
window = MainWindow(self)
try:
window.setWindowIcon(theme.create_app_icon())
except Exception: # pragma: no cover - rein kosmetisch
pass
_apply_window_icon(window)
window.set_dictation_checked(self._dictation_mode)
if self._history_panel is not None:
window.set_history_count(self._history_panel.entry_count)
Expand Down
12 changes: 2 additions & 10 deletions app/hotkey_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,7 @@ def _discover_keyboards(transcription_key: str = "KEY_LEFTALT") -> list:
pass

if devices:
for dev in fallback_candidates:
try:
dev.close()
except Exception:
pass
_close_devices(fallback_candidates)
return devices

if fallback_candidates:
Expand All @@ -384,11 +380,7 @@ def _discover_keyboards(transcription_key: str = "KEY_LEFTALT") -> list:
"Warning: no keyboard with Meta key found, falling back",
file=sys.stderr, flush=True,
)
for dev in fallback_candidates[1:]:
try:
dev.close()
except Exception:
pass
_close_devices(fallback_candidates[1:])
return fallback_candidates[:1]

return []
Expand Down
Loading