Skip to content

Commit f832b59

Browse files
refactor: remove auto-hide management for dropdowns in settings panel
1 parent 2713e02 commit f832b59

3 files changed

Lines changed: 1 addition & 60 deletions

File tree

src/app/core/services/tauri/tauri.service.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ export class TauriService {
135135
return invoke<string>('complete_oauth_flow');
136136
}
137137

138-
// Window Focus Management (Linux dropdown fix)
139-
async pauseAutoHide(): Promise<void> {
140-
return invoke('pause_auto_hide');
141-
}
142-
143-
async resumeAutoHide(): Promise<void> {
144-
return invoke('resume_auto_hide');
145-
}
146-
147138
// Config Management
148139
async getRefreshInterval(): Promise<number> {
149140
return invoke<number>('get_refresh_interval');

src/app/shared/components/settings-panel/settings-panel.component.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
class="refresh-select"
2929
[value]="refreshInterval"
3030
(change)="onRefreshIntervalChange($event)"
31-
(focus)="onSelectFocus($event)"
32-
(blur)="onSelectBlur($event)"
3331
>
3432
<option value="1">1 minutes</option>
3533
<option value="5">5 minutes</option>

src/app/shared/components/settings-panel/settings-panel.component.ts

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -51,44 +51,6 @@ export class SettingsPanelComponent implements OnInit, OnDestroy {
5151
this.refreshIntervalChange.emit(value);
5252
}
5353

54-
private autoHideTimeout?: number;
55-
56-
onSelectFocus(event: Event): void {
57-
// Prevent window from closing when dropdown is opened
58-
if (this.tauriService.isTauri) {
59-
this.tauriService.pauseAutoHide().catch(err =>
60-
console.warn('Failed to pause auto-hide:', err)
61-
);
62-
63-
// Clear any existing timeout
64-
if (this.autoHideTimeout) {
65-
clearTimeout(this.autoHideTimeout);
66-
}
67-
68-
// Set a safety timeout to resume auto-hide after 10 seconds
69-
this.autoHideTimeout = window.setTimeout(() => {
70-
this.tauriService.resumeAutoHide().catch(err =>
71-
console.warn('Failed to resume auto-hide (timeout):', err)
72-
);
73-
}, 10000);
74-
}
75-
}
76-
77-
onSelectBlur(event: Event): void {
78-
// Allow window to close normally when dropdown is closed
79-
if (this.tauriService.isTauri) {
80-
// Clear the safety timeout
81-
if (this.autoHideTimeout) {
82-
clearTimeout(this.autoHideTimeout);
83-
this.autoHideTimeout = undefined;
84-
}
85-
86-
this.tauriService.resumeAutoHide().catch(err =>
87-
console.warn('Failed to resume auto-hide:', err)
88-
);
89-
}
90-
}
91-
9254
async openTaskbarSettings(): Promise<void> {
9355
if (this.isWindows) {
9456
try {
@@ -137,16 +99,6 @@ export class SettingsPanelComponent implements OnInit, OnDestroy {
13799
}
138100

139101
ngOnDestroy(): void {
140-
// Clean up timeout on component destruction
141-
if (this.autoHideTimeout) {
142-
clearTimeout(this.autoHideTimeout);
143-
144-
// Ensure auto-hide is resumed
145-
if (this.tauriService.isTauri) {
146-
this.tauriService.resumeAutoHide().catch(err =>
147-
console.warn('Failed to resume auto-hide on destroy:', err)
148-
);
149-
}
150-
}
102+
151103
}
152104
}

0 commit comments

Comments
 (0)