store scale and scale windows with monitor

This commit is contained in:
vaxerski 2022-04-17 18:47:10 +02:00
parent 748a787ba2
commit b0f5e4ab56
6 changed files with 21 additions and 11 deletions

View file

@ -54,4 +54,11 @@ std::string getFormat(const char *fmt, ...) {
va_end(args);
return std::string(buf);
}
void scaleBox(wlr_box* box, float scale) {
box->width = std::round((box->x + box->width) * scale) - std::round(box->x * scale);
box->height = std::round((box->y + box->height) * scale) - std::round(box->y * scale);
box->x = std::round(box->x * scale);
box->y = std::round(box->y * scale);
}

View file

@ -4,4 +4,5 @@
void addWLSignal(wl_signal*, wl_listener*, void* pOwner, std::string ownerString);
void wlr_signal_emit_safe(struct wl_signal *signal, void *data);
std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string
std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string
void scaleBox(wlr_box*, float);

View file

@ -14,6 +14,7 @@ struct SMonitor {
uint64_t ID = -1;
int activeWorkspace = -1;
float scale = 1;
std::string szName = "";