Skip to content

Commit

Permalink
Misc code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
serebit committed Nov 4, 2023
1 parent e1bf1ea commit 6705a03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/input/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ void Cursor::warp_to_constraint(PointerConstraint& constraint) {

void Cursor::set_image(const std::string name) {
if (current_image != name) {
wlr_xcursor_manager_set_cursor_image(cursor_mgr, name.c_str(), &wlr);
current_image = name;
reload_image();
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/input/seat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_keyboard.h>
#include <wlr/types/wlr_pointer_constraints_v1.h>
#include <wlr/util/log.h>
#include <wlr/util/region.h>
#include "wlr-wrap-end.hpp"

Expand Down Expand Up @@ -126,8 +127,6 @@ void Seat::new_input_device(wlr_input_device* device) {
}

void Seat::set_constraint(wlr_pointer_constraint_v1* wlr_constraint) {
printf("Setting constraint %p\n", (void*) wlr_constraint);

if (current_constraint.has_value()) {
if (&current_constraint.value().get().wlr == wlr_constraint) {
// we already have this constraint marked as the current constraint
Expand Down Expand Up @@ -162,7 +161,7 @@ void Seat::apply_constraint(const wlr_pointer* pointer, double* dx, double* dy)
double confined_x = 0;
double confined_y = 0;
if (!wlr_region_confine(&current_constraint->get().wlr.region, x, y, x + *dx, y + *dy, &confined_x, &confined_y)) {
printf("Couldn't confine\n");
wlr_log(WLR_ERROR, "Couldn't confine\n");
return;
}

Expand Down

0 comments on commit 6705a03

Please sign in to comment.