Skip to content
Myr

wayland: take output rotation into account when calculating logical PPI

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent cded0f5 · Browse files · 2 files+19 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+19 added−0 removed

  • other:+19 added−0 removed

2 files+19 added−0 removed

modified:CHANGELOG.md+1 added
modified:wayland.c+18 added
74 unmodified lines
75 int y;76 } scaled;77 } ppi;7879 enum wl_output_transform transform;8081 /* From wl_output */82 char *make;83 char *model;84
799 unmodified lines
884 return;885886 int x_inches = mon->dim.mm.width * 0.03937008;887 int y_inches = mon->dim.mm.height * 0.03937008;888889 mon->ppi.real.x = mon->dim.px_real.width / x_inches;890 mon->ppi.real.y = mon->dim.px_real.height / y_inches;891892 /* The *logical* size is affected by the transform */893 switch (mon->transform) {894 case WL_OUTPUT_TRANSFORM_90:895 case WL_OUTPUT_TRANSFORM_270:896 case WL_OUTPUT_TRANSFORM_FLIPPED_90:897 case WL_OUTPUT_TRANSFORM_FLIPPED_270: {898 int swap = x_inches;899 x_inches = y_inches;900 y_inches = swap;901 break;902 }903 }904905 mon->ppi.scaled.x = mon->dim.px_scaled.width / x_inches;906 mon->ppi.scaled.y = mon->dim.px_scaled.height / y_inches;907}908
5 unmodified lines
914{915 struct monitor *mon = data;916 mon->dim.mm.width = physical_width;917 mon->dim.mm.height = physical_height;918 LOG_ERR("mm.width = %d, mm.height = %d", physical_width, physical_height);919 mon->inch = sqrt(pow(mon->dim.mm.width, 2) + pow(mon->dim.mm.height, 2)) * 0.03937008;920 mon->make = make != NULL ? strdup(make) : NULL;921 mon->model = model != NULL ? strdup(model) : NULL;922 mon->subpixel = subpixel;923 mon->transform = transform;924 output_update_ppi(mon);925}926927static void
665 unmodified lines