mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-14 03:12:47 +01:00
fix scaling problem from "support multiple outputs"
This commit is contained in:
parent
79797fc837
commit
b6ec34fe3a
@ -478,10 +478,10 @@ void
|
|||||||
kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount) {
|
kbd_resize(struct kbd *kb, struct layout *layouts, uint8_t layoutcount) {
|
||||||
struct drwsurf *d = kb->surf;
|
struct drwsurf *d = kb->surf;
|
||||||
|
|
||||||
fprintf(stderr, "Resize %dx%d %d, %d layouts\n", kb->w, kb->h, kb->s,
|
fprintf(stderr, "Resize %dx%d %d, %d layouts\n", kb->w, kb->h, kb->scale,
|
||||||
layoutcount);
|
layoutcount);
|
||||||
|
|
||||||
drwsurf_resize(d, kb->w, kb->h, kb->s);
|
drwsurf_resize(d, kb->w, kb->h, kb->scale);
|
||||||
for (int i = 0; i < layoutcount; i++) {
|
for (int i = 0; i < layoutcount; i++) {
|
||||||
kbd_init_layout(&layouts[i], kb->w, kb->h);
|
kbd_init_layout(&layouts[i], kb->w, kb->h);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ struct kbd {
|
|||||||
|
|
||||||
bool print;
|
bool print;
|
||||||
bool print_intersect;
|
bool print_intersect;
|
||||||
uint32_t w, h, s;
|
uint32_t w, h, scale;
|
||||||
bool landscape;
|
bool landscape;
|
||||||
uint8_t mods;
|
uint8_t mods;
|
||||||
uint8_t compose;
|
uint8_t compose;
|
||||||
|
5
main.c
5
main.c
@ -270,7 +270,7 @@ wl_surface_enter(void *data, struct wl_surface *wl_surface,
|
|||||||
struct wl_output *wl_output) {
|
struct wl_output *wl_output) {
|
||||||
for(int i = 0; i < WL_OUTPUTS_LIMIT; i += 1) {
|
for(int i = 0; i < WL_OUTPUTS_LIMIT; i += 1) {
|
||||||
if(wl_outputs[i].data == wl_output) {
|
if(wl_outputs[i].data == wl_output) {
|
||||||
keyboard.s = wl_outputs[i].scale;
|
keyboard.scale = wl_outputs[i].scale;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -317,6 +317,7 @@ display_handle_done(void *data, struct wl_output *wl_output) {}
|
|||||||
static void
|
static void
|
||||||
display_handle_scale(void *data, struct wl_output *wl_output, int32_t scale) {
|
display_handle_scale(void *data, struct wl_output *wl_output, int32_t scale) {
|
||||||
((struct Output*)data)->scale = scale;
|
((struct Output*)data)->scale = scale;
|
||||||
|
keyboard.scale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -525,7 +526,7 @@ main(int argc, char **argv) {
|
|||||||
keyboard.scheme = scheme;
|
keyboard.scheme = scheme;
|
||||||
keyboard.layer_index = 0;
|
keyboard.layer_index = 0;
|
||||||
keyboard.scheme1 = scheme1;
|
keyboard.scheme1 = scheme1;
|
||||||
keyboard.s = 1;
|
keyboard.scale = 1;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 1; argv[i]; i++) {
|
for (i = 1; argv[i]; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user