mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-23 13:25:58 +01:00
Fix pointer input for rotated views on HiDPI outputs
This commit is contained in:
parent
c1eff3d3af
commit
0b3f83d93a
1 changed files with 4 additions and 3 deletions
|
@ -216,7 +216,7 @@ void view_teardown(struct roots_view *view) {
|
||||||
|
|
||||||
struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
||||||
struct wlr_surface **surface, double *sx, double *sy) {
|
struct wlr_surface **surface, double *sx, double *sy) {
|
||||||
for (int i = desktop->views->length - 1; i >= 0; --i) {
|
for (ssize_t i = desktop->views->length - 1; i >= 0; --i) {
|
||||||
struct roots_view *view = desktop->views->items[i];
|
struct roots_view *view = desktop->views->items[i];
|
||||||
|
|
||||||
if (view->type == ROOTS_WL_SHELL_VIEW &&
|
if (view->type == ROOTS_WL_SHELL_VIEW &&
|
||||||
|
@ -228,11 +228,12 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
||||||
double view_sx = lx - view->x;
|
double view_sx = lx - view->x;
|
||||||
double view_sy = ly - view->y;
|
double view_sy = ly - view->y;
|
||||||
|
|
||||||
|
struct wlr_surface_state *state = view->wlr_surface->current;
|
||||||
struct wlr_box box = {
|
struct wlr_box box = {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = view->wlr_surface->current->buffer_width,
|
.width = state->buffer_width / state->scale,
|
||||||
.height = view->wlr_surface->current->buffer_height,
|
.height = state->buffer_height / state->scale,
|
||||||
};
|
};
|
||||||
if (view->rotation != 0.0) {
|
if (view->rotation != 0.0) {
|
||||||
// Coordinates relative to the center of the view
|
// Coordinates relative to the center of the view
|
||||||
|
|
Loading…
Reference in a new issue