{
- if ((await getConfig("alternativePaste")) == true) {
- mainWindow.on("focus", function () {
- console.log("[Window state manager] Focus");
- globalShortcut.register("CmdOrCtrl+V", function () {
- if (mainWindow.isFocused()) {
- paste(mainWindow.webContents);
- }
- });
- });
- mainWindow.on("show", function () {
- console.log("[Window state manager] Show");
- mainWindow.focus();
- globalShortcut.register("CmdOrCtrl+V", function () {
- if (mainWindow.isFocused()) {
- paste(mainWindow.webContents);
- }
- });
- });
- mainWindow.on("blur", function () {
- console.log("[Window state manager] Defocus");
- globalShortcut.unregister("CmdOrCtrl+V");
- });
- mainWindow.on("hide", function () {
- console.log("[Window state manager] Hide");
- globalShortcut.unregister("CmdOrCtrl+V");
- });
- }
let template: Electron.MenuItemConstructorOptions[] = [
{
label: "ArmCord",
diff --git a/src/screenshare/main.ts b/src/screenshare/main.ts
index c9227b1..29f1393 100644
--- a/src/screenshare/main.ts
+++ b/src/screenshare/main.ts
@@ -6,13 +6,6 @@ let capturerWindow: BrowserWindow;
function registerCustomHandler(): void {
session.defaultSession.setDisplayMediaRequestHandler(async (request, callback) => {
console.log(request);
- // if (process.platform == "linux") {
- // let isAudio = isAudioSupported();
- // if (isAudio) {
- // console.log("audio supported");
- // getSinks();
- // }
- // }
const sources = await desktopCapturer.getSources({
types: ["screen", "window"]
});
@@ -20,7 +13,7 @@ function registerCustomHandler(): void {
if (process.platform === "linux" && process.env.XDG_SESSION_TYPE?.toLowerCase() === "wayland") {
console.log("WebRTC Capturer detected, skipping window creation."); //assume webrtc capturer is used
console.log({video: {id: sources[0].id, name: sources[0].name}});
- callback({video: {id: sources[0].id, name: sources[0].name}});
+ callback({video: sources[0], audio: "loopbackWithMute"});
} else {
capturerWindow = new BrowserWindow({
width: 800,
@@ -40,8 +33,9 @@ function registerCustomHandler(): void {
//console.log(sources[id]);
//console.log(id);
capturerWindow.close();
- let result = {id, name, width: 9999, height: 9999};
- if (process.platform === "linux") {
+ let result = {id, name};
+ if (process.platform === "linux" || process.platform === "win32") {
+ console.log("audio screenshare");
callback({video: result, audio: "loopbackWithMute"});
} else {
callback({video: result});
diff --git a/src/settings/settings.html b/src/settings/settings.html
index c472228..d62456c 100644
--- a/src/settings/settings.html
+++ b/src/settings/settings.html
@@ -100,14 +100,6 @@
-
-
-
diff --git a/src/setup/setup.html b/src/setup/setup.html
index 5578f1c..df56081 100644
--- a/src/setup/setup.html
+++ b/src/setup/setup.html
@@ -143,7 +143,6 @@
useLegacyCapturer: false,
tray: /true/i.test(document.getElementById("tray").value),
startMinimized: false,
- alternativePaste: false,
performanceMode: "none",
trayIcon: "default",
inviteWebsocket: true,
diff --git a/src/utils.ts b/src/utils.ts
index 7163566..97f4fbb 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -58,7 +58,6 @@ export function setup(): void {
armcordCSP: true,
minimizeToTray: true,
keybinds: [],
- alternativePaste: false,
multiInstance: false,
mods: "none",
spellcheck: true,
@@ -139,11 +138,11 @@ export async function injectElectronFlags(): Promise {
switch (await getConfig("performanceMode")) {
case "performance":
console.log("Performance mode enabled");
- app.commandLine.appendSwitch(presets.performance);
+ app.commandLine.appendArgument(presets.performance);
break;
case "battery":
console.log("Battery mode enabled");
- app.commandLine.appendSwitch(presets.battery);
+ app.commandLine.appendArgument(presets.battery);
break;
default:
console.log("No performance modes set");
@@ -270,7 +269,6 @@ export interface Settings {
channel: string;
armcordCSP: boolean;
minimizeToTray: boolean;
- alternativePaste: boolean;
multiInstance: boolean;
spellcheck: boolean;
mods: string;