Compare commits
3 Commits
52b312d08d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
82613a56db
|
|||
|
936d1157b4
|
|||
|
7ce21a44d8
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user