Skip to content

Commit a3f3867

Browse files
committed
fix: allow xdg activation without window information
Remove the early return when no target window is available for XDG activation tokens. Previously, the token request would fail immediately if there was no effective window, but tray plugins might need to use XDG activation without a window context. Log: XDG activation now works without requiring a window Influence: 1. Test tray icon activation without a focused window 2. Verify token generation succeeds with null/empty window 3. Ensure no regression when window context is provided 4. Test activation request flow in headless or windowless scenarios fix: 允许无窗口信息时进行XDG激活 移除当没有目标窗口时提前返回XDG激活令牌的逻辑。之前没有有效窗口时令牌请 求会立即失败,但托盘插件可能需要在没有窗口上下文的情况下使用XDG激活。 Log: XDG激活现在无需窗口即可工作 Influence: 1. 测试无焦点窗口时的托盘图标激活功能 2. 验证在窗口为空/null时令牌生成是否成功 3. 确保有窗口上下文时功能正常无回归 4. 测试无窗口或headless场景下的激活请求流程
1 parent 37957fa commit a3f3867

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

src/tray-wayland-integration/xdgactivation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ void XdgActivation::requestToken(QWindow *window, const QString &appId)
144144
qCWarning(trayXdgActivation) << "XDG activation request has empty app id";
145145

146146
auto effectiveWindow = window ? window : QGuiApplication::focusWindow();
147-
if (!effectiveWindow) {
148-
qCWarning(trayXdgActivation) << "XDG activation request has no target window";
149-
Q_EMIT tokenReady({});
150-
return;
151-
}
152147

153148
auto *provider = activationV1()->createTokenProvider(effectiveWindow, effectiveAppId);
154149
provider->setParent(this);

0 commit comments

Comments
 (0)