Merge pull request #1439 from jsorg71/xup_shm_fix

xup: fix for when shmem_id changes
This commit is contained in:
jsorg71 2019-11-08 23:49:09 -08:00 committed by GitHub
commit 8e10f0820c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1111,6 +1111,19 @@ process_server_paint_rect_shmem(struct mod *amod, struct stream *s)
amod->screen_shmem_id_mapped = 1;
}
}
else if (amod->screen_shmem_id != shmem_id)
{
amod->screen_shmem_id = shmem_id;
g_shmdt(amod->screen_shmem_pixels);
amod->screen_shmem_pixels = (char *) g_shmat(amod->screen_shmem_id);
if (amod->screen_shmem_pixels == (void*)-1)
{
/* failed */
amod->screen_shmem_id = 0;
amod->screen_shmem_pixels = 0;
amod->screen_shmem_id_mapped = 0;
}
}
if (amod->screen_shmem_pixels != 0)
{
bmpdata = amod->screen_shmem_pixels + shmem_offset;
@ -1249,6 +1262,19 @@ process_server_paint_rect_shmem_ex(struct mod *amod, struct stream *s)
amod->screen_shmem_id_mapped = 1;
}
}
else if (amod->screen_shmem_id != shmem_id)
{
amod->screen_shmem_id = shmem_id;
g_shmdt(amod->screen_shmem_pixels);
amod->screen_shmem_pixels = (char *) g_shmat(amod->screen_shmem_id);
if (amod->screen_shmem_pixels == (void*)-1)
{
/* failed */
amod->screen_shmem_id = 0;
amod->screen_shmem_pixels = 0;
amod->screen_shmem_id_mapped = 0;
}
}
if (amod->screen_shmem_pixels != 0)
{
bmpdata = amod->screen_shmem_pixels + shmem_offset;