Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

- Fixed ScreencopyView not displaying when only lock surfaces are shown.
- Fixed WlSessionLockSurface.visible crashing if accessed before backing surface creation.
- Fixed Hyprland.activeToplevel being null until the user changes focus, by seeding it from j/clients during init.
12 changes: 12 additions & 0 deletions src/wayland/hyprland/ipc/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ void HyprlandIpc::refreshToplevels() {
auto json = QJsonDocument::fromJson(resp).array();

const auto& mList = this->mToplevels.valueList();
HyprlandToplevel* focusedToplevel = nullptr;

for (auto entry: json) {
auto object = entry.toObject().toVariantMap();
Expand Down Expand Up @@ -743,6 +744,17 @@ void HyprlandIpc::refreshToplevels() {

auto* workspace = toplevel->bindableWorkspace().value();
if (workspace) workspace->insertToplevel(toplevel);

// focusHistoryID == 0 marks the currently focused window. Hyprland's
// event socket only emits activewindowv2 on focus changes, so without
// this seed activeToplevel stays null until the user switches focus.
if (object.value("focusHistoryID").toInt() == 0) {
focusedToplevel = toplevel;
}
}

if (focusedToplevel && this->bActiveToplevel.value() == nullptr) {
this->bActiveToplevel = focusedToplevel;
}
});
}
Expand Down
Loading