diff options
author | Avery | 2022-10-31 16:45:15 +0800 |
---|---|---|
committer | Avery | 2022-10-31 16:45:15 +0800 |
commit | 959a302919bd471515789cac960b104c809c1e4c (patch) | |
tree | a5b7c815f527689e18ca4cd14ccdd74e5ed782cd | |
parent | 3eace3523206e06ca14de750e16ae6041ad09441 (diff) | |
download | aur-959a302919bd471515789cac960b104c809c1e4c.tar.gz |
chore: Track upstream and update patch
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | 0000_Multi_DPI_support_via_global_factor_rescaling.patch (renamed from hidpi.patch) | 528 | ||||
-rw-r--r-- | 0001_Do_not_ignore_leave_events.patch | 50 | ||||
-rw-r--r-- | 0001_Remove_scale_atom_access_control.patch | 37 | ||||
-rw-r--r-- | 0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch | 237 | ||||
-rw-r--r-- | PKGBUILD | 51 |
6 files changed, 432 insertions, 496 deletions
@@ -1,12 +1,12 @@ -pkgbase = xorg-xwayland-hidpi-xprop +pkgbase = xorg-xwayland-hidpi-xprop-git pkgdesc = run X clients under wayland, with !733 HiDPI patch - pkgver = 22.1.4 - pkgrel = 2 + pkgver = 22.1.4.r138.g459e28557 + pkgrel = 1 url = https://xorg.freedesktop.org arch = x86_64 license = custom makedepends = meson - makedepends = xorgproto + makedepends = xorgproto-git makedepends = xtrans makedepends = libxkbfile makedepends = dbus @@ -31,16 +31,11 @@ pkgbase = xorg-xwayland-hidpi-xprop replaces = xorg-server-xwayland options = debug options = strip - source = https://xorg.freedesktop.org/archive/individual/xserver/xwayland-22.1.4.tar.xz - source = https://xorg.freedesktop.org/archive/individual/xserver/xwayland-22.1.4.tar.xz.sig - source = hidpi.patch - source = 0001_Do_not_ignore_leave_events.patch::https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/987.patch - source = 0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch::https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/988.patch - validpgpkeys = 67DC86F2623FC5FD4BB5225D14706DBE1E4B4540 - sha512sums = a1301df1687ac276172565c98b1fb3d5f35f67d47f625b81fce485d1818cf4896f88c2750b4e93596fa6f7fd515e258d201ca3d0cc39943b576f2d2c3f9be8cd + source = git+https://gitlab.freedesktop.org/xorg/xserver.git + source = 0000_Multi_DPI_support_via_global_factor_rescaling.patch::https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/733.patch + source = 0001_Remove_scale_atom_access_control.patch sha512sums = SKIP - sha512sums = 7132c44d9bbf1c5f93906ef301a6e946f0909da0b9273f397281e681ad0da77d62b960a9dd0a640c7209548192fefba9bde03c493f3a89d08cd73a12844bb518 - sha512sums = d0c87face4485050db134e5ed14d930bdae05d81149b2b573b97fc6dd96d9234e709d6f0523221747293da20cbd012e1e1da00e12b227f98597ffa320bcd3e3c - sha512sums = fea7abdd962fd0a8e653069f7926508d2dd90a0a6632d4aae2265a221267f1777fba4aeaaf494dc6f3e4a11a15a7eabd524ca16f948e0d3fee05c6a4b8a69fd4 + sha512sums = ab927b1e038346f967723a3d45a405a0a8339759e15901d0913a55d1348683831e0d058c76c6f7cb2e264a5cef781a507fb290d139ac0f2806a62bd20d84147d + sha512sums = f16cb5455a1caf26c586cca2d1ec6f4708804721b7d6a8d8bd1e4a7b47b97e8b822d3455fce0da3c74bb14baf6a3980574d85019cf242d6a033a578587f74b14 -pkgname = xorg-xwayland-hidpi-xprop +pkgname = xorg-xwayland-hidpi-xprop-git diff --git a/hidpi.patch b/0000_Multi_DPI_support_via_global_factor_rescaling.patch index 5bdb7875a88d..6ffb3550a37a 100644 --- a/hidpi.patch +++ b/0000_Multi_DPI_support_via_global_factor_rescaling.patch @@ -1,17 +1,58 @@ +From ca9457b7fbc145642c079a1cb30148b5c11f10ef Mon Sep 17 00:00:00 2001 +From: Dario Nieuwenhuis <dirbaio@dirbaio.net> +Date: Sat, 2 May 2020 03:52:55 +0200 +Subject: [PATCH 1/4] xwayland: Multi DPI support via global factor rescaling + +To benefit from Wayland's multi DPI capabilities in XWayland a global scaling +factor is introduced, which is applied to all outputs. + +The RandR size of an output is calculated by the (integer-)multiplication of +this global scaling factor with its logical size received via the xdg-output +protocol. + +In other words the size of any RandR screen corresponds to the mode size of +its wl_output multiplied with the quotient of global scaling factor divided by +the compositor's internal output-dependent scaling factor. + +HiDPI aware X clients can then provide Pixmaps enlarged by the global scaling +factor and the Wayland compositor is supposed to downscale these buffers on +outputs scaled by less than the global scaling factor. + +A Wayland compositor needs to scale all X communication in its XWM part by the +global scaling factor, such that X windows have the correct geometry. + +In summary: +* All positions in Wayland internal communication must be carried out by the +compositor in logical coordinates, i.e. in its compositor space. +* All positions in X internal communication are based on RandR sizes. +* All positions in Wayland to X communication must be multiplied by the global +scaling factor. +* All positions in X to Wayland communication must be divided by the global +scaling factor. + +In order to not break compositors that do not support these transformations, +the global scaling factor is set to 1 by default, which behaves the same as +before. + +[dirbaio@dirbaio.net: fix incorrect scaling in a few places] +[rymg19@gmail.com: minor style fixes] +Signed-off-by: Roman Gilg <subdiff@gmail.com> +Signed-off-by: Dario Nieuwenhuis <dirbaio@dirbaio.net> +--- + hw/xwayland/xwayland-cursor.c | 10 ++++++---- + hw/xwayland/xwayland-input.c | 36 +++++++++++++++++++---------------- + hw/xwayland/xwayland-output.c | 18 ++++++++++++------ + hw/xwayland/xwayland-output.h | 4 +++- + hw/xwayland/xwayland-screen.c | 27 +++++++++++++++++++++++++- + hw/xwayland/xwayland-screen.h | 4 ++++ + hw/xwayland/xwayland-window.c | 4 +++- + 7 files changed, 74 insertions(+), 29 deletions(-) + diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c -index e3c1aaa50..1c1cef853 100644 +index e3c1aaa50..8467b8f36 100644 --- a/hw/xwayland/xwayland-cursor.c +++ b/hw/xwayland/xwayland-cursor.c -@@ -164,6 +164,8 @@ xwl_cursor_attach_pixmap(struct xwl_seat *xwl_seat, - } - - wl_surface_attach(xwl_cursor->surface, buffer, 0, 0); -+ wl_surface_set_buffer_scale(xwl_cursor->surface, -+ xwl_seat->xwl_screen->global_output_scale); - xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, - xwl_seat->x_cursor->bits->width, - xwl_seat->x_cursor->bits->height); -@@ -195,6 +197,7 @@ xwl_cursor_clear_frame_cb(struct xwl_cursor *xwl_cursor) +@@ -195,6 +195,7 @@ xwl_cursor_clear_frame_cb(struct xwl_cursor *xwl_cursor) void xwl_seat_set_cursor(struct xwl_seat *xwl_seat) { @@ -19,7 +60,7 @@ index e3c1aaa50..1c1cef853 100644 struct xwl_cursor *xwl_cursor = &xwl_seat->cursor; PixmapPtr pixmap; CursorPtr cursor; -@@ -225,8 +228,8 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) +@@ -225,8 +226,8 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) wl_pointer_set_cursor(xwl_seat->wl_pointer, xwl_seat->pointer_enter_serial, xwl_cursor->surface, @@ -30,7 +71,7 @@ index e3c1aaa50..1c1cef853 100644 xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); } -@@ -235,6 +238,7 @@ void +@@ -235,6 +236,7 @@ void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) { struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; @@ -38,24 +79,22 @@ index e3c1aaa50..1c1cef853 100644 struct xwl_cursor *xwl_cursor = &xwl_tablet_tool->cursor; PixmapPtr pixmap; CursorPtr cursor; -@@ -263,9 +267,9 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) +@@ -263,8 +265,8 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool, xwl_tablet_tool->proximity_in_serial, xwl_cursor->surface, - xwl_seat->x_cursor->bits->xhot, - xwl_seat->x_cursor->bits->yhot); -- + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->xhot), + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->yhot)); -+ wl_surface_set_buffer_scale(xwl_cursor->surface, xwl_screen->global_output_scale); + xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); } - diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 869749ec6..601236139 100644 +index 9eda1ef71..70bffb790 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c -@@ -452,8 +452,8 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, +@@ -504,8 +504,8 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, DeviceIntPtr dev = get_pointer_device(xwl_seat); DeviceIntPtr master; int i; @@ -66,7 +105,7 @@ index 869749ec6..601236139 100644 int dx, dy; ScreenPtr pScreen = xwl_seat->xwl_screen->screen; ValuatorMask mask; -@@ -672,13 +672,14 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, +@@ -728,13 +728,14 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { struct xwl_seat *xwl_seat = data; @@ -83,7 +122,7 @@ index 869749ec6..601236139 100644 if (wl_proxy_get_version((struct wl_proxy *) xwl_seat->wl_pointer) < 5) dispatch_pointer_motion_event(xwl_seat); -@@ -809,12 +810,13 @@ relative_pointer_handle_relative_motion(void *data, +@@ -865,12 +866,13 @@ relative_pointer_handle_relative_motion(void *data, wl_fixed_t dy_unaccelf) { struct xwl_seat *xwl_seat = data; @@ -101,7 +140,7 @@ index 869749ec6..601236139 100644 if (!xwl_seat->focus_window) return; -@@ -1264,8 +1266,8 @@ touch_handle_down(void *data, struct wl_touch *wl_touch, +@@ -1360,8 +1362,8 @@ touch_handle_down(void *data, struct wl_touch *wl_touch, xwl_touch->window = wl_surface_get_user_data(surface); xwl_touch->id = id; @@ -112,7 +151,7 @@ index 869749ec6..601236139 100644 xorg_list_add(&xwl_touch->link_touch, &xwl_seat->touches); xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchBegin); -@@ -1301,8 +1303,8 @@ touch_handle_motion(void *data, struct wl_touch *wl_touch, +@@ -1397,8 +1399,8 @@ touch_handle_motion(void *data, struct wl_touch *wl_touch, if (!xwl_touch) return; @@ -123,7 +162,7 @@ index 869749ec6..601236139 100644 xwl_touch_send_event(xwl_touch, xwl_seat, XI_TouchUpdate); } -@@ -1991,8 +1993,8 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, +@@ -2087,8 +2089,8 @@ tablet_tool_motion(void *data, struct zwp_tablet_tool_v2 *tool, struct xwl_tablet_tool *xwl_tablet_tool = data; struct xwl_seat *xwl_seat = xwl_tablet_tool->seat; int32_t dx, dy; @@ -134,7 +173,7 @@ index 869749ec6..601236139 100644 if (!xwl_seat->tablet_focus_window) return; -@@ -3021,6 +3023,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em +@@ -3129,6 +3131,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em int x, int y) { @@ -142,7 +181,7 @@ index 869749ec6..601236139 100644 struct zwp_locked_pointer_v1 *locked_pointer = warp_emulator->locked_pointer; WindowPtr window; -@@ -3032,6 +3035,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em +@@ -3140,6 +3143,7 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em if (!warp_emulator->xwl_seat->focus_window) return; @@ -150,7 +189,7 @@ index 869749ec6..601236139 100644 window = warp_emulator->xwl_seat->focus_window->window; if (x >= window->drawable.x || y >= window->drawable.y || -@@ -3040,8 +3044,8 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em +@@ -3148,8 +3152,8 @@ xwl_pointer_warp_emulator_set_fake_pos(struct xwl_pointer_warp_emulator *warp_em sx = x - window->drawable.x; sy = y - window->drawable.y; zwp_locked_pointer_v1_set_cursor_position_hint(locked_pointer, @@ -162,12 +201,12 @@ index 869749ec6..601236139 100644 } } diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c -index a351fc9f7..9ae33f648 100644 +index 818df6d08..692532d7e 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c -@@ -184,6 +184,9 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height) - { - struct xwl_screen *xwl_screen = xwl_output->xwl_screen; +@@ -187,6 +187,9 @@ update_screen_size(struct xwl_screen *xwl_screen, int width, int height) + xwl_screen->width = width; + xwl_screen->height = height; + width *= xwl_screen->global_output_scale; + height *= xwl_screen->global_output_scale; @@ -175,7 +214,7 @@ index a351fc9f7..9ae33f648 100644 if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL) SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE); -@@ -584,14 +587,15 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, +@@ -594,14 +597,15 @@ xwl_output_set_emulated_mode(struct xwl_output *xwl_output, ClientPtr client, new_emulated_height); } @@ -193,20 +232,20 @@ index a351fc9f7..9ae33f648 100644 /* Clear out the "done" received flags */ xwl_output->wl_output_done = FALSE; -@@ -610,10 +614,10 @@ apply_output_change(struct xwl_output *xwl_output) +@@ -620,10 +624,10 @@ apply_output_change(struct xwl_output *xwl_output) } - - /* Build a fresh modes array using the current refresh rate */ -- randr_modes = output_get_rr_modes(xwl_output, mode_width, mode_height, &count); -+ randr_modes = output_get_rr_modes(xwl_output, mode_width * scale, mode_height * scale, &count); - RROutputSetModes(xwl_output->randr_output, randr_modes, count, 1); - RRCrtcNotify(xwl_output->randr_crtc, randr_modes[0], -- xwl_output->x, xwl_output->y, -+ xwl_output->x * scale, xwl_output->y * scale, - xwl_output->rotation, NULL, 1, &xwl_output->randr_output); - /* RROutputSetModes takes ownership of the passed in modes, so we only - * have to free the pointer array. -@@ -654,7 +658,7 @@ output_handle_done(void *data, struct wl_output *wl_output) + if (xwl_output->randr_output) { + /* Build a fresh modes array using the current refresh rate */ +- randr_modes = output_get_rr_modes(xwl_output, mode_width, mode_height, &count); ++ randr_modes = output_get_rr_modes(xwl_output, mode_width * scale, mode_height * scale, &count); + RROutputSetModes(xwl_output->randr_output, randr_modes, count, 1); + RRCrtcNotify(xwl_output->randr_crtc, randr_modes[0], +- xwl_output->x, xwl_output->y, ++ xwl_output->x * scale, xwl_output->y * scale, + xwl_output->rotation, NULL, 1, &xwl_output->randr_output); + /* RROutputSetModes takes ownership of the passed in modes, so we only + * have to free the pointer array. +@@ -666,7 +670,7 @@ output_handle_done(void *data, struct wl_output *wl_output) */ if (xwl_output->xdg_output_done || !xwl_output->xdg_output || zxdg_output_v1_get_version(xwl_output->xdg_output) >= 3) @@ -215,7 +254,7 @@ index a351fc9f7..9ae33f648 100644 } static void -@@ -697,7 +701,7 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) +@@ -709,7 +713,7 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) xwl_output->xdg_output_done = TRUE; if (xwl_output->wl_output_done && zxdg_output_v1_get_version(xdg_output) < 3) @@ -224,17 +263,17 @@ index a351fc9f7..9ae33f648 100644 } static void -@@ -786,6 +790,8 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) - RROutputSetConnection(xwl_output->randr_output, RR_Connected); - RRTellChanged(xwl_screen->screen); - -+ xwl_output->scale = 1; +@@ -814,6 +818,8 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id, Bool with_xrandr) + RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc, 1); + RROutputSetConnection(xwl_output->randr_output, RR_Connected); + RRTellChanged(xwl_screen->screen); + ++ xwl_output->scale = 1; + } /* We want the output to be in the list as soon as created so we can * use it when binding to the xdg-output protocol... - */ diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h -index 74a46994f..919a22768 100644 +index 603b54527..ad153aae5 100644 --- a/hw/xwayland/xwayland-output.h +++ b/hw/xwayland/xwayland-output.h @@ -53,7 +53,7 @@ struct xwl_output { @@ -246,7 +285,7 @@ index 74a46994f..919a22768 100644 Rotation rotation; Bool wl_output_done; Bool xdg_output_done; -@@ -92,6 +92,8 @@ void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, +@@ -100,6 +100,8 @@ void xwl_output_set_emulated_mode(struct xwl_output *xwl_output, void xwl_output_set_window_randr_emu_props(struct xwl_screen *xwl_screen, WindowPtr window); @@ -254,7 +293,148 @@ index 74a46994f..919a22768 100644 + void xwl_screen_init_xdg_output(struct xwl_screen *xwl_screen); - int xwl_get_next_output_serial(void); + #endif /* XWAYLAND_OUTPUT_H */ +diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c +index 427489690..88192bbde 100644 +--- a/hw/xwayland/xwayland-screen.c ++++ b/hw/xwayland/xwayland-screen.c +@@ -110,6 +110,12 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) + return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); + } + ++int ++xwl_scale_to(struct xwl_screen *xwl_screen, int value) ++{ ++ return value / (double)xwl_screen->global_output_scale + 0.5; ++} ++ + /* Return the output @ 0x0, falling back to the first output in the list */ + struct xwl_output * + xwl_screen_get_first_output(struct xwl_screen *xwl_screen) +@@ -631,8 +637,14 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, + { + if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) + wl_surface_damage_buffer(surface, x, y, width, height); +- else ++ else { ++ x = xwl_scale_to(xwl_screen, x); ++ y = xwl_scale_to(xwl_screen, y); ++ width = xwl_scale_to(xwl_screen, width); ++ height = xwl_scale_to(xwl_screen, height); ++ + wl_surface_damage(surface, x, y, width, height); ++ } + } + + void +@@ -701,6 +713,18 @@ xwl_screen_get_next_output_serial(struct xwl_screen *xwl_screen) + return xwl_screen->output_name_serial++; + } + ++void ++xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale) ++{ ++ struct xwl_output *it; ++ xwl_screen->global_output_scale = scale; ++ ++ /* change randr resolutions and positions */ ++ xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { ++ xwl_output_apply_changes(it); ++ } ++} ++ + Bool + xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + { +@@ -739,6 +763,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + #ifdef XWL_HAS_GLAMOR + xwl_screen->glamor = 1; + #endif ++ xwl_screen->global_output_scale = 1; + + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-rootless") == 0) { +diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h +index 3c8eb8270..b8f71acca 100644 +--- a/hw/xwayland/xwayland-screen.h ++++ b/hw/xwayland/xwayland-screen.h +@@ -86,6 +86,8 @@ struct xwl_screen { + struct xorg_list damage_window_list; + struct xorg_list window_list; + ++ int32_t global_output_scale; ++ + int wayland_fd; + struct wl_display *display; + struct wl_registry *registry; +@@ -162,5 +164,7 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, + struct wl_surface *surface, + int32_t x, int32_t y, int32_t width, int32_t height); + int xwl_screen_get_next_output_serial(struct xwl_screen * xwl_screen); ++int xwl_scale_to(struct xwl_screen *xwl_screen, int value); ++void xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale); + + #endif /* XWAYLAND_SCREEN_H */ +diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c +index 2a88c89ea..4ea9156f4 100644 +--- a/hw/xwayland/xwayland-window.c ++++ b/hw/xwayland/xwayland-window.c +@@ -722,7 +722,8 @@ xwl_create_root_surface(struct xwl_window *xwl_window) + } + + wl_region_add(region, 0, 0, +- window->drawable.width, window->drawable.height); ++ xwl_scale_to(xwl_screen, window->drawable.width), ++ xwl_scale_to(xwl_screen, window->drawable.height)); + wl_surface_set_opaque_region(xwl_window->surface, region); + wl_region_destroy(region); + +@@ -1199,6 +1200,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + } + #endif + ++ wl_surface_set_buffer_scale(xwl_window->surface, xwl_screen->global_output_scale); + wl_surface_attach(xwl_window->surface, buffer, 0, 0); + + /* Arbitrary limit to try to avoid flooding the Wayland +-- +GitLab + + +From ac867af5e9002b067a9aacba55b0858b55f57bbc Mon Sep 17 00:00:00 2001 +From: Christopher Snowhill <kode54@gmail.com> +Date: Thu, 3 Sep 2020 04:17:06 -0700 +Subject: [PATCH 2/4] xwayland: Fix cursor size, present scale, and present + damage + +--- + hw/xwayland/xwayland-cursor.c | 4 +++- + hw/xwayland/xwayland-present.c | 2 ++ + hw/xwayland/xwayland-window.c | 2 +- + 3 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c +index 8467b8f36..1c1cef853 100644 +--- a/hw/xwayland/xwayland-cursor.c ++++ b/hw/xwayland/xwayland-cursor.c +@@ -164,6 +164,8 @@ xwl_cursor_attach_pixmap(struct xwl_seat *xwl_seat, + } + + wl_surface_attach(xwl_cursor->surface, buffer, 0, 0); ++ wl_surface_set_buffer_scale(xwl_cursor->surface, ++ xwl_seat->xwl_screen->global_output_scale); + xwl_surface_damage(xwl_seat->xwl_screen, xwl_cursor->surface, 0, 0, + xwl_seat->x_cursor->bits->width, + xwl_seat->x_cursor->bits->height); +@@ -267,7 +269,7 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool) + xwl_cursor->surface, + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->xhot), + xwl_scale_to(xwl_screen, xwl_seat->x_cursor->bits->yhot)); +- ++ wl_surface_set_buffer_scale(xwl_cursor->surface, xwl_screen->global_output_scale); + xwl_cursor_attach_pixmap(xwl_seat, xwl_cursor, pixmap); + } + diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index 99e476b2f..1e35f857e 100644 --- a/hw/xwayland/xwayland-present.c @@ -268,33 +448,52 @@ index 99e476b2f..1e35f857e 100644 if (xorg_list_is_empty(&xwl_present_window->frame_callback_list)) { xorg_list_add(&xwl_present_window->frame_callback_list, +diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c +index 4ea9156f4..39988e5cc 100644 +--- a/hw/xwayland/xwayland-window.c ++++ b/hw/xwayland/xwayland-window.c +@@ -1200,8 +1200,8 @@ xwl_window_post_damage(struct xwl_window *xwl_window) + } + #endif + +- wl_surface_set_buffer_scale(xwl_window->surface, xwl_screen->global_output_scale); + wl_surface_attach(xwl_window->surface, buffer, 0, 0); ++ wl_surface_set_buffer_scale(xwl_window->surface, xwl_screen->global_output_scale); + + /* Arbitrary limit to try to avoid flooding the Wayland + * connection. If we flood it too much anyway, this could +-- +GitLab + + +From b11f89592c274b3a1bce37ef259d7d20ee2a8050 Mon Sep 17 00:00:00 2001 +From: Ryan Gonzalez <rymg19@gmail.com> +Date: Mon, 23 Aug 2021 12:53:19 -0500 +Subject: [PATCH 3/4] xwayland: Allow controlling global output scale via + properties + +This adds a new property, _XWAYLAND_GLOBAL_OUTPUT_SCALE, to control the +global output scale from the compositor. +--- + hw/xwayland/xwayland-screen.c | 77 ++++++++++++++++++++++++++++++++--- + hw/xwayland/xwayland-screen.h | 1 + + 2 files changed, 72 insertions(+), 6 deletions(-) + diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c -index 812d60dfc..bc96dd26d 100644 +index 88192bbde..1090b6fca 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c -@@ -51,6 +51,7 @@ - #include "xwayland-pixmap.h" - #include "xwayland-present.h" - #include "xwayland-shm.h" -+#include "xwayland-window-buffers.h" - - #ifdef MITSHM - #include "shmint.h" -@@ -110,6 +111,12 @@ xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen) - return xwl_screen->rootless && xwl_screen_has_viewport_support(xwl_screen); - } - -+int -+xwl_scale_to(struct xwl_screen *xwl_screen, int value) -+{ -+ return value / (double)xwl_screen->global_output_scale + 0.5; -+} -+ - /* Return the output @ 0x0, falling back to the first output in the list */ - struct xwl_output * - xwl_screen_get_first_output(struct xwl_screen *xwl_screen) -@@ -127,6 +134,37 @@ xwl_screen_get_first_output(struct xwl_screen *xwl_screen) - return xorg_list_first_entry(&xwl_screen->output_list, struct xwl_output, link); +@@ -42,6 +42,8 @@ + #include <propertyst.h> + #include <inputstr.h> + #include <xserver_poll.h> ++#include <xace.h> ++#include <xacestr.h> + + #include "xwayland-cursor.h" + #include "xwayland-screen.h" +@@ -142,6 +144,55 @@ xwl_screen_get_fixed_or_first_output(struct xwl_screen *xwl_screen) + return xwl_screen_get_first_output(xwl_screen); } +static void @@ -306,7 +505,7 @@ index 812d60dfc..bc96dd26d 100644 + if (prop->type != XA_CARDINAL || prop->format != 32 || prop->size != 1) { + // TODO: handle warnings more cleanly. + LogMessageVerb(X_WARNING, 0, "Bad value for property %s.\n", -+ NameForAtom(prop->propertyName)); ++ NameForAtom(prop->propertyName)); + return; + } + @@ -328,10 +527,28 @@ index 812d60dfc..bc96dd26d 100644 + } +} + ++static void ++xwl_screen_validate_property_access(CallbackListPtr *pcbl, ++ void *userdata, ++ void *calldata) ++{ ++ XacePropertyAccessRec *rec = calldata; ++ struct xwl_screen *xwl_screen = userdata; ++ ATOM name = (*rec->ppProp)->propertyName; ++ ++ if (name == xwl_screen->global_output_scale_prop && ++ rec->client->index != xwl_screen->wm_client_id) { ++ LogMessageVerb(X_WARNING, 0, ++ "Client %x tried to illegaly set %s on the root window.\n", ++ rec->client->index, NameForAtom(name)); ++ rec->status = BadAccess; ++ } ++} ++ static void xwl_property_callback(CallbackListPtr *pcbl, void *closure, void *calldata) -@@ -134,19 +172,24 @@ xwl_property_callback(CallbackListPtr *pcbl, void *closure, +@@ -149,19 +200,24 @@ xwl_property_callback(CallbackListPtr *pcbl, void *closure, ScreenPtr screen = closure; PropertyStateRec *rec = calldata; struct xwl_screen *xwl_screen; @@ -362,50 +579,7 @@ index 812d60dfc..bc96dd26d 100644 } static void -@@ -568,8 +611,14 @@ void xwl_surface_damage(struct xwl_screen *xwl_screen, - { - if (wl_surface_get_version(surface) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) - wl_surface_damage_buffer(surface, x, y, width, height); -- else -+ else { -+ x = xwl_scale_to(xwl_screen, x); -+ y = xwl_scale_to(xwl_screen, y); -+ width = xwl_scale_to(xwl_screen, width); -+ height = xwl_scale_to(xwl_screen, height); -+ - wl_surface_damage(surface, x, y, width, height); -+ } - } - - void -@@ -632,10 +681,34 @@ xwl_screen_setup_custom_vector(struct xwl_screen *xwl_screen) - ProcVector[X_UngrabServer] = xwl_server_ungrab; - } - -+void -+xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale) -+{ -+ struct xwl_output *it; -+ struct xwl_window *xwl_window; -+ -+ xwl_screen->global_output_scale = scale; -+ -+ /* change randr resolutions and positions */ -+ xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { -+ xwl_output_apply_changes(it); -+ } -+ -+ if (!xwl_screen->rootless && xwl_screen->screen->root) { -+ /* Clear all the buffers, so that they'll be remade with the new sizes -+ * (this doesn't occur automatically because as far as Xorg is -+ * concerned, the window's size is the same) */ -+ xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) { -+ xwl_window_buffers_recycle(xwl_window); -+ } -+ } -+} -+ - Bool +@@ -729,6 +785,7 @@ Bool xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) { static const char allow_commits[] = "_XWAYLAND_ALLOW_COMMITS"; @@ -413,15 +587,7 @@ index 812d60dfc..bc96dd26d 100644 struct xwl_screen *xwl_screen; Pixel red_mask, blue_mask, green_mask; int ret, bpc, green_bpc, i; -@@ -667,6 +740,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) - #ifdef XWL_HAS_GLAMOR - xwl_screen->glamor = 1; - #endif -+ xwl_screen->global_output_scale = 1; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-rootless") == 0) { -@@ -841,6 +915,12 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) +@@ -1006,9 +1063,17 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) if (xwl_screen->allow_commits_prop == BAD_RESOURCE) return FALSE; @@ -434,20 +600,16 @@ index 812d60dfc..bc96dd26d 100644 AddCallback(&PropertyStateCallback, xwl_property_callback, pScreen); AddCallback(&RootWindowFinalizeCallback, xwl_root_window_finalized_callback, pScreen); ++ XaceRegisterCallback(XACE_PROPERTY_ACCESS, xwl_screen_validate_property_access, xwl_screen); ++ + xwl_screen_setup_custom_vector(xwl_screen); + + xwl_screen_roundtrip(xwl_screen); diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h -index 6d1e7d1bd..b3be22596 100644 +index b8f71acca..a9d00db4c 100644 --- a/hw/xwayland/xwayland-screen.h +++ b/hw/xwayland/xwayland-screen.h -@@ -76,6 +76,8 @@ struct xwl_screen { - struct xorg_list damage_window_list; - struct xorg_list window_list; - -+ int32_t global_output_scale; -+ - int wayland_fd; - struct wl_display *display; - struct wl_registry *registry; -@@ -116,6 +118,7 @@ struct xwl_screen { +@@ -131,6 +131,7 @@ struct xwl_screen { struct glamor_context *glamor_ctx; Atom allow_commits_prop; @@ -455,33 +617,55 @@ index 6d1e7d1bd..b3be22596 100644 /* The preferred GLVND vendor. If NULL, "mesa" is assumed. */ const char *glvnd_vendor; -@@ -143,5 +146,7 @@ void xwl_screen_roundtrip (struct xwl_screen *xwl_screen); - void xwl_surface_damage(struct xwl_screen *xwl_screen, - struct wl_surface *surface, - int32_t x, int32_t y, int32_t width, int32_t height); -+int xwl_scale_to(struct xwl_screen *xwl_screen, int value); -+void xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale); +-- +GitLab + + +From 01513cd124576167ec802e43e952d33476ce0d32 Mon Sep 17 00:00:00 2001 +From: Ryan Gonzalez <rymg19@gmail.com> +Date: Mon, 23 Aug 2021 13:00:53 -0500 +Subject: [PATCH 4/4] xwayland: Clear output buffers on scale change + +--- + hw/xwayland/xwayland-screen.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c +index 1090b6fca..ffaeaae1a 100644 +--- a/hw/xwayland/xwayland-screen.c ++++ b/hw/xwayland/xwayland-screen.c +@@ -53,6 +53,7 @@ + #include "xwayland-pixmap.h" + #include "xwayland-present.h" + #include "xwayland-shm.h" ++#include "xwayland-window-buffers.h" - #endif /* XWAYLAND_SCREEN_H */ -diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c -index 38992d5c1..053c9b066 100644 ---- a/hw/xwayland/xwayland-window.c -+++ b/hw/xwayland/xwayland-window.c -@@ -491,7 +491,8 @@ ensure_surface_for_window(WindowPtr window) - } - - wl_region_add(region, 0, 0, -- window->drawable.width, window->drawable.height); -+ xwl_scale_to(xwl_screen, window->drawable.width), -+ xwl_scale_to(xwl_screen, window->drawable.height)); - wl_surface_set_opaque_region(xwl_window->surface, region); - wl_region_destroy(region); - } -@@ -919,6 +920,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window) - #endif + #ifdef MITSHM + #include "shmint.h" +@@ -773,12 +774,23 @@ void + xwl_screen_set_global_scale(struct xwl_screen *xwl_screen, int32_t scale) + { + struct xwl_output *it; ++ struct xwl_window *xwl_window; ++ + xwl_screen->global_output_scale = scale; - wl_surface_attach(xwl_window->surface, buffer, 0, 0); -+ wl_surface_set_buffer_scale(xwl_window->surface, xwl_screen->global_output_scale); + /* change randr resolutions and positions */ + xorg_list_for_each_entry(it, &xwl_screen->output_list, link) { + xwl_output_apply_changes(it); + } ++ ++ if (!xwl_screen->rootless && xwl_screen->screen->root) { ++ /* Clear all the buffers, so that they'll be remade with the new sizes ++ * (this doesn't occur automatically because as far as Xorg is ++ * concerned, the window's size is the same) */ ++ xorg_list_for_each_entry(xwl_window, &xwl_screen->window_list, link_window) { ++ xwl_window_buffers_recycle(xwl_window); ++ } ++ } + } - /* Arbitrary limit to try to avoid flooding the Wayland - * connection. If we flood it too much anyway, this could + Bool +-- +GitLab + diff --git a/0001_Do_not_ignore_leave_events.patch b/0001_Do_not_ignore_leave_events.patch deleted file mode 100644 index 2133ee171aca..000000000000 --- a/0001_Do_not_ignore_leave_events.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 914e2276df86b7e93ca37e4e87346d38cb80db05 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan <ofourdan@redhat.com> -Date: Mon, 24 Oct 2022 09:24:01 +0200 -Subject: [PATCH] xwayland/input: Do not ignore leave events - -Commit 8a5f3ddb2 ("set tag on our surface") introduced the use of tags -to differentiate our own surfaces, and commit a1d14aa8c ("Clear the -"xwl-window" tag on unrealize") removed the tags before the surfaces are -actually destroyed. - -Xwayland would then rely on these tags on the surface to decide whether -to ignore or to process the Wayland event in various places. - -However, in doing so, it also checked for the tag on keyboard leave -events. - -As a result, if the keyboard leave events is received after the X11 -window is unrealized, keyboard_handle_leave() would not queue the -LeaveNotify events for the DIX to proceed, and the key repeat would -kick in and repeat the key event indefinitely. - -To avoid the issue, process events regardless of the tag as before -in keyboard_handle_leave(). - -Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> -Fixes: 8a5f3ddb2 - "xwayland: set tag on our surface" -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1395 -Tested-by: Renan Guilherme Lebre Ramos <japareaggae@gmail.com> -Tested-by: Stefan Dirsch <sndirsch@suse.de> ---- - hw/xwayland/xwayland-input.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index 240eb0139..9eda1ef71 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -1147,9 +1147,6 @@ keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, - struct xwl_seat *xwl_seat = data; - uint32_t *k; - -- if (surface != NULL && !is_surface_from_xwl_window(surface)) -- return; -- - xwl_seat->xwl_screen->serial = serial; - - wl_array_for_each(k, &xwl_seat->keys) --- -GitLab - diff --git a/0001_Remove_scale_atom_access_control.patch b/0001_Remove_scale_atom_access_control.patch new file mode 100644 index 000000000000..446f6d7c4c45 --- /dev/null +++ b/0001_Remove_scale_atom_access_control.patch @@ -0,0 +1,37 @@ +diff --color --unified --recursive --text a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c +--- a/hw/xwayland/xwayland-screen.c 2022-10-31 16:33:34.953299366 +0800 ++++ b/hw/xwayland/xwayland-screen.c 2022-10-31 16:34:06.123298615 +0800 +@@ -177,24 +177,6 @@ + } + + static void +-xwl_screen_validate_property_access(CallbackListPtr *pcbl, +- void *userdata, +- void *calldata) +-{ +- XacePropertyAccessRec *rec = calldata; +- struct xwl_screen *xwl_screen = userdata; +- ATOM name = (*rec->ppProp)->propertyName; +- +- if (name == xwl_screen->global_output_scale_prop && +- rec->client->index != xwl_screen->wm_client_id) { +- LogMessageVerb(X_WARNING, 0, +- "Client %x tried to illegaly set %s on the root window.\n", +- rec->client->index, NameForAtom(name)); +- rec->status = BadAccess; +- } +-} +- +-static void + xwl_property_callback(CallbackListPtr *pcbl, void *closure, + void *calldata) + { +@@ -1084,8 +1066,6 @@ + AddCallback(&PropertyStateCallback, xwl_property_callback, pScreen); + AddCallback(&RootWindowFinalizeCallback, xwl_root_window_finalized_callback, pScreen); + +- XaceRegisterCallback(XACE_PROPERTY_ACCESS, xwl_screen_validate_property_access, xwl_screen); +- + xwl_screen_setup_custom_vector(xwl_screen); + + xwl_screen_roundtrip(xwl_screen); diff --git a/0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch b/0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch deleted file mode 100644 index d5433960c9bd..000000000000 --- a/0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch +++ /dev/null @@ -1,237 +0,0 @@ -From eca138fff0f2344fdf02f6749f6b4c900fb52357 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan <ofourdan@redhat.com> -Date: Fri, 28 Oct 2022 11:08:16 +0200 -Subject: [PATCH] Revert "xwayland: Aggregate scroll axis events to fix kinetic - scrolling" - -This reverts commit 2db46363542bfd0f62f20f5a898fef07424ffccc. - -Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1392 ---- - hw/xwayland/xwayland-input.c | 116 +++++++++++++++-------------------- - hw/xwayland/xwayland-input.h | 10 +-- - 2 files changed, 51 insertions(+), 75 deletions(-) - -diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c -index aa08586bc..ec40d110c 100644 ---- a/hw/xwayland/xwayland-input.c -+++ b/hw/xwayland/xwayland-input.c -@@ -50,6 +50,12 @@ - #include "pointer-gestures-unstable-v1-client-protocol.h" - #include "xwayland-keyboard-grab-unstable-v1-client-protocol.h" - -+struct axis_discrete_pending { -+ struct xorg_list l; -+ uint32_t axis; -+ int32_t discrete; -+}; -+ - struct sync_pending { - struct xorg_list l; - DeviceIntPtr pending_dev; -@@ -607,36 +613,6 @@ dispatch_relative_motion(struct xwl_seat *xwl_seat) - POINTER_RAWONLY, &mask); - } - --static void --dispatch_scroll_motion(struct xwl_seat *xwl_seat) --{ -- ValuatorMask mask; -- const int divisor = 10; -- wl_fixed_t dy = xwl_seat->pending_pointer_event.scroll_dy; -- wl_fixed_t dx = xwl_seat->pending_pointer_event.scroll_dx; -- int32_t discrete_dy = xwl_seat->pending_pointer_event.scroll_discrete_dy; -- int32_t discrete_dx = xwl_seat->pending_pointer_event.scroll_discrete_dx; -- -- valuator_mask_zero(&mask); -- if (xwl_seat->pending_pointer_event.has_vertical_scroll) -- valuator_mask_set_double(&mask, -- 3, -- wl_fixed_to_double(dy) / divisor); -- else if (xwl_seat->pending_pointer_event.has_vertical_scroll_discrete) -- valuator_mask_set(&mask, 3, discrete_dy); -- -- if (xwl_seat->pending_pointer_event.has_horizontal_scroll) -- valuator_mask_set_double(&mask, -- 2, -- wl_fixed_to_double(dx) / divisor); -- else if (xwl_seat->pending_pointer_event.has_horizontal_scroll_discrete) -- valuator_mask_set(&mask, 2, discrete_dx); -- -- QueuePointerEvents(get_pointer_device(xwl_seat), -- MotionNotify, 0, POINTER_RELATIVE, &mask); --} -- -- - static void - dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) - { -@@ -653,18 +629,8 @@ dispatch_pointer_motion_event(struct xwl_seat *xwl_seat) - dispatch_absolute_motion(xwl_seat); - } - -- if (xwl_seat->pending_pointer_event.has_vertical_scroll || -- xwl_seat->pending_pointer_event.has_horizontal_scroll || -- xwl_seat->pending_pointer_event.has_vertical_scroll_discrete || -- xwl_seat->pending_pointer_event.has_horizontal_scroll_discrete) -- dispatch_scroll_motion(xwl_seat); -- - xwl_seat->pending_pointer_event.has_absolute = FALSE; - xwl_seat->pending_pointer_event.has_relative = FALSE; -- xwl_seat->pending_pointer_event.has_vertical_scroll = FALSE; -- xwl_seat->pending_pointer_event.has_horizontal_scroll = FALSE; -- xwl_seat->pending_pointer_event.has_vertical_scroll_discrete = FALSE; -- xwl_seat->pending_pointer_event.has_horizontal_scroll_discrete = FALSE; - } - - static void -@@ -721,17 +687,42 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, - uint32_t time, uint32_t axis, wl_fixed_t value) - { - struct xwl_seat *xwl_seat = data; -+ int index; -+ const int divisor = 10; -+ ValuatorMask mask; -+ struct axis_discrete_pending *pending = NULL; -+ struct axis_discrete_pending *iter; - - switch (axis) { - case WL_POINTER_AXIS_VERTICAL_SCROLL: -- xwl_seat->pending_pointer_event.has_vertical_scroll = TRUE; -- xwl_seat->pending_pointer_event.scroll_dy = value; -+ index = 3; - break; - case WL_POINTER_AXIS_HORIZONTAL_SCROLL: -- xwl_seat->pending_pointer_event.has_horizontal_scroll = TRUE; -- xwl_seat->pending_pointer_event.scroll_dx = value; -+ index = 2; - break; -+ default: -+ return; -+ } -+ -+ xorg_list_for_each_entry(iter, &xwl_seat->axis_discrete_pending, l) { -+ if (iter->axis == axis) { -+ pending = iter; -+ break; -+ } - } -+ -+ valuator_mask_zero(&mask); -+ -+ if (pending) { -+ valuator_mask_set(&mask, index, pending->discrete); -+ xorg_list_del(&pending->l); -+ free(pending); -+ } else { -+ valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); -+ } -+ -+ QueuePointerEvents(get_pointer_device(xwl_seat), -+ MotionNotify, 0, POINTER_RELATIVE, &mask); - } - - static void -@@ -754,18 +745,6 @@ static void - pointer_handle_axis_stop(void *data, struct wl_pointer *wl_pointer, - uint32_t time, uint32_t axis) - { -- struct xwl_seat *xwl_seat = data; -- -- switch (axis) { -- case WL_POINTER_AXIS_VERTICAL_SCROLL: -- xwl_seat->pending_pointer_event.has_vertical_scroll = TRUE; -- xwl_seat->pending_pointer_event.scroll_dy = 0; -- break; -- case WL_POINTER_AXIS_HORIZONTAL_SCROLL: -- xwl_seat->pending_pointer_event.has_horizontal_scroll = TRUE; -- xwl_seat->pending_pointer_event.scroll_dx = 0; -- break; -- } - } - - static void -@@ -774,16 +753,14 @@ pointer_handle_axis_discrete(void *data, struct wl_pointer *wl_pointer, - { - struct xwl_seat *xwl_seat = data; - -- switch (axis) { -- case WL_POINTER_AXIS_VERTICAL_SCROLL: -- xwl_seat->pending_pointer_event.has_vertical_scroll_discrete = TRUE; -- xwl_seat->pending_pointer_event.scroll_discrete_dy = discrete; -- break; -- case WL_POINTER_AXIS_HORIZONTAL_SCROLL: -- xwl_seat->pending_pointer_event.has_horizontal_scroll_discrete = TRUE; -- xwl_seat->pending_pointer_event.scroll_discrete_dx = discrete; -- break; -- } -+ struct axis_discrete_pending *pending = malloc(sizeof *pending); -+ if (!pending) -+ return; -+ -+ pending->axis = axis; -+ pending->discrete = discrete; -+ -+ xorg_list_add(&pending->l, &xwl_seat->axis_discrete_pending); - } - - static const struct wl_pointer_listener pointer_listener = { -@@ -1759,6 +1736,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id, uint32_t version - wl_array_init(&xwl_seat->keys); - - xorg_list_init(&xwl_seat->touches); -+ xorg_list_init(&xwl_seat->axis_discrete_pending); - xorg_list_init(&xwl_seat->sync_pending); - } - -@@ -1767,6 +1745,7 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - { - struct xwl_touch *xwl_touch, *next_xwl_touch; - struct sync_pending *p, *npd; -+ struct axis_discrete_pending *ad, *ad_next; - - xorg_list_for_each_entry_safe(xwl_touch, next_xwl_touch, - &xwl_seat->touches, link_touch) { -@@ -1779,6 +1758,11 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) - free (p); - } - -+ xorg_list_for_each_entry_safe(ad, ad_next, &xwl_seat->axis_discrete_pending, l) { -+ xorg_list_del(&ad->l); -+ free(ad); -+ } -+ - release_tablet_manager_seat(xwl_seat); - - release_grab(xwl_seat); -diff --git a/hw/xwayland/xwayland-input.h b/hw/xwayland/xwayland-input.h -index 4fd175b13..dbe215bdb 100644 ---- a/hw/xwayland/xwayland-input.h -+++ b/hw/xwayland/xwayland-input.h -@@ -93,6 +93,7 @@ struct xwl_seat { - char *keymap; - struct wl_surface *keyboard_focus; - -+ struct xorg_list axis_discrete_pending; - struct xorg_list sync_pending; - - struct xwl_pointer_warp_emulator *pointer_warp_emulator; -@@ -110,15 +111,6 @@ struct xwl_seat { - double dy; - double dx_unaccel; - double dy_unaccel; -- -- wl_fixed_t scroll_dy; -- wl_fixed_t scroll_dx; -- int32_t scroll_discrete_dy; -- int32_t scroll_discrete_dx; -- Bool has_vertical_scroll; -- Bool has_horizontal_scroll; -- Bool has_vertical_scroll_discrete; -- Bool has_horizontal_scroll_discrete; - } pending_pointer_event; - - struct xorg_list tablets; --- -GitLab - @@ -1,47 +1,53 @@ -# Maintainer: q234 rty <q23456yuiop at gmail dot com> +# Maintainer: Avery Warddhana <them+arch _ nullablevo id au> +# Contributor: Antonin Décimo <antonin dot decimo at gmail dot com> +# Contributor: q234 rty <q23456yuiop at gmail dot com> # Contributor: lilydjwg <lilydjwg@gmail.com> # Contributor: AndyRTR <andyrtr@archlinux.org> -pkgname=xorg-xwayland-hidpi-xprop -pkgver=22.1.4 -pkgrel=2 +pkgname=xorg-xwayland-hidpi-xprop-git +pkgver=22.1.4.r138.g459e28557 +pkgrel=1 arch=('x86_64') license=('custom') url="https://xorg.freedesktop.org" pkgdesc="run X clients under wayland, with !733 HiDPI patch" depends=('nettle' 'libepoxy' 'systemd-libs' 'libxfont2' 'pixman' 'xorg-server-common' 'libxcvt') -makedepends=('meson' 'xorgproto' 'xtrans' 'libxkbfile' 'dbus' +makedepends=('meson' 'xorgproto-git' 'xtrans' 'libxkbfile' 'dbus' 'xorg-font-util' 'wayland' 'wayland-protocols' 'libdrm' 'mesa-libgl' 'systemd' 'egl-wayland' ) -source=(https://xorg.freedesktop.org/archive/individual/xserver/xwayland-$pkgver.tar.xz{,.sig} hidpi.patch - 0001_Do_not_ignore_leave_events.patch::https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/987.patch - 0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch::https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/988.patch) -sha512sums=('a1301df1687ac276172565c98b1fb3d5f35f67d47f625b81fce485d1818cf4896f88c2750b4e93596fa6f7fd515e258d201ca3d0cc39943b576f2d2c3f9be8cd' - 'SKIP' - '7132c44d9bbf1c5f93906ef301a6e946f0909da0b9273f397281e681ad0da77d62b960a9dd0a640c7209548192fefba9bde03c493f3a89d08cd73a12844bb518' - 'd0c87face4485050db134e5ed14d930bdae05d81149b2b573b97fc6dd96d9234e709d6f0523221747293da20cbd012e1e1da00e12b227f98597ffa320bcd3e3c' - 'fea7abdd962fd0a8e653069f7926508d2dd90a0a6632d4aae2265a221267f1777fba4aeaaf494dc6f3e4a11a15a7eabd524ca16f948e0d3fee05c6a4b8a69fd4') +source=(git+https://gitlab.freedesktop.org/xorg/xserver.git + 0000_Multi_DPI_support_via_global_factor_rescaling.patch::https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/733.patch + 0001_Remove_scale_atom_access_control.patch) +sha512sums=('SKIP' + 'ab927b1e038346f967723a3d45a405a0a8339759e15901d0913a55d1348683831e0d058c76c6f7cb2e264a5cef781a507fb290d139ac0f2806a62bd20d84147d' + 'f16cb5455a1caf26c586cca2d1ec6f4708804721b7d6a8d8bd1e4a7b47b97e8b822d3455fce0da3c74bb14baf6a3980574d85019cf242d6a033a578587f74b14') provides=('xorg-server-xwayland' 'xorg-xwayland') conflicts=('xorg-server-xwayland' 'xorg-xwayland') replaces=('xorg-server-xwayland') -#validpgpkeys=('B09FAF35BE914521980951145A81AF8E6ADBB200') # "Michel Daenzer <michel@daenzer.net>" -validpgpkeys=('67DC86F2623FC5FD4BB5225D14706DBE1E4B4540') # "Olivier Fourdan <fourdan@xfce.org>" options=('debug' 'strip') +pkgver() { + cd xserver + local branch=origin/xwayland-22.1 + local head=$(git rev-parse --short HEAD) + local tag=$(git describe --abbrev=0 "$branch") + local revisions=$(git rev-list "${tag}..HEAD" --count) + printf "%s.r%d.g%s" "$(echo "$tag" | sed 's/^xwayland.//')" "$revisions" "$head" +} + prepare() { - cd ${srcdir}/xwayland-$pkgver - patch -Np1 -i ../0001_Do_not_ignore_leave_events.patch - patch -Np1 -i ../0002_Revert_Aggregate_scroll_axis_events_to_fix_kinetic_scrolling.patch - patch -Np1 -i ../hidpi.patch + cd xserver + patch -Np1 -i "${srcdir}/0000_Multi_DPI_support_via_global_factor_rescaling.patch" + patch -Np1 -i "${srcdir}/0001_Remove_scale_atom_access_control.patch" } build() { - arch-meson xwayland-$pkgver build \ + arch-meson xserver build \ -D ipv6=true \ -D xvfb=false \ -D xdmcp=false \ @@ -58,12 +64,13 @@ build() { } package() { - # bin + manpage + .pc file install -m755 -Dt "${pkgdir}"/usr/bin build/hw/xwayland/Xwayland install -m644 -Dt "${pkgdir}"/usr/share/man/man1 build/hw/xwayland/Xwayland.1 install -m644 -Dt "${pkgdir}"/usr/lib/pkgconfig build/hw/xwayland/xwayland.pc # license - install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" xwayland-$pkgver/COPYING + install -m644 -Dt "${pkgdir}/usr/share/licenses/${pkgname}" xserver/COPYING } + +# vim:set et sw=2 sts=2: |