Skip to content

Commit

Permalink
Revert "implement wayland fractional scaling"
Browse files Browse the repository at this point in the history
This reverts commit b1439df.
  • Loading branch information
Cloudef committed Feb 2, 2024
1 parent 36bb77b commit 943d746
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 359 deletions.
20 changes: 1 addition & 19 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,33 +85,15 @@ lib/renderers/wayland/wlr-layer-shell-unstable-v1.h: lib/renderers/wayland/wlr-l
lib/renderers/wayland/wlr-layer-shell-unstable-v1.c: lib/renderers/wayland/wlr-layer-shell-unstable-v1.xml
wayland-scanner private-code < $^ > $@

lib/renderers/wayland/fractional-scale-v1.h: lib/renderers/wayland/fractional-scale-v1.xml
wayland-scanner client-header < $^ > $@

lib/renderers/wayland/fractional-scale-v1.c: lib/renderers/wayland/fractional-scale-v1.xml
wayland-scanner private-code < $^ > $@

lib/renderers/wayland/viewporter.h: lib/renderers/wayland/viewporter.xml
wayland-scanner client-header < $^ > $@

lib/renderers/wayland/viewporter.c: lib/renderers/wayland/viewporter.xml
wayland-scanner private-code < $^ > $@

xdg-shell.a: private override LDFLAGS += -fPIC
xdg-shell.a: private override CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I wayland-client)
xdg-shell.a: lib/renderers/wayland/xdg-shell.c
wlr-layer-shell.a: private override LDFLAGS += -fPIC
wlr-layer-shell.a: private override CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I wayland-client)
wlr-layer-shell.a: lib/renderers/wayland/wlr-layer-shell-unstable-v1.c lib/renderers/wayland/wlr-layer-shell-unstable-v1.h
fractional-scale.a: private override LDFLAGS += -fPIC
fractional-scale.a: private override CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I wayland-client)
fractional-scale.a: lib/renderers/wayland/fractional-scale-v1.c lib/renderers/wayland/fractional-scale-v1.h
viewporter.a: private override LDFLAGS += -fPIC
viewporter.a: private override CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I wayland-client)
viewporter.a: lib/renderers/wayland/viewporter.c lib/renderers/wayland/viewporter.h
bemenu-renderer-wayland.so: private override LDLIBS += $(shell $(PKG_CONFIG) --libs wayland-client cairo pango pangocairo xkbcommon)
bemenu-renderer-wayland.so: private override CPPFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I wayland-client cairo pango pangocairo xkbcommon)
bemenu-renderer-wayland.so: lib/renderers/cairo_renderer.h lib/renderers/wayland/wayland.c lib/renderers/wayland/wayland.h lib/renderers/wayland/registry.c lib/renderers/wayland/window.c xdg-shell.a wlr-layer-shell.a fractional-scale.a viewporter.a util.a
bemenu-renderer-wayland.so: lib/renderers/cairo_renderer.h lib/renderers/wayland/wayland.c lib/renderers/wayland/wayland.h lib/renderers/wayland/registry.c lib/renderers/wayland/window.c xdg-shell.a wlr-layer-shell.a util.a

common.a: client/common/common.c client/common/common.h
bemenu: common.a client/bemenu.c
Expand Down
4 changes: 1 addition & 3 deletions lib/renderers/cairo_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct cairo {
cairo_t *cr;
cairo_surface_t *surface;
PangoContext *pango;
double scale;
int scale;
};

struct cairo_color {
Expand Down Expand Up @@ -67,8 +67,6 @@ bm_cairo_create_for_surface(struct cairo *cairo, cairo_surface_t *surface)
if (!(cairo->pango = pango_cairo_create_context(cairo->cr)))
goto fail;

cairo_set_antialias(cairo->cr, CAIRO_ANTIALIAS_NONE);

cairo->surface = surface;
assert(cairo->scale > 0);
cairo_surface_set_device_scale(surface, cairo->scale, cairo->scale);
Expand Down
102 changes: 0 additions & 102 deletions lib/renderers/wayland/fractional-scale-v1.xml

This file was deleted.

7 changes: 0 additions & 7 deletions lib/renderers/wayland/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,6 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, co
output->output = wl_output;
wl_list_insert(&wayland->outputs, &output->link);
wl_output_add_listener(wl_output, &output_listener, output);
} else if (strcmp(interface, "wp_fractional_scale_manager_v1") == 0) {
wayland->wfs_mgr = wl_registry_bind(registry, id, &wp_fractional_scale_manager_v1_interface, 1);
} else if (strcmp(interface, "wp_viewporter") == 0) {
wayland->viewporter = wl_registry_bind(registry, id, &wp_viewporter_interface, 1);
}
}

Expand Down Expand Up @@ -664,9 +660,6 @@ bm_wl_registry_register(struct wayland *wayland)
if (!wayland->input.keyboard || !(wayland->formats & (1 << WL_SHM_FORMAT_ARGB8888)))
return false;

if (wayland->wfs_mgr && wayland->viewporter)
wayland->fractional_scaling = true;

set_repeat_info(&wayland->input, 40, 400);
return true;
}
Expand Down
180 changes: 0 additions & 180 deletions lib/renderers/wayland/viewporter.xml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/renderers/wayland/wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ window_update_output(struct window *window)
window->max_height = min_max_height;
}

if (!window->wayland->fractional_scaling && max_scale != window->scale) {
if (max_scale != window->scale) {
window->scale = max_scale;
}
}
Expand Down
Loading

0 comments on commit 943d746

Please sign in to comment.