Skip to content

Commit

Permalink
Merge pull request #517 from jijojosephk/issue-505
Browse files Browse the repository at this point in the history
Fix: #505 , removed extra logic which filters list of available resolutions
  • Loading branch information
jijojosephk authored Jan 14, 2022
2 parents fd71520 + 5c483fa commit 44c8cd0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"msteams",
"nodedir",
"ntlm",
"Pipewire",
"pulseaudio",
"screensizes",
"subdir",
"submenu",
"zoetrope",
Expand Down
4 changes: 2 additions & 2 deletions app/streamSelector/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ window.addEventListener('DOMContentLoaded', init());

function init() {
return () => {
if (process.env["XDG_SESSION_TYPE"] === "wayland") {
if (process.env['XDG_SESSION_TYPE'] === 'wayland') {
//Pipewire dialog already allows user to select screen/window so request directly to avoid prompting user multiple times to select screen
initRequestSource(requestSingleScreenOrWindow);
} else {
initRequestSource(createPreviewScreen);
}
}
};
}

function initRequestSource(callback) {
Expand Down
9 changes: 3 additions & 6 deletions app/streamSelector/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { ipcMain, BrowserView, screen } = require('electron');
const { ipcMain, BrowserView } = require('electron');
const path = require('path');
const resolutions = [
{
Expand Down Expand Up @@ -143,11 +143,8 @@ function resizeView(view) {

function createScreenRequestHandler() {
ipcMain.once('get-screensizes-request', event => {
const pdisplay = screen.getPrimaryDisplay();
event.reply('get-screensizes-response', resolutions.slice(0, resolutions.findIndex(r => {
return r.width >= pdisplay.size.width && r.height >= pdisplay.size.height;
}) + 1).map(s => {
return Object.assign({}, s);
event.reply('get-screensizes-response', resolutions.map(resolution => {
return Object.assign({}, resolution);
}));
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.0.22",
"version": "1.0.23",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down

0 comments on commit 44c8cd0

Please sign in to comment.