Skip to content

Commit

Permalink
Finish the function for applying a layout change
Browse files Browse the repository at this point in the history
  • Loading branch information
serebit committed Nov 3, 2023
1 parent 0b624cb commit dd6713b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/input/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,7 @@ void Cursor::set_image(const std::string name) {
current_image = name;
}
}

void Cursor::reload_image() {
wlr_xcursor_manager_set_cursor_image(cursor_mgr, current_image.c_str(), cursor);
}
1 change: 1 addition & 0 deletions src/input/cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Cursor {
void reset_mode();
void warp_to_constraint(PointerConstraint& constraint);
void set_image(const std::string name);
void reload_image();
};

#endif
9 changes: 9 additions & 0 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,15 @@ void output_manager_apply_notify(wl_listener* listener, void* data) {
output.scene_output = nullptr;
}
}

wlr_output_configuration_v1_send_succeeded(&config);
wlr_output_configuration_v1_destroy(&config);

for (auto* output : server.outputs) {
wlr_xcursor_manager_load(server.seat->cursor.cursor_mgr, output->wlr->scale);
}

server.seat->cursor.reload_image();
}

Server::Server() : listeners(*this) {
Expand Down

0 comments on commit dd6713b

Please sign in to comment.