Bug: Changing a setting while Forge is disabled (e.g. screen locked) throws errors; old handlers keep running

未关闭
#581 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@mattchristenson 已经在做这个了。

开始于 2026年9月30日。

  • #582 来自 @mattchristenson —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
javascript
领域
desktop

调研方向

Read lib/extension/window.js at _bindSignals() (line 300) and the disable path that sets this.settings = null. Disconnect the settings handlers on disable and avoid duplicate connections on enable. Confirm with scenarios/29_settings_after_disable.py: no JS errors and each setting change handled once.

由索引模型根据 Issue 内容生成。

描述

Problem. Forge connects "changed" handlers to its settings, the window manager's (_bindSignals()) and the quick-settings indicator's, and never disconnects them. When Forge is disabled, the extension drops its settings object (this.settings = null), but the handlers stay connected. That happens on the lock screen too (_onSessionModeChanged()). Every later change of a Forge setting runs them, and they throw:

JS ERROR: TypeError: can't access property "get_boolean", this.ext.settings is null
renderTree@.../lib/extension/window.js:1167
_bindSignals/<@.../lib/extension/window.js:300

The same errors show in the journal log attached to #469. After Forge is enabled again, the old handlers keep running next to the new ones.

Desired outcome. Disabling Forge disconnects its settings handlers. Changing a setting while Forge is disabled does nothing, and after it is enabled again each change is handled once.

Acceptance criteria.

  • Disable Forge, then change a Forge setting (for example from the preferences, or with gsettings): no JS errors.
  • Enable it again: Forge works, and changing a setting raises no errors.

Steps to reproduce.

  1. With Forge enabled, run journalctl --user -f -o cat /usr/bin/gnome-shell in a terminal.
  2. Disable Forge (gnome-extensions disable [email protected], or lock the screen).
  3. Change a Forge setting, for example gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas set org.gnome.shell.extensions.forge focus-border-toggle false (from a second terminal or over ssh when the screen is locked).
  4. The journal shows JS ERROR: TypeError: can't access property "get_boolean", this.ext.settings is null for each change.

Automated reproduction: scenarios/29_settings_after_disable.py (in a nested GNOME Shell sandbox; it never touches your session). On main:

  FAIL  29.1 settings changed while Forge is disabled: new Forge errors 4 (expected 0)
  PASS  29.2 enabled again: a new window tiled: True; new Forge errors 0 (expected 0)
主要语言
JavaScript
星标
1.3k
派生
112
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

forge-ext/forge 的其他 Issue

查看 forge-ext/forge 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。