summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorq234rty2023-03-04 13:58:23 +0800
committerq234rty2023-03-04 14:01:44 +0800
commitade33ee346c148d95d7ff266fc6afdef89f3a1bc (patch)
tree838de18b934560e1e03879702e60ce59b0ab0608
parent3e6b71ab55ead07db726c220a7b8c62aa59fe31b (diff)
downloadaur-ade33ee346c148d95d7ff266fc6afdef89f3a1bc.tar.gz
Fix build after updating wlroots
-rw-r--r--.SRCINFO8
-rw-r--r--0001-xwayland-support-HiDPI-scale.patch148
-rw-r--r--0002-Fix-configure_notify-event.patch31
-rw-r--r--PKGBUILD12
4 files changed, 191 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f494a99e22ab..1cc8132a0ebd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = hyprland-hidpi-xprop-git
pkgdesc = A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks.
- pkgver = r2495.3bceabe2
+ pkgver = r2551.c4440993
pkgrel = 1
url = https://github.com/hyprwm/Hyprland
arch = any
@@ -50,11 +50,13 @@ pkgbase = hyprland-hidpi-xprop-git
source = git+https://gitlab.freedesktop.org/wlroots/wlroots.git
source = git+https://github.com/hyprwm/hyprland-protocols.git
source = git+https://github.com/canihavesomecoffee/udis86.git
- source = https://gitlab.freedesktop.org/lilydjwg/wlroots/-/commit/6c5ffcd1fee9e44780a6a8792f74ecfbe24a1ca7.patch
+ source = 0001-xwayland-support-HiDPI-scale.patch
+ source = 0002-Fix-configure_notify-event.patch
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
- sha256sums = a37e441c309b35e5d9b5c5c637c96729c5348a523a7eaa25c6e24b1fcc3521a6
+ sha256sums = 304aaf12cbd7dc198bf7e418d729b297ea61186d27c035e4a63a337399fcec76
+ sha256sums = e7cf16e39db2bde4dbc9d7ec3b4753f7643b1bf198a3179e6802a9c603437fe9
pkgname = hyprland-hidpi-xprop-git
diff --git a/0001-xwayland-support-HiDPI-scale.patch b/0001-xwayland-support-HiDPI-scale.patch
new file mode 100644
index 000000000000..a9e86fb3ac31
--- /dev/null
+++ b/0001-xwayland-support-HiDPI-scale.patch
@@ -0,0 +1,148 @@
+From 48f97d24d4b7f9d5fd0d4accdbaa009b365bd61b Mon Sep 17 00:00:00 2001
+From: lilydjwg <lilydjwg@gmail.com>
+Date: Wed, 17 Nov 2021 19:34:58 +0800
+Subject: [PATCH] xwayland: support HiDPI scale
+
+This supports the xorg-xwayland patch at https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/733
+---
+ include/xwayland/xwm.h | 2 ++
+ xwayland/xwm.c | 51 +++++++++++++++++++++++++++++++-----------
+ 2 files changed, 40 insertions(+), 13 deletions(-)
+
+diff --git a/include/xwayland/xwm.h b/include/xwayland/xwm.h
+index c69504e8..1a332b6c 100644
+--- a/include/xwayland/xwm.h
++++ b/include/xwayland/xwm.h
+@@ -88,6 +88,7 @@ enum atom_name {
+ DND_ACTION_PRIVATE,
+ NET_CLIENT_LIST,
+ NET_CLIENT_LIST_STACKING,
++ XWAYLAND_GLOBAL_OUTPUT_SCALE,
+ ATOM_LAST // keep last
+ };
+
+@@ -98,6 +99,7 @@ struct wlr_xwm {
+ struct wl_event_source *event_source;
+ struct wlr_seat *seat;
+ uint32_t ping_timeout;
++ uint32_t scale;
+
+ xcb_atom_t atoms[ATOM_LAST];
+ xcb_connection_t *xcb_conn;
+diff --git a/xwayland/xwm.c b/xwayland/xwm.c
+index 5a36dc21..8449977e 100644
+--- a/xwayland/xwm.c
++++ b/xwayland/xwm.c
+@@ -19,6 +19,14 @@
+ #include <xcb/xfixes.h>
+ #include "xwayland/xwm.h"
+
++static int32_t scale(struct wlr_xwm *xwm, uint32_t val) {
++ return val * xwm->scale;
++}
++
++static int32_t unscale(struct wlr_xwm *xwm, uint32_t val) {
++ return (val + xwm->scale/2) / xwm->scale;
++}
++
+ const char *const atom_map[ATOM_LAST] = {
+ [WL_SURFACE_ID] = "WL_SURFACE_ID",
+ [WL_SURFACE_SERIAL] = "WL_SURFACE_SERIAL",
+@@ -90,6 +98,7 @@ const char *const atom_map[ATOM_LAST] = {
+ [DND_ACTION_PRIVATE] = "XdndActionPrivate",
+ [NET_CLIENT_LIST] = "_NET_CLIENT_LIST",
+ [NET_CLIENT_LIST_STACKING] = "_NET_CLIENT_LIST_STACKING",
++ [XWAYLAND_GLOBAL_OUTPUT_SCALE] = "_XWAYLAND_GLOBAL_OUTPUT_SCALE",
+ };
+
+ #define STARTUP_INFO_REMOVE_PREFIX "remove: ID="
+@@ -968,8 +977,8 @@ static void xwm_handle_create_notify(struct wlr_xwm *xwm,
+ return;
+ }
+
+- xwayland_surface_create(xwm, ev->window, ev->x, ev->y,
+- ev->width, ev->height, ev->override_redirect);
++ xwayland_surface_create(xwm, ev->window, unscale(xwm, ev->x), unscale(xwm, ev->y),
++ unscale(xwm, ev->width), unscale(xwm, ev->height), ev->override_redirect);
+ }
+
+ static void xwm_handle_destroy_notify(struct wlr_xwm *xwm,
+@@ -1000,10 +1009,10 @@ static void xwm_handle_configure_request(struct wlr_xwm *xwm,
+
+ struct wlr_xwayland_surface_configure_event wlr_event = {
+ .surface = surface,
+- .x = mask & XCB_CONFIG_WINDOW_X ? ev->x : surface->x,
+- .y = mask & XCB_CONFIG_WINDOW_Y ? ev->y : surface->y,
+- .width = mask & XCB_CONFIG_WINDOW_WIDTH ? ev->width : surface->width,
+- .height = mask & XCB_CONFIG_WINDOW_HEIGHT ? ev->height : surface->height,
++ .x = mask & XCB_CONFIG_WINDOW_X ? unscale(xwm, ev->x) : surface->x,
++ .y = mask & XCB_CONFIG_WINDOW_Y ? unscale(xwm, ev->y) : surface->y,
++ .width = mask & XCB_CONFIG_WINDOW_WIDTH ? unscale(xwm, ev->width) : surface->width,
++ .height = mask & XCB_CONFIG_WINDOW_HEIGHT ? unscale(xwm, ev->height) : surface->height,
+ .mask = mask,
+ };
+
+@@ -1018,14 +1027,14 @@ static void xwm_handle_configure_notify(struct wlr_xwm *xwm,
+ }
+
+ bool geometry_changed =
+- (xsurface->x != ev->x || xsurface->y != ev->y ||
+- xsurface->width != ev->width || xsurface->height != ev->height);
++ (xsurface->x != unscale(xwm, ev->x) || xsurface->y != unscale(xwm, ev->y) ||
++ xsurface->width != unscale(xwm, ev->width) || xsurface->height != unscale(xwm, ev->height));
+
+ if (geometry_changed) {
+- xsurface->x = ev->x;
+- xsurface->y = ev->y;
+- xsurface->width = ev->width;
+- xsurface->height = ev->height;
++ xsurface->x = unscale(xwm, ev->x);
++ xsurface->y = unscale(xwm, ev->y);
++ xsurface->width = unscale(xwm, ev->width);
++ xsurface->height = unscale(xwm, ev->height);
+ }
+
+ if (xsurface->override_redirect != ev->override_redirect) {
+@@ -1135,7 +1144,22 @@ static void xwm_handle_unmap_notify(struct wlr_xwm *xwm,
+ static void xwm_handle_property_notify(struct wlr_xwm *xwm,
+ xcb_property_notify_event_t *ev) {
+ struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window);
++
+ if (xsurface == NULL) {
++ if (ev->atom == xwm->atoms[XWAYLAND_GLOBAL_OUTPUT_SCALE]) {
++ xcb_get_property_cookie_t cookie = xcb_get_property(xwm->xcb_conn, 0,
++ ev->window, ev->atom, XCB_ATOM_ANY, 0, 2048);
++ xcb_get_property_reply_t *reply = xcb_get_property_reply(xwm->xcb_conn,
++ cookie, NULL);
++ if (reply == NULL) {
++ return;
++ }
++ if (reply->type == XCB_ATOM_CARDINAL) {
++ xwm->scale = *(uint32_t*)xcb_get_property_value(reply);
++ }
++ free(reply);
++ }
++
+ return;
+ }
+
+@@ -1772,7 +1796,7 @@ void wlr_xwayland_surface_configure(struct wlr_xwayland_surface *xsurface,
+ uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
+ XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT |
+ XCB_CONFIG_WINDOW_BORDER_WIDTH;
+- uint32_t values[] = {x, y, width, height, 0};
++ uint32_t values[] = {scale(xwm, x), scale(xwm, y), scale(xwm, width), scale(xwm, height), 0};
+ xcb_configure_window(xwm->xcb_conn, xsurface->window_id, mask, values);
+
+ // If the window size did not change, then we cannot rely on
+@@ -2125,6 +2149,7 @@ struct wlr_xwm *xwm_create(struct wlr_xwayland *xwayland, int wm_fd) {
+ wl_list_init(&xwm->pending_startup_ids);
+ xwm->ping_timeout = 10000;
+
++ xwm->scale = 1;
+ xwm->xcb_conn = xcb_connect_to_fd(wm_fd, NULL);
+
+ int rc = xcb_connection_has_error(xwm->xcb_conn);
+--
+2.39.2
+
diff --git a/0002-Fix-configure_notify-event.patch b/0002-Fix-configure_notify-event.patch
new file mode 100644
index 000000000000..c80f4795d8ea
--- /dev/null
+++ b/0002-Fix-configure_notify-event.patch
@@ -0,0 +1,31 @@
+From 950808724d20d8daa1e26d7a0ae322eda14cd1cc Mon Sep 17 00:00:00 2001
+From: q234rty <q23456yuiop@gmail.com>
+Date: Tue, 21 Feb 2023 23:56:26 +0800
+Subject: [PATCH 2/2] Fix configure_notify event
+
+---
+ xwayland/xwm.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/xwayland/xwm.c b/xwayland/xwm.c
+index 8449977e..2cce8a26 100644
+--- a/xwayland/xwm.c
++++ b/xwayland/xwm.c
+@@ -1809,10 +1809,10 @@ void wlr_xwayland_surface_configure(struct wlr_xwayland_surface *xsurface,
+ .response_type = XCB_CONFIGURE_NOTIFY,
+ .event = xsurface->window_id,
+ .window = xsurface->window_id,
+- .x = x,
+- .y = y,
+- .width = width,
+- .height = height,
++ .x = values[0],
++ .y = values[1],
++ .width = values[2],
++ .height = values[3],
+ };
+
+ xcb_send_event(xwm->xcb_conn, 0, xsurface->window_id,
+--
+2.39.2
+
diff --git a/PKGBUILD b/PKGBUILD
index dda325294676..545910791500 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_pkgname="hyprland"
pkgname="${_pkgname}-hidpi-xprop-git"
-pkgver=r2495.3bceabe2
+pkgver=r2551.c4440993
pkgrel=1
pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks."
arch=(any)
@@ -51,14 +51,16 @@ source=("${_pkgname}::git+https://github.com/hyprwm/Hyprland.git"
"git+https://gitlab.freedesktop.org/wlroots/wlroots.git"
"git+https://github.com/hyprwm/hyprland-protocols.git"
"git+https://github.com/canihavesomecoffee/udis86.git"
- "https://gitlab.freedesktop.org/lilydjwg/wlroots/-/commit/6c5ffcd1fee9e44780a6a8792f74ecfbe24a1ca7.patch")
+ "0001-xwayland-support-HiDPI-scale.patch"
+ "0002-Fix-configure_notify-event.patch")
conflicts=("${_pkgname}")
provides=(hyprland)
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
- 'a37e441c309b35e5d9b5c5c637c96729c5348a523a7eaa25c6e24b1fcc3521a6')
+ '304aaf12cbd7dc198bf7e418d729b297ea61186d27c035e4a63a337399fcec76'
+ 'e7cf16e39db2bde4dbc9d7ec3b4753f7643b1bf198a3179e6802a9c603437fe9')
options=(!makeflags !buildflags !strip)
pkgver() {
@@ -81,8 +83,8 @@ prepare() {
git -c protocol.file.allow=always submodule update subprojects/udis86
cd subprojects/wlroots
git revert -n 18595000f3a21502fd60bf213122859cc348f9af
- git cherry-pick -n 03412e9aaba3f2bedacbeeef53469f13d6b6b277
- patch -Np1 < "${srcdir}"/6c5ffcd1fee9e44780a6a8792f74ecfbe24a1ca7.patch
+ patch -Np1 -i "${srcdir}"/0001-xwayland-support-HiDPI-scale.patch
+ patch -Np1 -i "${srcdir}"/0002-Fix-configure_notify-event.patch
}
build() {