Skip to content

Commit

Permalink
Improve method naming
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Dec 17, 2024
1 parent c418450 commit 59a3d93
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/windows/callsWidgetWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ export class CallsWidgetWindow {
ev.preventDefault();
};

private toggleWidgetVisibility = (flag: boolean) => {
log.debug('toggleWidgetVisibility', flag);
private setWidgetWindowStacking = ({onTop}: {onTop: boolean}) => {
log.debug('setWidgetWindowStacking', onTop);

if (!this.win) {
return;
}

if (flag) {
if (onTop) {
this.win.setVisibleOnAllWorkspaces(true, {visibleOnFullScreen: true, skipTransformProcessType: true});
this.win.setAlwaysOnTop(true, 'screen-saver');
this.win.focus();
Expand All @@ -257,7 +257,7 @@ export class CallsWidgetWindow {
return;
}

this.toggleWidgetVisibility(true);
this.setWidgetWindowStacking({onTop: true});

const bounds = this.win.getBounds();
const mainBounds = mainWindow.getBounds();
Expand Down Expand Up @@ -303,7 +303,7 @@ export class CallsWidgetWindow {
private onPopOutCreate = (win: BrowserWindow) => {
this.popOut = win;

this.toggleWidgetVisibility(false);
this.setWidgetWindowStacking({onTop: false});

// Let the webContentsEventManager handle links that try to open a new window.
webContentsEventManager.addWebContentsEventListeners(this.popOut.webContents);
Expand All @@ -321,7 +321,7 @@ export class CallsWidgetWindow {
this.popOut.on('closed', () => {
delete this.popOut;
contextMenu.dispose();
this.toggleWidgetVisibility(true);
this.setWidgetWindowStacking({onTop: true});
});

// Set the userAgent so that the widget's popout is considered a desktop window in the webapp code.
Expand Down

0 comments on commit 59a3d93

Please sign in to comment.