present: Only send PresentCompleteNotify events to the presenting client
We were sending the events to all clients listening for them on the window. But clients can get confused by events from another client, and I can't imagine any case where receiving events from other clients would be required. v2: * Also restrict events sent to additional windows to the presenting client * Don't shorten line lengths Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
fc7fb5bbe1
commit
559954aaa8
|
@ -206,13 +206,13 @@ present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, uint64_
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if (vblank->window)
|
if (vblank->window)
|
||||||
present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset);
|
present_send_complete_notify(vblank->window, kind, mode, vblank->serial, ust, crtc_msc - vblank->msc_offset, vblank->client);
|
||||||
for (n = 0; n < vblank->num_notifies; n++) {
|
for (n = 0; n < vblank->num_notifies; n++) {
|
||||||
WindowPtr window = vblank->notifies[n].window;
|
WindowPtr window = vblank->notifies[n].window;
|
||||||
CARD32 serial = vblank->notifies[n].serial;
|
CARD32 serial = vblank->notifies[n].serial;
|
||||||
|
|
||||||
if (window)
|
if (window)
|
||||||
present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset);
|
present_send_complete_notify(window, kind, mode, serial, ust, crtc_msc - vblank->msc_offset, vblank->client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -772,6 +772,7 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
|
||||||
int
|
int
|
||||||
present_pixmap(WindowPtr window,
|
present_pixmap(WindowPtr window,
|
||||||
PixmapPtr pixmap,
|
PixmapPtr pixmap,
|
||||||
|
ClientPtr client,
|
||||||
CARD32 serial,
|
CARD32 serial,
|
||||||
RegionPtr valid,
|
RegionPtr valid,
|
||||||
RegionPtr update,
|
RegionPtr update,
|
||||||
|
@ -882,6 +883,7 @@ present_pixmap(WindowPtr window,
|
||||||
xorg_list_append(&vblank->window_list, &window_priv->vblank);
|
xorg_list_append(&vblank->window_list, &window_priv->vblank);
|
||||||
xorg_list_init(&vblank->event_queue);
|
xorg_list_init(&vblank->event_queue);
|
||||||
|
|
||||||
|
vblank->client = client;
|
||||||
vblank->screen = screen;
|
vblank->screen = screen;
|
||||||
vblank->window = window;
|
vblank->window = window;
|
||||||
vblank->pixmap = pixmap;
|
vblank->pixmap = pixmap;
|
||||||
|
@ -1001,6 +1003,7 @@ present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, uint64
|
||||||
|
|
||||||
int
|
int
|
||||||
present_notify_msc(WindowPtr window,
|
present_notify_msc(WindowPtr window,
|
||||||
|
ClientPtr client,
|
||||||
CARD32 serial,
|
CARD32 serial,
|
||||||
uint64_t target_msc,
|
uint64_t target_msc,
|
||||||
uint64_t divisor,
|
uint64_t divisor,
|
||||||
|
@ -1008,6 +1011,7 @@ present_notify_msc(WindowPtr window,
|
||||||
{
|
{
|
||||||
return present_pixmap(window,
|
return present_pixmap(window,
|
||||||
NULL,
|
NULL,
|
||||||
|
client,
|
||||||
serial,
|
serial,
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
0, 0,
|
0, 0,
|
||||||
|
|
|
@ -146,7 +146,7 @@ present_register_complete_notify(present_complete_notify_proc proc)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc)
|
present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc, ClientPtr client)
|
||||||
{
|
{
|
||||||
present_window_priv_ptr window_priv = present_window_priv(window);
|
present_window_priv_ptr window_priv = present_window_priv(window);
|
||||||
|
|
||||||
|
@ -167,7 +167,8 @@ present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 se
|
||||||
present_event_ptr event;
|
present_event_ptr event;
|
||||||
|
|
||||||
for (event = window_priv->events; event; event = event->next) {
|
for (event = window_priv->events; event; event = event->next) {
|
||||||
if (event->mask & PresentCompleteNotifyMask) {
|
if (event->mask & PresentCompleteNotifyMask &&
|
||||||
|
client == event->client) {
|
||||||
cn.eid = event->id;
|
cn.eid = event->id;
|
||||||
WriteEventsToClient(event->client, 1, (xEvent *) &cn);
|
WriteEventsToClient(event->client, 1, (xEvent *) &cn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct present_notify {
|
||||||
struct present_vblank {
|
struct present_vblank {
|
||||||
struct xorg_list window_list;
|
struct xorg_list window_list;
|
||||||
struct xorg_list event_queue;
|
struct xorg_list event_queue;
|
||||||
|
ClientPtr client;
|
||||||
ScreenPtr screen;
|
ScreenPtr screen;
|
||||||
WindowPtr window;
|
WindowPtr window;
|
||||||
PixmapPtr pixmap;
|
PixmapPtr pixmap;
|
||||||
|
@ -155,6 +156,7 @@ present_get_window_priv(WindowPtr window, Bool create);
|
||||||
int
|
int
|
||||||
present_pixmap(WindowPtr window,
|
present_pixmap(WindowPtr window,
|
||||||
PixmapPtr pixmap,
|
PixmapPtr pixmap,
|
||||||
|
ClientPtr client,
|
||||||
CARD32 serial,
|
CARD32 serial,
|
||||||
RegionPtr valid,
|
RegionPtr valid,
|
||||||
RegionPtr update,
|
RegionPtr update,
|
||||||
|
@ -172,6 +174,7 @@ present_pixmap(WindowPtr window,
|
||||||
|
|
||||||
int
|
int
|
||||||
present_notify_msc(WindowPtr window,
|
present_notify_msc(WindowPtr window,
|
||||||
|
ClientPtr client,
|
||||||
CARD32 serial,
|
CARD32 serial,
|
||||||
uint64_t target_msc,
|
uint64_t target_msc,
|
||||||
uint64_t divisor,
|
uint64_t divisor,
|
||||||
|
@ -215,7 +218,7 @@ void
|
||||||
present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling);
|
present_send_config_notify(WindowPtr window, int x, int y, int w, int h, int bw, WindowPtr sibling);
|
||||||
|
|
||||||
void
|
void
|
||||||
present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc);
|
present_send_complete_notify(WindowPtr window, CARD8 kind, CARD8 mode, CARD32 serial, uint64_t ust, uint64_t msc, ClientPtr client);
|
||||||
|
|
||||||
void
|
void
|
||||||
present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, present_fence_ptr idle_fence);
|
present_send_idle_notify(WindowPtr window, CARD32 serial, PixmapPtr pixmap, present_fence_ptr idle_fence);
|
||||||
|
|
|
@ -135,7 +135,7 @@ proc_present_pixmap(ClientPtr client)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = present_pixmap(window, pixmap, stuff->serial, valid, update,
|
ret = present_pixmap(window, pixmap, client, stuff->serial, valid, update,
|
||||||
stuff->x_off, stuff->y_off, target_crtc,
|
stuff->x_off, stuff->y_off, target_crtc,
|
||||||
wait_fence, idle_fence, stuff->options,
|
wait_fence, idle_fence, stuff->options,
|
||||||
stuff->target_msc, stuff->divisor, stuff->remainder, notifies, nnotifies);
|
stuff->target_msc, stuff->divisor, stuff->remainder, notifies, nnotifies);
|
||||||
|
@ -171,7 +171,7 @@ proc_present_notify_msc(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return present_notify_msc(window, stuff->serial,
|
return present_notify_msc(window, client, stuff->serial,
|
||||||
stuff->target_msc, stuff->divisor, stuff->remainder);
|
stuff->target_msc, stuff->divisor, stuff->remainder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user