Merge pull request #1439 from jsorg71/xup_shm_fix
xup: fix for when shmem_id changes
This commit is contained in:
commit
8e10f0820c
26
xup/xup.c
26
xup/xup.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user