xup: fix for when shmem_id changes
This commit is contained in:
parent
8853809310
commit
e52a4fd0ae
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;
|
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)
|
if (amod->screen_shmem_pixels != 0)
|
||||||
{
|
{
|
||||||
bmpdata = amod->screen_shmem_pixels + shmem_offset;
|
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;
|
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)
|
if (amod->screen_shmem_pixels != 0)
|
||||||
{
|
{
|
||||||
bmpdata = amod->screen_shmem_pixels + shmem_offset;
|
bmpdata = amod->screen_shmem_pixels + shmem_offset;
|
||||||
|
Loading…
Reference in New Issue
Block a user