diff options
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | 0001-text_input-Implement-input-method-popups.patch | 88 | ||||
-rw-r--r-- | 0002-backport-sway-im-to-v1.8.patch | 196 | ||||
-rw-r--r-- | 0002-chore-fractal-scale-handle.patch | 90 | ||||
-rw-r--r-- | 0003-chore-left_pt-on-method-popup.patch | 27 | ||||
-rw-r--r-- | PKGBUILD | 43 | ||||
-rw-r--r-- | sys_nice_user_xkb_configs.patch | 27 |
7 files changed, 189 insertions, 312 deletions
@@ -1,7 +1,7 @@ pkgbase = sway-im pkgdesc = Tiling Wayland compositor and replacement for the i3 window manager, with input method popups v2 support - pkgver = 1.8.1 - pkgrel = 2 + pkgver = 1.9 + pkgrel = 1 epoch = 1 url = https://swaywm.org/ install = sway.install @@ -17,16 +17,16 @@ pkgbase = sway-im depends = libevdev.so depends = libinput depends = libjson-c.so + depends = libpixman-1.so depends = libudev.so depends = libwayland-server.so - depends = libwlroots.so=11 + depends = libwlroots.so=12 depends = libxcb depends = libxkbcommon.so depends = pango depends = pcre2 depends = ttf-font - optdepends = bemenu: Wayland-native alternative to dmenu - optdepends = dmenu: Application launcher used in default config + depends = xcb-util-wm optdepends = grim: Screenshot utility optdepends = foot: Terminal emulator used in the default configuration optdepends = i3status: Status line generation @@ -34,10 +34,12 @@ pkgbase = sway-im optdepends = polkit: System privilege control. Required if not using seatd service optdepends = slurp: Select a region optdepends = swaybg: Wallpaper tool for sway + optdepends = sway-contrib: Collection of user-contributed scripts for sway optdepends = swayidle: Idle management daemon optdepends = swaylock: Screen locker optdepends = wallutils: Timed wallpapers optdepends = waybar: Highly customizable bar + optdepends = wmenu: Application launcher used in default config optdepends = xorg-xwayland: X11 support optdepends = xdg-desktop-portal-gtk: Default xdg-desktop-portal for file picking optdepends = xdg-desktop-portal-wlr: xdg-desktop-portal backend @@ -45,21 +47,21 @@ pkgbase = sway-im conflicts = sway backup = etc/sway/config backup = etc/sway/config.d/50-systemd-user.conf - source = https://github.com/swaywm/sway/releases/download/1.8.1/sway-1.8.1.tar.gz - source = https://github.com/swaywm/sway/releases/download/1.8.1/sway-1.8.1.tar.gz.sig + source = https://github.com/swaywm/sway/releases/download/1.9/sway-1.9.tar.gz + source = https://github.com/swaywm/sway/releases/download/1.9/sway-1.9.tar.gz.sig source = 50-systemd-user.conf source = sway-portals.conf - source = sys_nice_user_xkb_configs.patch source = 0001-text_input-Implement-input-method-popups.patch - source = 0002-backport-sway-im-to-v1.8.patch + source = 0002-chore-fractal-scale-handle.patch + source = 0003-chore-left_pt-on-method-popup.patch validpgpkeys = 34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48 validpgpkeys = 9DDA3B9FA5D58DD5392C78E652CB6609B22DA89A - sha512sums = 1504312a199608532e22336c5031e8f4749f5102ab321d13d97a1f93d49c8ec435e9097af729d8f7dfa81e2e96cee7de91cf4c04b6a7b7151ea740a1e43eb086 + sha512sums = 1d2a47bb8b838573a32f3719a7329fd744119c2c7efc5e5a4168b2bacfb09a3901a569177e5e10c129141fafe00e823ab78c04b76b502d23caa7621bbccd5919 sha512sums = SKIP sha512sums = d5f9aadbb4bbef067c31d4c8c14dad220eb6f3e559e9157e20e1e3d47faf2f77b9a15e52519c3ffc53dc8a5202cb28757b81a4b3b0cc5dd50a4ddc49e03fe06e - sha512sums = 091a205bca875b6a78150b5b14ffaca996b7c7c3d6f68910e5891e5409ca070d27b3307e8c4916c1562a998d5bcb94406e961bf376d86e64c8ddf5afe5b41f76 - sha512sums = 156719e93d0213d1b54ce6e3a9b2dcc9246da5689dd2d3281546f9c042cbc69072f99b087e112fe777dcd786d2b9d1be1e1c9200feddffb5e2d16f8dfb27515d - sha512sums = f3a0bf6b48ecb09b229ba286f57c1a43e83848c187816b6784df1a3640c083759e8236bc949c8097044d3af218813757b636226a097e495d993fd682f20ceb96 - sha512sums = f5441d4da5c9c43a5f70e56eb00fcec7a56c3f76dbe03cbaab55b7bd1ea82ff8fbae1e1ae3e8dfaf1860db8e76635fc578649e537b609eb914e068cb9c4929d1 + sha512sums = b9e708c775825c8124d8e154e523c90b8a32715050ba06f6dbcdd08d109eed484d128ccc8dcd6a49dc9cd51a0c9035779c2706b4d7a139115e85c4f54226b775 + sha512sums = 07343bed09ca1689e647465d38013dc42e5a290bf8bcce57244eaccc7c3c858f04ec5d2786dc3af193a070faa89606598cccba66cd52d4078973afb757d5b72e + sha512sums = dd013a9c6859dc0210aa55a519c1df4c5899e164d7a6c7f86f831dcd37f9b26839f24e7bc2dc066ee7fad38ff91bcae9516a0c3bffebb09c35c8133f0af10bc8 + sha512sums = dba122283df29239ff94cac20c74f28937822573474bebf3865096bc073ef366412ccead4d1c46197c93eefc09d2c8af74de782f5be2a462d7911020c7a43d0e pkgname = sway-im diff --git a/0001-text_input-Implement-input-method-popups.patch b/0001-text_input-Implement-input-method-popups.patch index a679a3ce6d6b..1c5dbee40486 100644 --- a/0001-text_input-Implement-input-method-popups.patch +++ b/0001-text_input-Implement-input-method-popups.patch @@ -1,34 +1,27 @@ -From 53d4cf1b93de202da22b7f2132e2086eace63ff6 Mon Sep 17 00:00:00 2001 +From de74d1f6360810c0a5fd11d8022fbffe56fc97c5 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons <ShootingStarDragons@protonmail.com> Date: Wed, 3 May 2023 14:21:27 +0800 -Subject: [PATCH 1/2] text_input: Implement input-method popups +Subject: [PATCH 1/3] text_input: Implement input-method popups +origin one is the pr by tadeokondrak in pr 5890 + +Co-authored-by: tadeokondrak <me@tadeo.ca> --- - .gitignore | 1 + include/sway/input/text_input.h | 24 +++ include/sway/output.h | 4 + sway/desktop/output.c | 29 +++ - sway/desktop/render.c | 16 +- + sway/desktop/render.c | 15 +- sway/input/cursor.c | 26 +++ sway/input/text_input.c | 350 +++++++++++++++++++++++++++++++- sway/tree/container.c | 3 + sway/tree/view.c | 3 + - 9 files changed, 448 insertions(+), 8 deletions(-) + 8 files changed, 446 insertions(+), 8 deletions(-) -diff --git a/.gitignore b/.gitignore -index 1ec0cb52..876a15a6 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -11,3 +11,4 @@ config-debug - wayland-*-protocol.* - /subprojects/wlroots - subprojects -+.cache diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h -index c70fd935..f1c08f6b 100644 +index 214e61d1..a01ddf55 100644 --- a/include/sway/input/text_input.h +++ b/include/sway/input/text_input.h -@@ -22,18 +22,37 @@ struct sway_input_method_relay { +@@ -21,18 +21,37 @@ struct sway_input_method_relay { struct sway_seat *seat; struct wl_list text_inputs; // sway_text_input::link @@ -66,7 +59,7 @@ index c70fd935..f1c08f6b 100644 struct sway_text_input { struct sway_input_method_relay *relay; -@@ -66,4 +85,9 @@ struct sway_text_input *sway_text_input_create( +@@ -65,4 +84,9 @@ struct sway_text_input *sway_text_input_create( struct sway_input_method_relay *relay, struct wlr_text_input_v3 *text_input); @@ -77,10 +70,10 @@ index c70fd935..f1c08f6b 100644 + #endif diff --git a/include/sway/output.h b/include/sway/output.h -index 7ccaa09c..92347cfc 100644 +index 43cbccd2..2b1df3db 100644 --- a/include/sway/output.h +++ b/include/sway/output.h -@@ -145,6 +145,10 @@ void output_unmanaged_for_each_surface(struct sway_output *output, +@@ -155,6 +155,10 @@ void output_unmanaged_for_each_surface(struct sway_output *output, void *user_data); #endif @@ -92,18 +85,18 @@ index 7ccaa09c..92347cfc 100644 struct wl_list *drag_icons, sway_surface_iterator_func_t iterator, void *user_data); diff --git a/sway/desktop/output.c b/sway/desktop/output.c -index 94210113..7310e594 100644 +index bb61e1bd..2ccb8020 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c -@@ -21,6 +21,7 @@ - #include "sway/desktop/transaction.h" +@@ -23,6 +23,7 @@ #include "sway/input/input-manager.h" #include "sway/input/seat.h" + #include "sway/ipc-server.h" +#include "sway/input/text_input.h" #include "sway/layers.h" #include "sway/output.h" #include "sway/server.h" -@@ -245,6 +246,31 @@ void output_unmanaged_for_each_surface(struct sway_output *output, +@@ -258,6 +259,31 @@ void output_unmanaged_for_each_surface(struct sway_output *output, } #endif @@ -135,7 +128,7 @@ index 94210113..7310e594 100644 void output_drag_icons_for_each_surface(struct sway_output *output, struct wl_list *drag_icons, sway_surface_iterator_func_t iterator, void *user_data) { -@@ -355,6 +381,9 @@ overlay: +@@ -368,6 +394,9 @@ overlay: output_layer_for_each_surface(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], iterator, user_data); @@ -146,10 +139,10 @@ index 94210113..7310e594 100644 iterator, user_data); } diff --git a/sway/desktop/render.c b/sway/desktop/render.c -index efa3a0d9..4bfab7d8 100644 +index c4c0004e..d89ab5d3 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c -@@ -201,6 +201,15 @@ static void render_unmanaged(struct sway_output *output, +@@ -183,6 +183,15 @@ static void render_unmanaged(struct render_context *ctx, struct wl_list *unmanag } #endif @@ -162,39 +155,38 @@ index efa3a0d9..4bfab7d8 100644 + render_surface_iterator, &data); +} + - static void render_drag_icons(struct sway_output *output, - pixman_region32_t *damage, struct wl_list *drag_icons) { + static void render_drag_icons(struct render_context *ctx, struct wl_list *drag_icons) { struct render_data data = { -@@ -1091,6 +1100,10 @@ void output_render(struct sway_output *output, struct timespec *when, + .alpha = 1.0f, +@@ -1057,6 +1066,9 @@ void output_render(struct render_context *ctx) { goto renderer_end; } + struct sway_seat *seat = input_manager_current_seat(); + struct sway_container *focus = seat_get_focused_container(seat); -+ // here use seat + if (output_has_opaque_overlay_layer_surface(output)) { goto render_overlay; } -@@ -1160,8 +1173,6 @@ void output_render(struct sway_output *output, struct timespec *when, +@@ -1119,8 +1131,6 @@ void output_render(struct render_context *ctx) { - render_seatops(output, damage); + render_seatops(ctx); - struct sway_seat *seat = input_manager_current_seat(); - struct sway_container *focus = seat_get_focused_container(seat); if (focus && focus->view) { - render_view_popups(focus->view, output, damage, focus->alpha); + render_view_popups(ctx, focus->view, focus->alpha); } -@@ -1171,6 +1182,7 @@ render_overlay: +@@ -1130,6 +1140,7 @@ render_overlay: &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); - render_layer_popups(output, damage, + render_layer_popups(ctx, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); + render_input_popups(ctx, &seat->im_relay.input_popups); - render_drag_icons(output, damage, &root->drag_icons); + render_drag_icons(ctx, &root->drag_icons); renderer_end: diff --git a/sway/input/cursor.c b/sway/input/cursor.c -index a5f1204b..c7136991 100644 +index 36aab93e..4b6a9835 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -37,6 +37,28 @@ static uint32_t get_current_time_msec(void) { @@ -209,7 +201,7 @@ index a5f1204b..c7136991 100644 + if (!sway_input_popup_get_position(popup, &lx, &ly)) { + continue; + } -+ if (!popup->popup_surface->surface->mapped || !popup->visible) { ++ if (!popup->visible) { + continue; + } + double _sx = ox - lx; @@ -226,7 +218,7 @@ index a5f1204b..c7136991 100644 static struct wlr_surface *layer_surface_at(struct sway_output *output, struct wl_list *layer, double ox, double oy, double *sx, double *sy) { struct sway_layer_surface *sway_layer; -@@ -122,6 +144,10 @@ struct sway_node *node_at_coords( +@@ -120,6 +142,10 @@ struct sway_node *node_at_coords( return NULL; } @@ -659,25 +651,25 @@ index 58911c2d..05c867d6 100644 text_input_set_pending_focused_surface(text_input, surface); } diff --git a/sway/tree/container.c b/sway/tree/container.c -index b86a9925..3c67058b 100644 +index 8c344a6d..f45f11d2 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c -@@ -395,6 +395,9 @@ static bool surface_is_popup(struct wlr_surface *surface) { - wlr_subsurface_from_wlr_surface(surface); +@@ -392,6 +392,9 @@ static bool surface_is_popup(struct wlr_surface *surface) { + } surface = subsurface->parent; } + if (wlr_input_popup_surface_v2_try_from_wlr_surface(surface) != NULL) { + return true; + } struct wlr_xdg_surface *xdg_surface = - wlr_xdg_surface_from_wlr_surface(surface); - return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP; + wlr_xdg_surface_try_from_wlr_surface(surface); + return xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP && xdg_surface->popup != NULL; diff --git a/sway/tree/view.c b/sway/tree/view.c -index 2894fa79..23068428 100644 +index 65ca0c9c..76a39809 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c -@@ -1217,6 +1217,9 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) { - if (wlr_surface_is_layer_surface(wlr_surface)) { +@@ -1216,6 +1216,9 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) { + if (wlr_layer_surface_v1_try_from_wlr_surface(wlr_surface) != NULL) { return NULL; } + if (wlr_input_popup_surface_v2_try_from_wlr_surface(wlr_surface) != NULL) { @@ -687,5 +679,5 @@ index 2894fa79..23068428 100644 const char *role = wlr_surface->role ? wlr_surface->role->name : NULL; sway_log(SWAY_DEBUG, "Surface of unknown type (role %s): %p", -- -2.41.0 +2.43.2 diff --git a/0002-backport-sway-im-to-v1.8.patch b/0002-backport-sway-im-to-v1.8.patch deleted file mode 100644 index 7b85226921b4..000000000000 --- a/0002-backport-sway-im-to-v1.8.patch +++ /dev/null @@ -1,196 +0,0 @@ -From 4fc3ab5d5809b839b1c29ee5d2eba65636598a86 Mon Sep 17 00:00:00 2001 -From: GalaxySnail <me+aur@glxys.nl> -Date: Sat, 12 Aug 2023 01:52:47 +0800 -Subject: [PATCH 2/2] backport sway-im to v1.8 - ---- - sway/desktop/output.c | 2 +- - sway/desktop/render.c | 9 +++++---- - sway/input/cursor.c | 2 +- - sway/input/text_input.c | 39 ++++++++++++++++++++------------------- - sway/tree/container.c | 2 +- - sway/tree/view.c | 2 +- - 6 files changed, 29 insertions(+), 27 deletions(-) - -diff --git a/sway/desktop/output.c b/sway/desktop/output.c -index 7310e594..a41927d1 100644 ---- a/sway/desktop/output.c -+++ b/sway/desktop/output.c -@@ -255,7 +255,7 @@ void output_input_popups_for_each_surface(struct sway_output *output, - if (!sway_input_popup_get_position(popup, &lx, &ly)) { - continue; - } -- if (!popup->popup_surface->surface->mapped || !popup->visible) { -+ if (!popup->popup_surface->mapped || !popup->visible) { - continue; - } - -diff --git a/sway/desktop/render.c b/sway/desktop/render.c -index 4bfab7d8..f298fb8d 100644 ---- a/sway/desktop/render.c -+++ b/sway/desktop/render.c -@@ -201,12 +201,13 @@ static void render_unmanaged(struct sway_output *output, - } - #endif - --static void render_input_popups(struct render_context *ctx, struct wl_list *input_popups) { -+static void render_input_popups(struct sway_output *output, -+ pixman_region32_t *damage, struct wl_list *input_popups) { - struct render_data data = { -+ .damage = damage, - .alpha = 1.0f, -- .ctx = ctx, - }; -- output_input_popups_for_each_surface(ctx->output, input_popups, -+ output_input_popups_for_each_surface(output, input_popups, - render_surface_iterator, &data); - } - -@@ -1182,7 +1183,7 @@ render_overlay: - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); - render_layer_popups(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); -- render_input_popups(ctx, &seat->im_relay.input_popups); -+ render_input_popups(output, damage, &seat->im_relay.input_popups); - render_drag_icons(output, damage, &root->drag_icons); - - renderer_end: -diff --git a/sway/input/cursor.c b/sway/input/cursor.c -index c7136991..ed2188cd 100644 ---- a/sway/input/cursor.c -+++ b/sway/input/cursor.c -@@ -45,7 +45,7 @@ static struct wlr_surface *input_popup_surface_at(struct sway_output *output, - if (!sway_input_popup_get_position(popup, &lx, &ly)) { - continue; - } -- if (!popup->popup_surface->surface->mapped || !popup->visible) { -+ if (!popup->popup_surface->mapped || !popup->visible) { - continue; - } - double _sx = ox - lx; -diff --git a/sway/input/text_input.c b/sway/input/text_input.c -index 05c867d6..4767fdf4 100644 ---- a/sway/input/text_input.c -+++ b/sway/input/text_input.c -@@ -45,9 +45,9 @@ void sway_input_popup_damage(struct sway_input_popup *popup) { - } - - struct wlr_surface *focused_surface = text_input->input->focused_surface; -- struct wlr_layer_surface_v1 *layer_surface = -- wlr_layer_surface_v1_try_from_wlr_surface(focused_surface); -- if (layer_surface != NULL) { -+ if (wlr_surface_is_layer_surface(focused_surface)) { -+ struct wlr_layer_surface_v1 *layer_surface = -+ wlr_layer_surface_v1_from_wlr_surface(focused_surface); - struct sway_layer_surface *layer = - layer_from_wlr_layer_surface_v1(layer_surface); - output_damage_surface(layer->layer_surface->output->data, -@@ -77,7 +77,7 @@ static void input_popup_update(struct sway_input_popup *popup) { - return; - } - -- if (!popup->popup_surface->surface->mapped) { -+ if (!popup->popup_surface->mapped) { - return; - } - -@@ -89,9 +89,9 @@ static void input_popup_update(struct sway_input_popup *popup) { - struct wlr_output *output; - struct wlr_box output_box; - struct wlr_box parent; -- struct wlr_layer_surface_v1 *layer_surface = -- wlr_layer_surface_v1_try_from_wlr_surface(focused_surface); -- if (layer_surface != NULL) { -+ if (wlr_surface_is_layer_surface(focused_surface)) { -+ struct wlr_layer_surface_v1 *layer_surface = -+ wlr_layer_surface_v1_from_wlr_surface(focused_surface); - struct sway_layer_surface *layer = - layer_from_wlr_layer_surface_v1(layer_surface); - output = layer->layer_surface->output; -@@ -186,9 +186,9 @@ static void input_popup_send_outputs(struct sway_input_popup *popup, - return; - } - struct wlr_surface *focused_surface = text_input->input->focused_surface; -- struct wlr_layer_surface_v1 *layer_surface = -- wlr_layer_surface_v1_try_from_wlr_surface(focused_surface); -- if (layer_surface != NULL) { -+ if (wlr_surface_is_layer_surface(focused_surface)) { -+ struct wlr_layer_surface_v1 *layer_surface = -+ wlr_layer_surface_v1_from_wlr_surface(focused_surface); - struct sway_layer_surface *layer = - layer_from_wlr_layer_surface_v1(layer_surface); - wlr_surface_for_each_surface(popup->popup_surface->surface, -@@ -252,13 +252,14 @@ static void input_popup_set_focus(struct sway_input_popup *popup, - input_popup_update(popup); - return; - } -- struct wlr_layer_surface_v1 *layer_surface = -- wlr_layer_surface_v1_try_from_wlr_surface(surface); -- if (layer_surface != NULL) { -+ -+ if (wlr_surface_is_layer_surface(surface)) { -+ struct wlr_layer_surface_v1 *layer_surface = -+ wlr_layer_surface_v1_from_wlr_surface(surface); - struct sway_layer_surface *layer = - layer_from_wlr_layer_surface_v1(layer_surface); - wl_signal_add( -- &layer->layer_surface->surface->events.unmap, &popup->focused_surface_unmap); -+ &layer->layer_surface->events.unmap, &popup->focused_surface_unmap); - input_popup_update(popup); - return; - } -@@ -278,10 +279,10 @@ static void handle_im_new_popup_surface(struct wl_listener *listener, - popup->popup_surface = data; - popup->popup_surface->data = popup; - -- wl_signal_add(&popup->popup_surface->surface->events.map, &popup->popup_map); -+ wl_signal_add(&popup->popup_surface->events.map, &popup->popup_map); - popup->popup_map.notify = handle_im_popup_map; - wl_signal_add( -- &popup->popup_surface->surface->events.unmap, &popup->popup_unmap); -+ &popup->popup_surface->events.unmap, &popup->popup_unmap); - popup->popup_unmap.notify = handle_im_popup_unmap; - wl_signal_add( - &popup->popup_surface->events.destroy, &popup->popup_destroy); -@@ -313,9 +314,9 @@ bool sway_input_popup_get_position( - } - - struct wlr_surface *focused_surface = text_input->input->focused_surface; -- struct wlr_layer_surface_v1 *layer_surface = -- wlr_layer_surface_v1_try_from_wlr_surface(focused_surface); -- if (layer_surface != NULL) { -+ if (wlr_surface_is_layer_surface(focused_surface)) { -+ struct wlr_layer_surface_v1 *layer_surface = -+ wlr_layer_surface_v1_from_wlr_surface(focused_surface); - struct sway_layer_surface *layer = - layer_from_wlr_layer_surface_v1(layer_surface); - *lx = layer->geo.x + popup->x; -diff --git a/sway/tree/container.c b/sway/tree/container.c -index 3c67058b..b29d9db8 100644 ---- a/sway/tree/container.c -+++ b/sway/tree/container.c -@@ -395,7 +395,7 @@ static bool surface_is_popup(struct wlr_surface *surface) { - wlr_subsurface_from_wlr_surface(surface); - surface = subsurface->parent; - } -- if (wlr_input_popup_surface_v2_try_from_wlr_surface(surface) != NULL) { -+ if (wlr_surface_is_input_popup_surface_v2(surface)) { - return true; - } - struct wlr_xdg_surface *xdg_surface = -diff --git a/sway/tree/view.c b/sway/tree/view.c -index 23068428..fdc51189 100644 ---- a/sway/tree/view.c -+++ b/sway/tree/view.c -@@ -1217,7 +1217,7 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) { - if (wlr_surface_is_layer_surface(wlr_surface)) { - return NULL; - } -- if (wlr_input_popup_surface_v2_try_from_wlr_surface(wlr_surface) != NULL) { -+ if (wlr_surface_is_input_popup_surface_v2(wlr_surface)) { - return NULL; - } - --- -2.41.0 - diff --git a/0002-chore-fractal-scale-handle.patch b/0002-chore-fractal-scale-handle.patch new file mode 100644 index 000000000000..9b56d7b6b6fa --- /dev/null +++ b/0002-chore-fractal-scale-handle.patch @@ -0,0 +1,90 @@ +From 2aa72e8dfd3b3d051fdec6b2d05c5635adcfb57b Mon Sep 17 00:00:00 2001 +From: ShootingStarDragons <ShootingStarDragons@protonmail.com> +Date: Fri, 8 Dec 2023 16:07:58 +0800 +Subject: [PATCH 2/3] chore: fractal scale handle + +--- + include/sway/input/text_input.h | 1 + + sway/desktop/output.c | 23 +++++++++++++++++++++++ + sway/input/text_input.c | 4 ++++ + 3 files changed, 28 insertions(+) + +diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h +index a01ddf55..f583af7a 100644 +--- a/include/sway/input/text_input.h ++++ b/include/sway/input/text_input.h +@@ -4,6 +4,7 @@ + #include <wlr/types/wlr_text_input_v3.h> + #include <wlr/types/wlr_input_method_v2.h> + #include <wlr/types/wlr_compositor.h> ++#include <wlr/types/wlr_fractional_scale_v1.h> + + /** + * The relay structure manages the relationship between text-input and +diff --git a/sway/desktop/output.c b/sway/desktop/output.c +index 2ccb8020..871578b5 100644 +--- a/sway/desktop/output.c ++++ b/sway/desktop/output.c +@@ -15,6 +15,7 @@ + #include <wlr/types/wlr_output.h> + #include <wlr/types/wlr_presentation_time.h> + #include <wlr/types/wlr_compositor.h> ++#include <wlr/types/wlr_fractional_scale_v1.h> + #include <wlr/util/region.h> + #include "config.h" + #include "log.h" +@@ -971,6 +972,27 @@ static void update_output_scale_iterator(struct sway_output *output, + surface_update_outputs(surface); + } + ++static void update_im_scale(struct sway_output *output) { ++ struct sway_seat* im_seat = input_manager_current_seat(); ++ if (im_seat == NULL) { ++ return; ++ } ++ struct sway_input_method_relay* relay = &im_seat->im_relay; ++ struct sway_input_popup *popup; ++ wl_list_for_each(popup, &relay->input_popups, link) { ++ struct wl_list current_outputs = popup->popup_surface->surface->current_outputs; ++ struct wlr_surface_output *current_output; ++ wl_list_for_each(current_output, ¤t_outputs, link) { ++ if (current_output->output == output->wlr_output) { ++ double scale = current_output->output->scale; ++ wlr_fractional_scale_v1_notify_scale(popup->popup_surface->surface, scale); ++ wlr_surface_set_preferred_buffer_scale(popup->popup_surface->surface, ceil(scale)); ++ break; ++ } ++ } ++ } ++} ++ + static void handle_commit(struct wl_listener *listener, void *data) { + struct sway_output *output = wl_container_of(listener, output, commit); + struct wlr_output_event_commit *event = data; +@@ -982,6 +1004,7 @@ static void handle_commit(struct wl_listener *listener, void *data) { + if (event->state->committed & WLR_OUTPUT_STATE_SCALE) { + output_for_each_container(output, update_textures, NULL); + output_for_each_surface(output, update_output_scale_iterator, NULL); ++ update_im_scale(output); + } + + if (event->state->committed & ( +diff --git a/sway/input/text_input.c b/sway/input/text_input.c +index 05c867d6..fec11e77 100644 +--- a/sway/input/text_input.c ++++ b/sway/input/text_input.c +@@ -169,7 +169,11 @@ static void input_popup_update(struct sway_input_popup *popup) { + static void surface_send_enter_iterator(struct wlr_surface *surface, + int x, int y, void *data) { + struct wlr_output *wlr_output = data; ++ float scale = wlr_output->scale; + wlr_surface_send_enter(surface, wlr_output); ++ ++ wlr_fractional_scale_v1_notify_scale(surface, scale); ++ wlr_surface_set_preferred_buffer_scale(surface, ceil(scale)); + } + + static void surface_send_leave_iterator(struct wlr_surface *surface, +-- +2.43.2 + diff --git a/0003-chore-left_pt-on-method-popup.patch b/0003-chore-left_pt-on-method-popup.patch new file mode 100644 index 000000000000..9ad8e9a9510e --- /dev/null +++ b/0003-chore-left_pt-on-method-popup.patch @@ -0,0 +1,27 @@ +From 0789c12a8edf46fbc1c7024e153f3e8f8f35fe12 Mon Sep 17 00:00:00 2001 +From: ShootingStarDragons <ShootingStarDragons@protonmail.com> +Date: Fri, 8 Dec 2023 22:04:48 +0800 +Subject: [PATCH 3/3] chore: left_pt on method popup + +this keep cusor the same action with qt and gtk im module +--- + sway/input/cursor.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sway/input/cursor.c b/sway/input/cursor.c +index 4b6a9835..fa9d5b33 100644 +--- a/sway/input/cursor.c ++++ b/sway/input/cursor.c +@@ -144,6 +144,9 @@ struct sway_node *node_at_coords( + + if ((*surface = input_popup_surface_at(output, + &seat->im_relay, ox, oy, sx, sy))) { ++ struct sway_cursor* cursor = seat->cursor; ++ // set cursot to left_ptr ++ cursor_set_image(cursor, "left_ptr", NULL); + return NULL; + } + // check for unmanaged views +-- +2.43.2 + @@ -6,9 +6,9 @@ # Contributor: tinywrkb <tinywrkb@gmail.com> pkgname=sway-im -pkgver=1.8.1 +pkgver=1.9 epoch=1 -pkgrel=2 +pkgrel=1 pkgdesc='Tiling Wayland compositor and replacement for the i3 window manager, with input method popups v2 support' arch=(x86_64) url='https://swaywm.org/' @@ -22,7 +22,7 @@ depends=( 'libpixman-1.so' 'libudev.so' 'libwayland-server.so' - 'libwlroots.so=11' + 'libwlroots.so=12' 'libxcb' 'libxkbcommon.so' 'pango' @@ -57,17 +57,17 @@ source=("https://github.com/swaywm/sway/releases/download/$pkgver/sway-$pkgver.t "https://github.com/swaywm/sway/releases/download/$pkgver/sway-$pkgver.tar.gz.sig" "50-systemd-user.conf" "sway-portals.conf" - "sys_nice_user_xkb_configs.patch" "0001-text_input-Implement-input-method-popups.patch" - "0002-backport-sway-im-to-v1.8.patch") + "0002-chore-fractal-scale-handle.patch" + "0003-chore-left_pt-on-method-popup.patch") install=sway.install -sha512sums=('1504312a199608532e22336c5031e8f4749f5102ab321d13d97a1f93d49c8ec435e9097af729d8f7dfa81e2e96cee7de91cf4c04b6a7b7151ea740a1e43eb086' +sha512sums=('1d2a47bb8b838573a32f3719a7329fd744119c2c7efc5e5a4168b2bacfb09a3901a569177e5e10c129141fafe00e823ab78c04b76b502d23caa7621bbccd5919' 'SKIP' 'd5f9aadbb4bbef067c31d4c8c14dad220eb6f3e559e9157e20e1e3d47faf2f77b9a15e52519c3ffc53dc8a5202cb28757b81a4b3b0cc5dd50a4ddc49e03fe06e' - '091a205bca875b6a78150b5b14ffaca996b7c7c3d6f68910e5891e5409ca070d27b3307e8c4916c1562a998d5bcb94406e961bf376d86e64c8ddf5afe5b41f76' - '156719e93d0213d1b54ce6e3a9b2dcc9246da5689dd2d3281546f9c042cbc69072f99b087e112fe777dcd786d2b9d1be1e1c9200feddffb5e2d16f8dfb27515d' - 'f3a0bf6b48ecb09b229ba286f57c1a43e83848c187816b6784df1a3640c083759e8236bc949c8097044d3af218813757b636226a097e495d993fd682f20ceb96' - 'f5441d4da5c9c43a5f70e56eb00fcec7a56c3f76dbe03cbaab55b7bd1ea82ff8fbae1e1ae3e8dfaf1860db8e76635fc578649e537b609eb914e068cb9c4929d1') + 'b9e708c775825c8124d8e154e523c90b8a32715050ba06f6dbcdd08d109eed484d128ccc8dcd6a49dc9cd51a0c9035779c2706b4d7a139115e85c4f54226b775' + '07343bed09ca1689e647465d38013dc42e5a290bf8bcce57244eaccc7c3c858f04ec5d2786dc3af193a070faa89606598cccba66cd52d4078973afb757d5b72e' + 'dd013a9c6859dc0210aa55a519c1df4c5899e164d7a6c7f86f831dcd37f9b26839f24e7bc2dc066ee7fad38ff91bcae9516a0c3bffebb09c35c8133f0af10bc8' + 'dba122283df29239ff94cac20c74f28937822573474bebf3865096bc073ef366412ccead4d1c46197c93eefc09d2c8af74de782f5be2a462d7911020c7a43d0e') validpgpkeys=('34FF9526CFEF0E97A340E2E40FDE7BE0E88F5E48' # Simon Ser '9DDA3B9FA5D58DD5392C78E652CB6609B22DA89A') # Drew DeVault conflicts=('sway') @@ -76,25 +76,19 @@ provides=('sway') prepare() { cd "sway-$pkgver" - # Enable user xkb configs with cap_sys_nice - otherwise user xkb configs will - # break. - # - # This patch was originally at - # https://github.com/swaywm/sway/commit/2f2cdd60def006f6d3cbe318f9edd7d68fcb239a.patch - # but failed to apply correctly to meson.build. We don't need that part of - # the patch so just drop it. - patch -p1 < ../sys_nice_user_xkb_configs.patch - # Set the version information to 'Arch Linux' instead of 'makepkg' sed -i "s/branch \\\'@1@\\\'/Arch Linux/g" meson.build - # sway-im patch: https://github.com/swaywm/sway/pull/7226 + # sway-im patch: + # https://github.com/swaywm/sway/pull/7226#event-11545284120 + # https://github.com/swaywm/sway/commits/0789c12a8edf46fbc1c7024e153f3e8f8f35fe12 + # commit 0789c12a is the lastest commit before wlroots scene graph api patch -Np1 -i ../0001-text_input-Implement-input-method-popups.patch - patch -Np1 -i ../0002-backport-sway-im-to-v1.8.patch + patch -Np1 -i ../0002-chore-fractal-scale-handle.patch + patch -Np1 -i ../0003-chore-left_pt-on-method-popup.patch } build() { - export PKG_CONFIG_PATH='/usr/lib/wlroots0.16/pkgconfig' mkdir -p build arch-meson build "sway-$pkgver" -D sd-bus-provider=libsystemd -D werror=false -D b_ndebug=true ninja -C build @@ -105,11 +99,6 @@ package() { install -Dm644 "sway-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm644 50-systemd-user.conf -t "$pkgdir/etc/sway/config.d/" install -Dm644 sway-portals.conf "$pkgdir/usr/share/xdg-desktop-portal/sway-portals.conf" - - for util in autoname-workspaces.py inactive-windows-transparency.py grimshot; do - install -Dm755 "sway-$pkgver/contrib/$util" -t \ - "$pkgdir/usr/share/sway/scripts" - done } # vim: ts=2 sw=2 et diff --git a/sys_nice_user_xkb_configs.patch b/sys_nice_user_xkb_configs.patch deleted file mode 100644 index fe55dde40092..000000000000 --- a/sys_nice_user_xkb_configs.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/sway/config.c b/sway/config.c -index 1f2bb68604..f5efa98a8e 100644 ---- a/sway/config.c -+++ b/sway/config.c -@@ -37,7 +37,7 @@ struct sway_config *config = NULL; - - static struct xkb_state *keysym_translation_state_create( - struct xkb_rule_names rules) { -- struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); -+ struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_SECURE_GETENV); - struct xkb_keymap *xkb_keymap = xkb_keymap_new_from_names( - context, - &rules, -diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c -index 3f4a7289b9..45a588ecbf 100644 ---- a/sway/input/keyboard.c -+++ b/sway/input/keyboard.c -@@ -754,7 +754,7 @@ static void handle_xkb_context_log(struct xkb_context *context, - - struct xkb_keymap *sway_keyboard_compile_keymap(struct input_config *ic, - char **error) { -- struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); -+ struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_SECURE_GETENV); - if (!sway_assert(context, "cannot create XKB context")) { - return NULL; - } - |