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);
|
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 {
|
pub fn sendFocusedView(seat: *Seat) void {
|
||||||
var it = seat.status_trackers.first;
|
var it = seat.status_trackers.iterator(.forward);
|
||||||
while (it) |node| : (it = node.next) node.data.sendFocusedView();
|
while (it.next()) |tracker| tracker.sendFocusedView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Switch focus to the target, handling unfocus and input inhibition
|
/// 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) {
|
if (seat_status.seat_status_v1.getVersion() >= 4) {
|
||||||
switch (seat_status.seat.focused) {
|
switch (seat_status.seat.focused) {
|
||||||
.view => |view| {
|
.view => |view| {
|
||||||
//assert(view.inflight.tags == view.current.tags);
|
if (view.current.tags != 0) {
|
||||||
seat_status.seat_status_v1.sendFocusedView(view.getTitle() orelse "", view.current.tags);
|
// 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),
|
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.foreign_toplevel_handle.wlr_handle) |wlr_handle| {
|
||||||
if (view.getTitle()) |title| wlr_handle.setTitle(title);
|
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| {
|
if (view.ext_foreign_toplevel_handle) |handle| {
|
||||||
handle.updateState(&.{
|
handle.updateState(&.{
|
||||||
.title = view.getTitle(),
|
.title = view.getTitle(),
|
||||||
.app_id = view.getAppId(),
|
.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);
|
var seat_it = server.input_manager.seats.iterator(.forward);
|
||||||
while (seat_it.next()) |seat| {
|
while (seat_it.next()) |seat| {
|
||||||
if (seat.focused == .view and seat.focused.view == view) {
|
if (seat.focused == .view and seat.focused.view == view) {
|
||||||
|
|||||||
Reference in New Issue
Block a user