Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to get DPI on VMs #545

Closed
xcb-xwii opened this issue Sep 25, 2021 · 1 comment · Fixed by #547
Closed

Failure to get DPI on VMs #545

xcb-xwii opened this issue Sep 25, 2021 · 1 comment · Fixed by #547

Comments

@xcb-xwii
Copy link
Contributor

xcb-xwii commented Sep 25, 2021

On virtual machines, scaling fails and displays a blank interface as follows:
image
For those facing the issue, run export LITE_SCALE=1 before starting lite-xl.

This is due to SDL being unable to get the device DPI on VMs. When the following code is ran:

#include <SDL2/SDL.h>
#include <stdio.h>

int main() {
        SDL_Init(SDL_INIT_VIDEO);

        float i, j, k;

        int err_code = SDL_GetDisplayDPI (0, &i, &j, &k);

        printf("%d: %s\n", err_code, SDL_GetError());
        printf("%f, %f, %f\n", i, j, k);
}

The output shown is:

-1: Couldn't get DPI
0.000000, 0.000000, 0.000000
@xcb-xwii
Copy link
Contributor Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant