Updated for PinePhone Pro
This commit is contained in:
1 parent
5e93eb11db
commit
0894eab4fb
44 files changed
+1868
-892
No files matched your search
+12
-12
@@ -1,7 +1,7 @@
|
||||
From dddfcf3c8cd658d43df83dd9e3cd4f502c611c4f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <dddfcf3c8cd658d43df83dd9e3cd4f502c611c4f.1705668498.git.agx@sigxcpu.org>
|
||||
From 91b770c013e89e55636594051be03f6825ff04cc Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <91b770c013e89e55636594051be03f6825ff04cc.1731366381.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Fri, 19 Jan 2024 13:44:28 +0100
|
||||
Date: Fri, 1 Jan 2021 13:58:55 +0100
|
||||
Subject: [PATCH] Revert "layer-shell: error on 0 dimension without anchors"
|
||||
|
||||
This reverts commit 8dec751a6d84335fb04288b8efab6dd5c90288d3.
|
||||
@@ -12,25 +12,25 @@ Revert this until phosh has a fixed release.
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
|
||||
index 3bb3b91..28cf5f3 100644
|
||||
index d4893871..bcf82a43 100644
|
||||
--- a/types/wlr_layer_shell_v1.c
|
||||
+++ b/types/wlr_layer_shell_v1.c
|
||||
@@ -331,6 +331,7 @@ static void layer_surface_role_client_commit(struct wlr_surface *wlr_surface) {
|
||||
@@ -366,6 +366,7 @@ static void layer_surface_role_client_commit(struct wlr_surface *wlr_surface) {
|
||||
return;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
const uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
|
||||
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
|
||||
if (surface->pending.desired_width == 0 &&
|
||||
@@ -350,6 +351,7 @@ static void layer_surface_role_client_commit(struct wlr_surface *wlr_surface) {
|
||||
const uint32_t vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
|
||||
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
|
||||
if (surface->pending.desired_height == 0 && (anchor & vert) != vert) {
|
||||
@@ -374,6 +375,7 @@ static void layer_surface_role_client_commit(struct wlr_surface *wlr_surface) {
|
||||
"height 0 requested without setting top and bottom anchors");
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
|
||||
if ((anchor & surface->pending.exclusive_edge) != surface->pending.exclusive_edge) {
|
||||
wlr_surface_reject_pending(wlr_surface, surface->resource,
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
From 3c8b98066cc39a3c06dd9d09d3f4ad542dfa13b1 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <3c8b98066cc39a3c06dd9d09d3f4ad542dfa13b1.1737996779.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Mon, 27 Jan 2025 17:48:39 +0100
|
||||
Subject: [PATCH] seat: Don't forget to destroy touch points on touch up
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Otherwise number of touch points goes up constantly and d'n'd via touch
|
||||
can't work as validation always fails.
|
||||
|
||||
Fixes 75ecba44 ("seat: add serials to touch up events")
|
||||
|
||||
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
||||
---
|
||||
types/seat/wlr_seat_touch.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/types/seat/wlr_seat_touch.c b/types/seat/wlr_seat_touch.c
|
||||
index 09f33d6..cc5b7c8 100644
|
||||
--- a/types/seat/wlr_seat_touch.c
|
||||
+++ b/types/seat/wlr_seat_touch.c
|
||||
@@ -214,9 +214,10 @@ uint32_t wlr_seat_touch_notify_up(struct wlr_seat *seat, uint32_t time,
|
||||
return 0;
|
||||
}
|
||||
|
||||
- return grab->interface->up(grab, time, point);
|
||||
+ uint32_t serial = grab->interface->up(grab, time, point);
|
||||
|
||||
touch_point_destroy(point);
|
||||
+ return serial;
|
||||
}
|
||||
|
||||
void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time,
|
||||
--
|
||||
2.45.2
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From 48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Fri, 11 Sep 2026 10:57:59 +0200
|
||||
Subject: [PATCH 1/4] text-input-v3: Introduce version
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
||||
---
|
||||
include/wlr/types/wlr_text_input_v3.h | 2 +-
|
||||
types/wlr_text_input_v3.c | 8 ++++++--
|
||||
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/wlr/types/wlr_text_input_v3.h b/include/wlr/types/wlr_text_input_v3.h
|
||||
index 29feb7e6c..8a3e566d8 100644
|
||||
--- a/include/wlr/types/wlr_text_input_v3.h
|
||||
+++ b/include/wlr/types/wlr_text_input_v3.h
|
||||
@@ -84,7 +84,7 @@ struct wlr_text_input_manager_v3 {
|
||||
};
|
||||
|
||||
struct wlr_text_input_manager_v3 *wlr_text_input_manager_v3_create(
|
||||
- struct wl_display *wl_display);
|
||||
+ struct wl_display *wl_display, uint32_t version);
|
||||
|
||||
// Sends enter to the surface and saves it
|
||||
void wlr_text_input_v3_send_enter(struct wlr_text_input_v3 *text_input,
|
||||
diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c
|
||||
index bbae3a076..7a543f1a7 100644
|
||||
--- a/types/wlr_text_input_v3.c
|
||||
+++ b/types/wlr_text_input_v3.c
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <wlr/util/log.h>
|
||||
#include "text-input-unstable-v3-protocol.h"
|
||||
|
||||
+#define TEXT_INPUT_VERSION 1
|
||||
+
|
||||
static void text_input_clear_focused_surface(struct wlr_text_input_v3 *text_input) {
|
||||
wl_list_remove(&text_input->surface_destroy.link);
|
||||
wl_list_init(&text_input->surface_destroy.link);
|
||||
@@ -324,7 +326,9 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||
}
|
||||
|
||||
struct wlr_text_input_manager_v3 *wlr_text_input_manager_v3_create(
|
||||
- struct wl_display *display) {
|
||||
+ struct wl_display *display, uint32_t version) {
|
||||
+ assert(version <= TEXT_INPUT_VERSION);
|
||||
+
|
||||
struct wlr_text_input_manager_v3 *manager = calloc(1, sizeof(*manager));
|
||||
if (!manager) {
|
||||
return NULL;
|
||||
@@ -336,7 +340,7 @@ struct wlr_text_input_manager_v3 *wlr_text_input_manager_v3_create(
|
||||
wl_signal_init(&manager->events.destroy);
|
||||
|
||||
manager->global = wl_global_create(display,
|
||||
- &zwp_text_input_manager_v3_interface, 1, manager,
|
||||
+ &zwp_text_input_manager_v3_interface, version, manager,
|
||||
text_input_manager_bind);
|
||||
if (!manager->global) {
|
||||
free(manager);
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
From 1e7dd78cfda8ddd7c618c01973799aedcddfb72f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <1e7dd78cfda8ddd7c618c01973799aedcddfb72f.1741276434.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Tue, 4 Mar 2025 20:37:49 +0100
|
||||
Subject: [PATCH] xwm: Handle NET_WM_WINDOW_OPACITY
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Lot of clients use it (e.g. both Qt and GTK) although it never made it
|
||||
into the spec at
|
||||
|
||||
https://specifications.freedesktop.org/wm-spec/latest-single/
|
||||
|
||||
until recently
|
||||
|
||||
https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/97
|
||||
|
||||
(cherry picked from commit e752e3ec06fc7c2b83079a5980218ae359b1c869)
|
||||
|
||||
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
||||
---
|
||||
include/wlr/xwayland/xwayland.h | 2 ++
|
||||
include/xwayland/xwm.h | 1 +
|
||||
xwayland/xwm.c | 23 +++++++++++++++++++++++
|
||||
3 files changed, 26 insertions(+)
|
||||
|
||||
diff --git a/include/wlr/xwayland/xwayland.h b/include/wlr/xwayland/xwayland.h
|
||||
index 4b476a03..d0bbe993 100644
|
||||
--- a/include/wlr/xwayland/xwayland.h
|
||||
+++ b/include/wlr/xwayland/xwayland.h
|
||||
@@ -119,6 +119,7 @@ struct wlr_xwayland_surface {
|
||||
int16_t x, y;
|
||||
uint16_t width, height;
|
||||
bool override_redirect;
|
||||
+ float opacity;
|
||||
|
||||
char *title;
|
||||
char *class;
|
||||
@@ -186,6 +187,7 @@ struct wlr_xwayland_surface {
|
||||
struct wl_signal set_strut_partial;
|
||||
struct wl_signal set_override_redirect;
|
||||
struct wl_signal set_geometry;
|
||||
+ struct wl_signal set_opacity;
|
||||
/* can be used to set initial maximized/fullscreen geometry */
|
||||
struct wl_signal map_request;
|
||||
struct wl_signal ping_timeout;
|
||||
diff --git a/include/xwayland/xwm.h b/include/xwayland/xwm.h
|
||||
index 4386446d..43e36328 100644
|
||||
--- a/include/xwayland/xwm.h
|
||||
+++ b/include/xwayland/xwm.h
|
||||
@@ -62,6 +62,7 @@ enum atom_name {
|
||||
NET_STARTUP_ID,
|
||||
NET_STARTUP_INFO,
|
||||
NET_STARTUP_INFO_BEGIN,
|
||||
+ NET_WM_WINDOW_OPACITY,
|
||||
NET_WM_WINDOW_TYPE_NORMAL,
|
||||
NET_WM_WINDOW_TYPE_UTILITY,
|
||||
NET_WM_WINDOW_TYPE_TOOLTIP,
|
||||
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
|
||||
index b315fa0f..91ca596a 100644
|
||||
--- a/xwayland/xwm.c
|
||||
+++ b/xwayland/xwm.c
|
||||
@@ -61,6 +61,7 @@ static const char *const atom_map[ATOM_LAST] = {
|
||||
[NET_STARTUP_ID] = "_NET_STARTUP_ID",
|
||||
[NET_STARTUP_INFO] = "_NET_STARTUP_INFO",
|
||||
[NET_STARTUP_INFO_BEGIN] = "_NET_STARTUP_INFO_BEGIN",
|
||||
+ [NET_WM_WINDOW_OPACITY] = "_NET_WM_WINDOW_OPACITY",
|
||||
[NET_WM_WINDOW_TYPE_NORMAL] = "_NET_WM_WINDOW_TYPE_NORMAL",
|
||||
[NET_WM_WINDOW_TYPE_UTILITY] = "_NET_WM_WINDOW_TYPE_UTILITY",
|
||||
[NET_WM_WINDOW_TYPE_TOOLTIP] = "_NET_WM_WINDOW_TYPE_TOOLTIP",
|
||||
@@ -194,6 +195,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create(
|
||||
surface->width = width;
|
||||
surface->height = height;
|
||||
surface->override_redirect = override_redirect;
|
||||
+ surface->opacity = 1.0;
|
||||
wl_list_init(&surface->children);
|
||||
wl_list_init(&surface->stack_link);
|
||||
wl_list_init(&surface->parent_link);
|
||||
@@ -219,6 +221,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create(
|
||||
wl_signal_init(&surface->events.set_strut_partial);
|
||||
wl_signal_init(&surface->events.set_override_redirect);
|
||||
wl_signal_init(&surface->events.set_geometry);
|
||||
+ wl_signal_init(&surface->events.set_opacity);
|
||||
wl_signal_init(&surface->events.map_request);
|
||||
wl_signal_init(&surface->events.ping_timeout);
|
||||
|
||||
@@ -485,6 +488,8 @@ static void xwayland_surface_destroy(struct wlr_xwayland_surface *xsurface) {
|
||||
|
||||
wl_signal_emit_mutable(&xsurface->events.destroy, NULL);
|
||||
|
||||
+ assert(wl_list_empty(&xsurface->events.set_opacity.listener_list));
|
||||
+
|
||||
if (xsurface == xsurface->xwm->focus_surface) {
|
||||
xwm_surface_activate(xsurface->xwm, NULL);
|
||||
}
|
||||
@@ -568,6 +573,22 @@ static void read_surface_startup_id(struct wlr_xwm *xwm,
|
||||
wl_signal_emit_mutable(&xsurface->events.set_startup_id, NULL);
|
||||
}
|
||||
|
||||
+static void read_surface_opacity(struct wlr_xwm *xwm,
|
||||
+ struct wlr_xwayland_surface *xsurface,
|
||||
+ xcb_get_property_reply_t *reply) {
|
||||
+ if (reply->type == XCB_ATOM_CARDINAL && reply->format == 32 &&
|
||||
+ xcb_get_property_value_length(reply) ==
|
||||
+ sizeof(uint32_t)) {
|
||||
+ uint32_t *val = xcb_get_property_value(reply);
|
||||
+
|
||||
+ xsurface->opacity = (double)*val / UINT32_MAX;
|
||||
+ wl_signal_emit_mutable(&xsurface->events.set_opacity, NULL);
|
||||
+ } else if (reply->type == XCB_ATOM_NONE) {
|
||||
+ xsurface->opacity = 1.0;
|
||||
+ wl_signal_emit_mutable(&xsurface->events.set_opacity, NULL);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void read_surface_role(struct wlr_xwm *xwm,
|
||||
struct wlr_xwayland_surface *xsurface,
|
||||
xcb_get_property_reply_t *reply) {
|
||||
@@ -882,6 +903,8 @@ static void read_surface_property(struct wlr_xwm *xwm,
|
||||
read_surface_role(xwm, xsurface, reply);
|
||||
} else if (property == xwm->atoms[NET_STARTUP_ID]) {
|
||||
read_surface_startup_id(xwm, xsurface, reply);
|
||||
+ } else if (property == xwm->atoms[NET_WM_WINDOW_OPACITY]) {
|
||||
+ read_surface_opacity(xwm, xsurface, reply);
|
||||
} else if (wlr_log_get_verbosity() >= WLR_DEBUG) {
|
||||
char *prop_name = xwm_get_atom_name(xwm, property);
|
||||
wlr_log(WLR_DEBUG, "unhandled X11 property %" PRIu32 " (%s) for window %" PRIu32,
|
||||
--
|
||||
2.47.2
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
From c562da78f972c8abd1521a2787d38307f1ffa6dd Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c562da78f972c8abd1521a2787d38307f1ffa6dd.1789130119.git.agx@sigxcpu.org>
|
||||
In-Reply-To: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
References: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Fri, 11 Sep 2026 12:10:43 +0200
|
||||
Subject: [PATCH 2/4] text-input: Add version 2 events
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
||||
---
|
||||
include/wlr/types/wlr_text_input_v3.h | 9 +++++++++
|
||||
types/wlr_text_input_v3.c | 28 +++++++++++++++++++++++++++
|
||||
2 files changed, 37 insertions(+)
|
||||
|
||||
diff --git a/include/wlr/types/wlr_text_input_v3.h b/include/wlr/types/wlr_text_input_v3.h
|
||||
index 8a3e566d8..14285688c 100644
|
||||
--- a/include/wlr/types/wlr_text_input_v3.h
|
||||
+++ b/include/wlr/types/wlr_text_input_v3.h
|
||||
@@ -13,6 +13,8 @@
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/util/box.h>
|
||||
|
||||
+#include "text-input-unstable-v3-protocol.h"
|
||||
+
|
||||
struct wlr_surface;
|
||||
|
||||
enum wlr_text_input_v3_features {
|
||||
@@ -99,5 +101,12 @@ void wlr_text_input_v3_send_delete_surrounding_text(
|
||||
struct wlr_text_input_v3 *text_input, uint32_t before_length,
|
||||
uint32_t after_length);
|
||||
void wlr_text_input_v3_send_done(struct wlr_text_input_v3 *text_input);
|
||||
+// v2 additions
|
||||
+void wlr_text_input_v3_action(struct wlr_text_input_v3 *text_input,
|
||||
+ enum zwp_text_input_v3_action action);
|
||||
+void wlr_text_input_v3_send_language(struct wlr_text_input_v3 *text_input,
|
||||
+ const char *language);
|
||||
+void wlr_text_input_v3_send_preedit_hint(struct wlr_text_input_v3 *text_input,
|
||||
+ uint32_t start, uint32_t end, enum zwp_text_input_v3_preedit_hint hint);
|
||||
|
||||
#endif
|
||||
diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c
|
||||
index 7a543f1a7..5ec84e120 100644
|
||||
--- a/types/wlr_text_input_v3.c
|
||||
+++ b/types/wlr_text_input_v3.c
|
||||
@@ -65,6 +65,34 @@ void wlr_text_input_v3_send_done(struct wlr_text_input_v3 *text_input) {
|
||||
text_input->current_serial);
|
||||
}
|
||||
|
||||
+void wlr_text_input_v3_action(struct wlr_text_input_v3 *text_input,
|
||||
+ enum zwp_text_input_v3_action action) {
|
||||
+ uint32_t serial = wl_display_next_serial(text_input->seat->display);
|
||||
+ uint32_t version = wl_resource_get_version(text_input->resource);
|
||||
+ if (version >= ZWP_TEXT_INPUT_V3_ACTION_SINCE_VERSION) {
|
||||
+ zwp_text_input_v3_send_action(text_input->resource, action,
|
||||
+ serial);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void wlr_text_input_v3_send_language(struct wlr_text_input_v3 *text_input,
|
||||
+ const char *language) {
|
||||
+ uint32_t version = wl_resource_get_version(text_input->resource);
|
||||
+ if (version >= ZWP_TEXT_INPUT_V3_LANGUAGE_SINCE_VERSION) {
|
||||
+ zwp_text_input_v3_send_language(text_input->resource, language);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void wlr_text_input_v3_send_preedit_hint(struct wlr_text_input_v3 *text_input,
|
||||
+ uint32_t start, uint32_t end,
|
||||
+ enum zwp_text_input_v3_preedit_hint hint) {
|
||||
+ uint32_t version = wl_resource_get_version(text_input->resource);
|
||||
+ if (version >= ZWP_TEXT_INPUT_V3_PREEDIT_HINT_SINCE_VERSION) {
|
||||
+ zwp_text_input_v3_send_preedit_hint(text_input->resource,
|
||||
+ start, end, hint);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void wlr_text_input_destroy(struct wlr_text_input_v3 *text_input) {
|
||||
wl_signal_emit_mutable(&text_input->events.destroy, NULL);
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
From c2e4c357708b8879ed33a3f991765358fa29102f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c2e4c357708b8879ed33a3f991765358fa29102f.1789130119.git.agx@sigxcpu.org>
|
||||
In-Reply-To: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
References: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Fri, 11 Sep 2026 12:18:31 +0200
|
||||
Subject: [PATCH 3/4] text-input-v3: Add version 2 requests
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
||||
---
|
||||
include/wlr/types/wlr_text_input_v3.h | 4 ++
|
||||
types/wlr_text_input_v3.c | 58 +++++++++++++++++++++++++++
|
||||
2 files changed, 62 insertions(+)
|
||||
|
||||
diff --git a/include/wlr/types/wlr_text_input_v3.h b/include/wlr/types/wlr_text_input_v3.h
|
||||
index 14285688c..d176457c7 100644
|
||||
--- a/include/wlr/types/wlr_text_input_v3.h
|
||||
+++ b/include/wlr/types/wlr_text_input_v3.h
|
||||
@@ -38,6 +38,7 @@ struct wlr_text_input_v3_state {
|
||||
} content_type;
|
||||
|
||||
struct wlr_box cursor_rectangle;
|
||||
+ enum zwp_text_input_v3_action available_actions;
|
||||
|
||||
// Tracks which features were used in the current commit.
|
||||
// Useful in the enabling commit, where usage means support.
|
||||
@@ -63,6 +64,9 @@ struct wlr_text_input_v3 {
|
||||
struct wl_signal commit;
|
||||
struct wl_signal disable;
|
||||
struct wl_signal destroy;
|
||||
+ // v2 additions
|
||||
+ struct wl_signal show_input_panel;
|
||||
+ struct wl_signal hide_input_panel;
|
||||
} events;
|
||||
|
||||
struct {
|
||||
diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c
|
||||
index 5ec84e120..3fba5bc35 100644
|
||||
--- a/types/wlr_text_input_v3.c
|
||||
+++ b/types/wlr_text_input_v3.c
|
||||
@@ -100,6 +100,8 @@ static void wlr_text_input_destroy(struct wlr_text_input_v3 *text_input) {
|
||||
assert(wl_list_empty(&text_input->events.commit.listener_list));
|
||||
assert(wl_list_empty(&text_input->events.disable.listener_list));
|
||||
assert(wl_list_empty(&text_input->events.destroy.listener_list));
|
||||
+ assert(wl_list_empty(&text_input->events.show_input_panel.listener_list));
|
||||
+ assert(wl_list_empty(&text_input->events.hide_input_panel.listener_list));
|
||||
|
||||
text_input_clear_focused_surface(text_input);
|
||||
wl_list_remove(&text_input->seat_destroy.link);
|
||||
@@ -231,6 +233,56 @@ static void text_input_commit(struct wl_client *client,
|
||||
}
|
||||
}
|
||||
|
||||
+static void text_input_show_input_panel(struct wl_client *client,
|
||||
+ struct wl_resource *resource) {
|
||||
+ struct wlr_text_input_v3 *text_input = text_input_from_resource(resource);
|
||||
+ if (!text_input) {
|
||||
+ return;
|
||||
+ }
|
||||
+ wl_signal_emit_mutable(&text_input->events.show_input_panel, NULL);
|
||||
+}
|
||||
+
|
||||
+static void text_input_hide_input_panel(struct wl_client *client,
|
||||
+ struct wl_resource *resource) {
|
||||
+ struct wlr_text_input_v3 *text_input = text_input_from_resource(resource);
|
||||
+ if (!text_input) {
|
||||
+ return;
|
||||
+ }
|
||||
+ wl_signal_emit_mutable(&text_input->events.hide_input_panel, NULL);
|
||||
+}
|
||||
+
|
||||
+static void text_input_set_available_actions(struct wl_client *client,
|
||||
+ struct wl_resource *resource, struct wl_array *actions) {
|
||||
+ struct wlr_text_input_v3 *text_input = text_input_from_resource(resource);
|
||||
+ if (!text_input) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ enum zwp_text_input_v3_action available = ZWP_TEXT_INPUT_V3_ACTION_NONE;
|
||||
+ uint32_t *action;
|
||||
+ wl_array_for_each(action, actions) {
|
||||
+ switch (*action) {
|
||||
+ case ZWP_TEXT_INPUT_V3_ACTION_SUBMIT:
|
||||
+ if (available & ZWP_TEXT_INPUT_V3_ACTION_SUBMIT) {
|
||||
+ wl_resource_post_error(resource,
|
||||
+ ZWP_TEXT_INPUT_V3_ERROR_INVALID_ACTION,
|
||||
+ "Duplicate submit action");
|
||||
+ return;
|
||||
+ }
|
||||
+ available |= ZWP_TEXT_INPUT_V3_ACTION_SUBMIT;
|
||||
+ break;
|
||||
+ case ZWP_TEXT_INPUT_V3_ACTION_NONE:
|
||||
+ wl_resource_post_error(resource,
|
||||
+ ZWP_TEXT_INPUT_V3_ERROR_INVALID_ACTION,
|
||||
+ "Invalid none action");
|
||||
+ return;
|
||||
+ default:
|
||||
+ wlr_log(WLR_DEBUG, "Unknown action %u", *action);
|
||||
+ }
|
||||
+ }
|
||||
+ text_input->pending.available_actions = available;
|
||||
+}
|
||||
+
|
||||
static const struct zwp_text_input_v3_interface text_input_impl = {
|
||||
.destroy = text_input_destroy,
|
||||
.enable = text_input_enable,
|
||||
@@ -240,6 +292,10 @@ static const struct zwp_text_input_v3_interface text_input_impl = {
|
||||
.set_content_type = text_input_set_content_type,
|
||||
.set_cursor_rectangle = text_input_set_cursor_rectangle,
|
||||
.commit = text_input_commit,
|
||||
+ // v2 additions
|
||||
+ .show_input_panel = text_input_show_input_panel,
|
||||
+ .hide_input_panel = text_input_hide_input_panel,
|
||||
+ .set_available_actions = text_input_set_available_actions,
|
||||
};
|
||||
|
||||
static const struct zwp_text_input_manager_v3_interface text_input_manager_impl;
|
||||
@@ -299,6 +355,8 @@ static void text_input_manager_get_text_input(struct wl_client *client,
|
||||
wl_signal_init(&text_input->events.commit);
|
||||
wl_signal_init(&text_input->events.disable);
|
||||
wl_signal_init(&text_input->events.destroy);
|
||||
+ wl_signal_init(&text_input->events.show_input_panel);
|
||||
+ wl_signal_init(&text_input->events.hide_input_panel);
|
||||
|
||||
text_input->resource = text_input_resource;
|
||||
wl_resource_set_user_data(text_input_resource, text_input);
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 2049e1494b7e99d816cfb469111cb4a290e422dc Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <2049e1494b7e99d816cfb469111cb4a290e422dc.1789130119.git.agx@sigxcpu.org>
|
||||
In-Reply-To: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
References: <48f2eeff1bd020877b9c14c2b84e1a94bf79f3d8.1789130119.git.agx@sigxcpu.org>
|
||||
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
|
||||
Date: Fri, 11 Sep 2026 13:13:02 +0200
|
||||
Subject: [PATCH 4/4] text-input-v3: Bump protocol version to 2
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
||||
---
|
||||
types/wlr_text_input_v3.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c
|
||||
index 3fba5bc35..9a6be20a2 100644
|
||||
--- a/types/wlr_text_input_v3.c
|
||||
+++ b/types/wlr_text_input_v3.c
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <wlr/util/log.h>
|
||||
#include "text-input-unstable-v3-protocol.h"
|
||||
|
||||
-#define TEXT_INPUT_VERSION 1
|
||||
+#define TEXT_INPUT_VERSION 2
|
||||
|
||||
static void text_input_clear_focused_surface(struct wlr_text_input_v3 *text_input) {
|
||||
wl_list_remove(&text_input->surface_destroy.link);
|
||||
--
|
||||
2.53.0
|
||||
|
||||
Reference in new issue
Block a user