Fix HiDPI support

This commit is contained in:
emersion 2017-11-21 20:58:15 +01:00
parent 5a664e1e46
commit 3262661e1e
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 4 additions and 6 deletions

View File

@ -36,7 +36,7 @@ static void view_update_output(const struct roots_view *view,
struct wlr_box box; struct wlr_box box;
view_get_box(view, &box); view_get_box(view, &box);
wl_list_for_each(output, &desktop->outputs, link) { wl_list_for_each(output, &desktop->outputs, link) {
bool intersected = before->x != -1 && wlr_output_layout_intersects( bool intersected = before != NULL && wlr_output_layout_intersects(
desktop->layout, output->wlr_output, desktop->layout, output->wlr_output,
before->x, before->y, before->x + before->width, before->x, before->y, before->x + before->width,
before->y + before->height); before->y + before->height);
@ -280,9 +280,7 @@ void view_setup(struct roots_view *view) {
} }
view_center(view); view_center(view);
struct wlr_box before; view_update_output(view, NULL);
view_get_box(view, &before);
view_update_output(view, &before);
} }
static bool view_at(struct roots_view *view, double lx, double ly, static bool view_at(struct roots_view *view, double lx, double ly,

View File

@ -253,8 +253,8 @@ void wlr_output_make_current(struct wlr_output *output) {
static void output_fullscreen_surface_render(struct wlr_output *output, static void output_fullscreen_surface_render(struct wlr_output *output,
struct wlr_surface *surface, const struct timespec *when) { struct wlr_surface *surface, const struct timespec *when) {
int x = (output->width - surface->current->width) / 2; int x = (output->width - surface->current->buffer_width) / 2;
int y = (output->height - surface->current->height) / 2; int y = (output->height - surface->current->buffer_height) / 2;
glViewport(0, 0, output->width, output->height); glViewport(0, 0, output->width, output->height);
glClearColor(0, 0, 0, 0); glClearColor(0, 0, 0, 0);