Skip to content

Commit

Permalink
wayland: display scaled window at correct resolution
Browse files Browse the repository at this point in the history
Though it's scaled by the compositor in a ugly way, real hidpi support
should come
  • Loading branch information
lbonn committed Jun 11, 2020
1 parent 7d3371a commit 7729b62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/wayland/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ wayland_surface_protocol_enter(void *data, struct wl_surface *wl_surface, struct
return;
if ( ( output->scale < 1 ) || ( output->scale > 3 ) )
return;
// FIXME: hidpi
// wl_surface_set_buffer_scale( wl_surface, output->scale );

++wayland->scales[output->scale - 1];
if ( wayland->scale < output->scale )
Expand Down Expand Up @@ -294,8 +296,8 @@ display_surface_commit(cairo_surface_t *surface)

wl_surface_damage(wayland->surface, 0, 0, pool->width, pool->height);
wl_surface_attach(wayland->surface, buffer->buffer, 0, 0);
if ( wl_surface_get_version(wayland->surface) >= WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION )
wl_surface_set_buffer_scale(wayland->surface, wayland->scale);
// FIXME: hidpi
// wl_surface_set_buffer_scale(wayland->surface, wayland->scale);
buffer->released = FALSE;

wl_surface_commit( wayland->surface );
Expand Down

0 comments on commit 7729b62

Please sign in to comment.