Magellan Linux

Contents of /trunk/xorg-server/patches/xorg-server-21.1.8-present-Send-a-PresentConfigureNotify-event-for-dest.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3791 - (show annotations) (download)
Thu Oct 19 12:39:05 2023 UTC (7 months ago) by niro
File size: 4112 byte(s)
-upstream fixes
1 From b98fc07d3442a289c6bef82df50dd0a2d01de71a Mon Sep 17 00:00:00 2001
2 From: Adam Jackson <ajax@redhat.com>
3 Date: Thu, 2 Feb 2023 12:26:27 -0500
4 Subject: [PATCH] present: Send a PresentConfigureNotify event for destroyed
5 windows
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 This enables fixing a deadlock case on the client side, where the client
11 ends up blocked waiting for a Present event that will never come because
12 the window was destroyed. The new PresentWindowDestroyed flag allows the
13 client to avoid blocking indefinitely.
14
15 Signed-off-by: Adam Jackson <ajax@redhat.com>
16 See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116
17 See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6685
18 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
19 (cherry picked from commit 462b06033e66a32308d940eb5fc47f5e4c914dc0)
20 Signed-off-by: Laurent Carlier <lordheavym@gmail.com>
21 ---
22 present/present_event.c | 5 +++--
23 present/present_priv.h | 7 ++++++-
24 present/present_screen.c | 11 ++++++++++-
25 3 files changed, 19 insertions(+), 4 deletions(-)
26
27 diff --git a/present/present_event.c b/present/present_event.c
28 index 435b26b70..849732dc8 100644
29 --- a/present/present_event.c
30 +++ b/present/present_event.c
31 @@ -102,7 +102,8 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to)
32 }
33
34 void
35 -present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling)
36 +present_send_config_notify(WindowPtr window, int x, int y, int w, int h,
37 + int bw, WindowPtr sibling, CARD32 flags)
38 {
39 present_window_priv_ptr window_priv = present_window_priv(window);
40
41 @@ -122,7 +123,7 @@ present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw,
42 .off_y = 0,
43 .pixmap_width = w,
44 .pixmap_height = h,
45 - .pixmap_flags = 0
46 + .pixmap_flags = flags
47 };
48 present_event_ptr event;
49
50 diff --git a/present/present_priv.h b/present/present_priv.h
51 index 6ebd009a2..4ad729864 100644
52 --- a/present/present_priv.h
53 +++ b/present/present_priv.h
54 @@ -43,6 +43,11 @@
55 #define DebugPresent(x)
56 #endif
57
58 +/* XXX this belongs in presentproto */
59 +#ifndef PresentWindowDestroyed
60 +#define PresentWindowDestroyed (1 << 0)
61 +#endif
62 +
63 extern int present_request;
64
65 extern DevPrivateKeyRec present_screen_private_key;
66 @@ -307,7 +312,7 @@ void
67 present_free_events(WindowPtr window);
68
69 void
70 -present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling);
71 +present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling, CARD32 flags);
72
73 void
74 present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc);
75 diff --git a/present/present_screen.c b/present/present_screen.c
76 index 15684eda4..2c29aafd2 100644
77 --- a/present/present_screen.c
78 +++ b/present/present_screen.c
79 @@ -93,6 +93,15 @@ present_destroy_window(WindowPtr window)
80 present_screen_priv_ptr screen_priv = present_screen_priv(screen);
81 present_window_priv_ptr window_priv = present_window_priv(window);
82
83 + present_send_config_notify(window,
84 + window->drawable.x,
85 + window->drawable.y,
86 + window->drawable.width,
87 + window->drawable.height,
88 + window->borderWidth,
89 + window->nextSib,
90 + PresentWindowDestroyed);
91 +
92 if (window_priv) {
93 present_clear_window_notifies(window);
94 present_free_events(window);
95 @@ -123,7 +132,7 @@ present_config_notify(WindowPtr window,
96 ScreenPtr screen = window->drawable.pScreen;
97 present_screen_priv_ptr screen_priv = present_screen_priv(screen);
98
99 - present_send_config_notify(window, x, y, w, h, bw, sibling);
100 + present_send_config_notify(window, x, y, w, h, bw, sibling, 0);
101
102 unwrap(screen_priv, screen, ConfigNotify);
103 if (screen->ConfigNotify)
104 --
105 2.41.0
106