Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
WindowManager: fix redundant naming
river/Output.zig | 2 +-
river/OutputManager.zig | 28 ++++++++++++++--------------
river/Seat.zig | 4 ++--
river/Window.zig | 2 +-
river/WindowManager.zig | 28 ++++++++++++++--------------
5 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/river/Output.zig b/river/Output.zig
index 2a83e31..7300a8f 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -286,7 +286,7 @@ pub fn manageStart(output: *Output) void {
output.sent = output.scheduled;
output.link_sent.remove();
- server.wm.wm_sent.outputs.append(output);
+ server.wm.sent.outputs.append(output);
},
.disabled_hard, .destroying => {
if (output.object) |output_v1| {
diff --git a/river/OutputManager.zig b/river/OutputManager.zig
index bce5cbf..beb393e 100644
--- a/river/OutputManager.zig
+++ b/river/OutputManager.zig
@@ -173,11 +173,11 @@ fn handleManagerApply(_: *wl.Listener(*wlr.OutputConfigurationV1), config: *wlr.
};
}
- if (server.wm.wm_scheduled.output_config) |old| {
+ if (server.wm.scheduled.output_config) |old| {
old.sendFailed();
old.destroy();
}
- server.wm.wm_scheduled.output_config = config;
+ server.wm.scheduled.output_config = config;
server.wm.dirtyWindowing();
}
@@ -257,7 +257,7 @@ pub fn autoLayout(om: *OutputManager) void {
pub fn commitOutputState(om: *OutputManager) void {
const wm = &server.wm;
{
- var it = wm.wm_sent.outputs.iterator(.forward);
+ var it = wm.sent.outputs.iterator(.forward);
while (it.next()) |output| {
const wlr_output = output.wlr_output orelse continue;
switch (output.sent.state) {
@@ -282,7 +282,7 @@ pub fn commitOutputState(om: *OutputManager) void {
server.input_manager.reconfigureDevices();
const need_modeset = blk: {
- var it = wm.wm_sent.outputs.iterator(.forward);
+ var it = wm.sent.outputs.iterator(.forward);
while (it.next()) |output| {
const wlr_output = output.wlr_output orelse continue;
switch (output.sent.state) {
@@ -319,7 +319,7 @@ pub fn commitOutputState(om: *OutputManager) void {
defer for (states.items) |*s| s.base.finish();
{
- var it = wm.wm_sent.outputs.iterator(.forward);
+ var it = wm.sent.outputs.iterator(.forward);
while (it.next()) |output| {
const wlr_output = output.wlr_output orelse continue;
const state = states.addOne(util.gpa) catch {
@@ -342,15 +342,15 @@ pub fn commitOutputState(om: *OutputManager) void {
log.err("failed to prepare new output configuration", .{});
// TODO search for a working fallback
- if (wm.wm_sent.output_config) |config| {
+ if (wm.sent.output_config) |config| {
config.sendFailed();
config.destroy();
- wm.wm_sent.output_config = null;
+ wm.sent.output_config = null;
}
{
// Revert to last working state on failure
- var it = wm.wm_sent.outputs.iterator(.forward);
+ var it = wm.sent.outputs.iterator(.forward);
while (it.next()) |output| {
output.scheduled = output.current;
output.sent = output.current;
@@ -372,15 +372,15 @@ pub fn commitOutputState(om: *OutputManager) void {
if (!server.backend.commit(states.items)) {
log.err("failed to commit new output configuration", .{});
- if (wm.wm_sent.output_config) |config| {
+ if (wm.sent.output_config) |config| {
config.sendFailed();
config.destroy();
- wm.wm_sent.output_config = null;
+ wm.sent.output_config = null;
}
{
// Revert to last working state on failure
- var it = wm.wm_sent.outputs.iterator(.forward);
+ var it = wm.sent.outputs.iterator(.forward);
while (it.next()) |output| {
output.scheduled = output.current;
output.sent = output.current;
@@ -393,14 +393,14 @@ pub fn commitOutputState(om: *OutputManager) void {
swapchain_manager.apply();
}
- if (wm.wm_sent.output_config) |config| {
+ if (wm.sent.output_config) |config| {
config.sendSucceeded();
config.destroy();
- wm.wm_sent.output_config = null;
+ wm.sent.output_config = null;
}
{
- var it = wm.wm_sent.outputs.safeIterator(.forward);
+ var it = wm.sent.outputs.safeIterator(.forward);
while (it.next()) |output| {
if (output.wlr_output) |wlr_output| {
if (wlr_output.enabled) {
diff --git a/river/Seat.zig b/river/Seat.zig
index 09333d6..f47d7ba 100644
--- a/river/Seat.zig
+++ b/river/Seat.zig
@@ -265,7 +265,7 @@ pub fn processEvents(seat: *Seat) void {
// Only process events while there is no new state to be sent to the window manager.
// The window manager might decide to change focus or redefine keyboard/pointer bindings
// in response, which can affect further processing of events.
- while (!server.wm.wm_scheduled.dirty) {
+ while (!server.wm.scheduled.dirty) {
assert(server.wm.state == .idle);
const event = seat.event_queue.popFront() orelse break;
@@ -328,7 +328,7 @@ pub fn manageStart(seat: *Seat) void {
wm_v1.sendSeat(seat_v1);
seat.link_sent.remove();
- server.wm.wm_sent.seats.append(seat);
+ server.wm.sent.seats.append(seat);
break :blk seat_v1;
};
diff --git a/river/Window.zig b/river/Window.zig
index db080fc..72b5bb0 100644
--- a/river/Window.zig
+++ b/river/Window.zig
@@ -660,7 +660,7 @@ pub fn manageFinish(window: *Window) bool {
{
window.configure_scheduled.activated = false;
- var it = server.wm.wm_sent.seats.iterator(.forward);
+ var it = server.wm.sent.seats.iterator(.forward);
while (it.next()) |seat| {
if (seat.focused == .window and seat.focused.window == window) {
window.configure_scheduled.activated = true;
diff --git a/river/WindowManager.zig b/river/WindowManager.zig
index 991ee13..1208af4 100644
--- a/river/WindowManager.zig
+++ b/river/WindowManager.zig
@@ -54,7 +54,7 @@ state: union(enum) {
windows: SlotMap(*Window) = .empty,
/// State to be sent to the wm in the next manage sequence.
-wm_scheduled: struct {
+scheduled: struct {
/// State has been modified since the last manage sequence.
dirty: bool = false,
@@ -62,7 +62,7 @@ wm_scheduled: struct {
} = .{},
/// State sent to the wm in the latest update sequence.
-wm_sent: struct {
+sent: struct {
outputs: wl.list.Head(Output, .link_sent),
output_config: ?*wlr.OutputConfigurationV1 = null,
@@ -91,7 +91,7 @@ pub fn init(wm: *WindowManager) !void {
wm.* = .{
.global = try wl.Global.create(server.wl_server, river.WindowManagerV1, 1, *WindowManager, wm, bind),
- .wm_sent = .{
+ .sent = .{
.outputs = undefined,
.seats = undefined,
},
@@ -100,8 +100,8 @@ pub fn init(wm: *WindowManager) !void {
},
.timeout = timeout,
};
- wm.wm_sent.outputs.init();
- wm.wm_sent.seats.init();
+ wm.sent.outputs.init();
+ wm.sent.seats.init();
wm.rendering_requested.list.init();
server.wl_server.addDestroyListener(&wm.server_destroy);
@@ -224,7 +224,7 @@ pub fn ensureRendering(wm: *WindowManager) bool {
}
pub fn dirtyWindowing(wm: *WindowManager) void {
- wm.wm_scheduled.dirty = true;
+ wm.scheduled.dirty = true;
if (wm.dirty_idle == null) {
const event_loop = server.wl_server.getEventLoop();
@@ -248,7 +248,7 @@ pub fn dirtyRendering(wm: *WindowManager) void {
}
fn dirtyIdle(wm: *WindowManager) void {
- assert(wm.wm_scheduled.dirty or wm.rendering_scheduled.dirty);
+ assert(wm.scheduled.dirty or wm.rendering_scheduled.dirty);
wm.dirty_idle = null;
switch (wm.state) {
.idle => {
@@ -264,7 +264,7 @@ fn dirtyIdle(wm: *WindowManager) void {
fn manageStart(wm: *WindowManager) void {
assert(wm.state == .idle);
- assert(wm.wm_scheduled.dirty);
+ assert(wm.scheduled.dirty);
log.debug("manage sequence start", .{});
@@ -274,9 +274,9 @@ fn manageStart(wm: *WindowManager) void {
while (it.next()) |output| output.manageStart();
}
- assert(wm.wm_sent.output_config == null);
- wm.wm_sent.output_config = wm.wm_scheduled.output_config;
- wm.wm_scheduled.output_config = null;
+ assert(wm.sent.output_config == null);
+ wm.sent.output_config = wm.scheduled.output_config;
+ wm.scheduled.output_config = null;
{
var it = wm.windows.iterator();
@@ -288,7 +288,7 @@ fn manageStart(wm: *WindowManager) void {
while (it.next()) |seat| seat.manageStart();
}
- wm.wm_scheduled.dirty = false;
+ wm.scheduled.dirty = false;
wm.state = .manage;
if (wm.object) |wm_v1| {
@@ -306,7 +306,7 @@ pub fn manageFinish(wm: *WindowManager) void {
{
// Order is important here, Seat.manageFinish() must be called
// before Window.manageFinish().
- var it = wm.wm_sent.seats.iterator(.forward);
+ var it = wm.sent.seats.iterator(.forward);
while (it.next()) |seat| seat.manageFinish();
}
@@ -460,7 +460,7 @@ fn renderFinish(wm: *WindowManager) void {
if (wm.rendering_scheduled.dirty) {
wm.dirtyRendering();
- } else if (wm.wm_scheduled.dirty) {
+ } else if (wm.scheduled.dirty) {
wm.dirtyWindowing();
} else {
server.input_manager.processEvents();