Compare commits

3 Commits

4 changed files with 14 additions and 7 deletions

View File

@ -707,7 +707,10 @@ fn commitTransaction(root: *Root) void {
{
var it = server.input_manager.seats.iterator(.forward);
while (it.next()) |seat| seat.cursor.updateState();
while (it.next()) |seat| {
seat.cursor.updateState();
seat.sendFocusedView();
}
}
{

View File

@ -243,8 +243,8 @@ pub fn focus(seat: *Seat, _target: ?*View) void {
}
pub fn sendFocusedView(seat: *Seat) void {
var it = seat.status_trackers.first;
while (it) |node| : (it = node.next) node.data.sendFocusedView();
var it = seat.status_trackers.iterator(.forward);
while (it.next()) |tracker| tracker.sendFocusedView();
}
/// Switch focus to the target, handling unfocus and input inhibition

View File

@ -81,8 +81,12 @@ pub fn sendFocusedView(seat_status: SeatStatus) void {
if (seat_status.seat_status_v1.getVersion() >= 4) {
switch (seat_status.seat.focused) {
.view => |view| {
//assert(view.inflight.tags == view.current.tags);
if (view.current.tags != 0) {
// A view can't be on no tags, so we need to wait for the
// layout to update. There is probably a better way to do
// this, but this way seems to work.
seat_status.seat_status_v1.sendFocusedView(view.getTitle() orelse "", view.current.tags);
}
},
else => seat_status.seat_status_v1.sendFocusedView("", 0),
}

View File

@ -780,14 +780,14 @@ pub fn notifyState(view: *const View) void {
if (view.foreign_toplevel_handle.wlr_handle) |wlr_handle| {
if (view.getTitle()) |title| wlr_handle.setTitle(title);
}
// Send title and tags to all status listeners attached to a seat which focuses this view
// Send title to all status listeners attached to a seat which focuses this view
if (view.ext_foreign_toplevel_handle) |handle| {
handle.updateState(&.{
.title = view.getTitle(),
.app_id = view.getAppId(),
});
}
// Send title to all status listeners attached to a seat which focuses this view
// Send title and tags to all status listeners attached to a seat which focuses this view
var seat_it = server.input_manager.seats.iterator(.forward);
while (seat_it.next()) |seat| {
if (seat.focused == .view and seat.focused.view == view) {