1 Star 0 Fork 44

yangbo/xorg-x11-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0006-xwayland-Add-per-client-private-data.patch 2.69 KB
一键复制 编辑 原始数据 按行查看 历史
yangcheng1203 提交于 2021-12-27 15:04 . provide xwayland
From 80ca38c4428a499a795084dc696c390b707749b9 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Aug 2019 22:45:12 +0200
Subject: [PATCH xserver 06/24] xwayland: Add per client private data
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add per client private data, which for now is empty.
This is a preparation patch for adding randr/vidmode resolution
change emulation.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 905cb8b9e27add5f49a45fe167a0005bf05218bc)
---
hw/xwayland/xwayland.c | 14 ++++++++++++++
hw/xwayland/xwayland.h | 5 +++++
2 files changed, 19 insertions(+)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 3c50396f1..b0e37ceb9 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -135,11 +135,18 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 0;
}
+static DevPrivateKeyRec xwl_client_private_key;
static DevPrivateKeyRec xwl_window_private_key;
static DevPrivateKeyRec xwl_screen_private_key;
static DevPrivateKeyRec xwl_pixmap_private_key;
static DevPrivateKeyRec xwl_damage_private_key;
+struct xwl_client *
+xwl_client_get(ClientPtr client)
+{
+ return dixLookupPrivate(&client->devPrivates, &xwl_client_private_key);
+}
+
static struct xwl_window *
xwl_window_get(WindowPtr window)
{
@@ -1143,6 +1150,13 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0))
return FALSE;
+ /* There are no easy to use new / delete client hooks, we could use a
+ * ClientStateCallback, but it is easier to let the dix code manage the
+ * memory for us. This will zero fill the initial xwl_client data.
+ */
+ if (!dixRegisterPrivateKey(&xwl_client_private_key, PRIVATE_CLIENT,
+ sizeof(struct xwl_client)))
+ return FALSE;
dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen);
xwl_screen->screen = pScreen;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index c66997f00..593e92b64 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -379,8 +379,13 @@ struct xwl_output {
Bool xdg_output_done;
};
+struct xwl_client {
+};
+
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
+struct xwl_client *xwl_client_get(ClientPtr client);
+
void xwl_sync_events (struct xwl_screen *xwl_screen);
void xwl_surface_damage(struct xwl_screen *xwl_screen,
struct wl_surface *surface,
--
2.25.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangbo2022/xorg-x11-server.git
git@gitee.com:yangbo2022/xorg-x11-server.git
yangbo2022
xorg-x11-server
xorg-x11-server
master

搜索帮助