Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Dock Assign To: keep the assignment by connector (two identical monitors share a name: both were checked and windows went to the first); old name values still work when unique; verified on VM 118

Federico Pereira24e041ab4b4a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 249bed7..f70b4a6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -153,6 +153,11 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),
### Fixed
+- **Dock → Options → Assign To with two monitors of the same model.** The assignment was kept by the
+ display's name, which two identical monitors share: both showed as checked and new windows went to the
+ first. It is now kept by the connector (HDMI-A-1, DP-2…); an assignment saved by name still works
+ while that name belongs to one display. Verified on VM 118 with two displays of the same name: Notes
+ assigned to the second display opens there after being moved to the first and quit.
- **The sign-in and lock screen with several displays.** It was laid out over the whole desktop, so the
clock, the user and the password field were cut at the seam between two displays; they now go on the
main display (the wallpaper still covers every display) and follow a display plugged in or out while it
diff --git a/docs/DISPLAYS.md b/docs/DISPLAYS.md
index 6b50e6c..a6287d4 100644
--- a/docs/DISPLAYS.md
+++ b/docs/DISPLAYS.md
@@ -253,3 +253,13 @@ head: `screendump file.ppm vga 1` in `qm monitor 118`.
callbacks follow the main display.
- Per-display Night Light: the temperature is the same for all; if any display lacks a gamma LUT
the software tint is used for all of them.
+
+## Assigning an app to a display (0.8.5)
+
+Dock → Options → Assign To lists the displays when there is more than one: an app assigned to one opens
+its new windows there, wherever the pointer is; "None" follows the pointer. The assignment is kept in
+`settings.appDisplays` by the display's connector (`HDMI-A-1`, `DP-2`, from `lord.screen.displays[].connector`),
+not its name, because two monitors of the same model share a name; a value saved by name before still
+works while it names a single display (`sdk/dock.js`, `assignedDisplay`). The sign-in and lock screen
+shows its clock, users and buttons on the main display and its wallpaper on every display
+(`themes/greeter`).
diff --git a/sdk/dock.js b/sdk/dock.js
index 45a5d32..21f30d6 100644
--- a/sdk/dock.js
+++ b/sdk/dock.js
@@ -313,12 +313,13 @@ export function dockMenu(e, opts = {}) {
const on = loginApps().includes(e.id);
options.push({ label: t('shell.dock.openAtLogin'), checked: on, onClick: () => settings.set({ loginApps: on ? loginApps().filter((x) => x !== e.id) : [...loginApps(), e.id] }) });
}
- // Assign to a display (0.8.5): its new windows open there; by the display's name, kept across boots
+ // Assign to a display (0.8.5): its new windows open there; by the display's connector (two monitors
+ // of the same model share a name), kept across boots
if (screen.displays.length > 1 && e.launcherId) {
- const cur = (settings.get().appDisplays || {})[e.launcherId] || '';
+ const cur = assignedDisplay((settings.get().appDisplays || {})[e.launcherId]);
const set = (name) => { const m = { ...(settings.get().appDisplays || {}) }; if (name) m[e.launcherId] = name; else delete m[e.launcherId]; settings.set({ appDisplays: m }); };
options.push('-', { label: t('shell.dock.assignTo'), disabled: true });
- screen.displays.forEach((d, i) => options.push({ label: t('shell.dock.assignDisplay', { n: i + 1, name: d.name || '' }).trim(), checked: cur === d.name, onClick: () => set(d.name) }));
+ screen.displays.forEach((d, i) => options.push({ label: t('shell.dock.assignDisplay', { n: i + 1, name: d.name || '' }).trim(), checked: cur === d, onClick: () => set(displayKey(d)) }));
options.push({ label: t('shell.dock.assignNone'), checked: !cur, onClick: () => set('') });
}
if (options.length) items.push({ label: t('shell.dock.options'), submenu: options }, '-');
@@ -439,9 +440,18 @@ addListener('keydown', (e) => {
// ---- Open at Login and display assignments (0.8.5) ----
const loginApps = () => (Array.isArray(settings.get().loginApps) ? settings.get().loginApps : []);
+// An assignment is the display's connector ("HDMI-A-1"); one saved before by name still works while
+// that name belongs to a single display.
+const displayKey = (d) => d.connector || d.name;
+function assignedDisplay(v) {
+ if (!v) return null;
+ const byConn = screen.displays.find((x) => x.connector && x.connector === v);
+ if (byConn) return byConn;
+ const byName = screen.displays.filter((x) => x.name === v);
+ return byName.length === 1 ? byName[0] : null;
+}
setDisplayAssignment((key) => {
- const name = (settings.get().appDisplays || {})[key];
- const d = name ? screen.displays.find((x) => x.name === name) : null;
+ const d = assignedDisplay((settings.get().appDisplays || {})[key]);
return d ? d.id : null;
});
// once per session, a few seconds after it starts (never in the live system's first run, never in an