feat: Add application icon, remove the Wayland helper for input source names, and simplify the UI by removing the HTML header.
This commit is contained in:
BIN
client/icon.png
Normal file
BIN
client/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
@@ -246,10 +246,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>Broadcaster Client</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="main-content">
|
||||
<!-- Left Column: Controls -->
|
||||
<div class="controls" id="controlsPanel">
|
||||
|
||||
@@ -9,6 +9,7 @@ function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1000,
|
||||
height: 800,
|
||||
icon: path.join(__dirname, 'icon.png'),
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
nodeIntegration: false,
|
||||
@@ -49,29 +50,8 @@ ipcMain.handle('get-sources', async () => {
|
||||
fetchWindowIcons: true
|
||||
});
|
||||
|
||||
// Wayland Workaround: If we only see generic "WebRTC PipeWire capturer" windows,
|
||||
// try to fetch real window titles via our python helper
|
||||
try {
|
||||
const genericNames = ['webrtc pipewire capturer', 'screen 1', 'screen 2'];
|
||||
const hasGeneric = inputSources.some(s => genericNames.includes(s.name.toLowerCase()));
|
||||
|
||||
if (hasGeneric || inputSources.length === 1) {
|
||||
const { execSync } = require('child_process');
|
||||
const pyPath = path.join(__dirname, 'wayland-helper.py');
|
||||
const out = execSync(`python3 ${pyPath}`, { timeout: 2000 }).toString();
|
||||
const waylandWindows = JSON.parse(out);
|
||||
|
||||
if (waylandWindows && waylandWindows.length > 0) {
|
||||
// If we only have 1 capturer source (common on Wayland compositors),
|
||||
// rename it to the first active window title we found to be helpful.
|
||||
if (inputSources.length === 1 && waylandWindows[0].title) {
|
||||
inputSources[0].name = waylandWindows[0].title;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Wayland helper failed:", e.message);
|
||||
}
|
||||
// Note: On Wayland, source names come from the ScreenCast portal directly.
|
||||
// The wayland-helper override was removed because it returned stale/incorrect window titles.
|
||||
|
||||
return inputSources.map(source => ({
|
||||
id: source.id,
|
||||
|
||||
Reference in New Issue
Block a user