Skip to content

Commit

Permalink
work on multimon
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Dec 6, 2023
1 parent 94a7c7c commit 28b4dbe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
17 changes: 16 additions & 1 deletion xorgxrdp_helper/xorgxrdp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ gfx_wiretosurface1(struct xorgxrdp_info *xi, struct stream *s)

cdata_bytes = GFX_MAP_SIZE;
rv = xorgxrdp_helper_x11_encode_pixmap(left, top,
width, height, 0,
width, height, surface_id,
num_rects_c, crects,
addr, &cdata_bytes);
LOG_DEVEL(LOG_LEVEL_INFO, "gfx_wiretosurface1: rv %d cdata_bytes %d",
Expand Down Expand Up @@ -244,6 +244,11 @@ xorg_process_message_62(struct xorgxrdp_info *xi, struct stream *s)
return 1;
}
break;
case 0x000E: /* XR_RDPGFX_CMDID_RESETGRAPHICS */
xrdp_invalidate = 1;
LOG(LOG_LEVEL_INFO, "xorg_process_message_62: "
"XR_RDPGFX_CMDID_RESETGRAPHICS detected");
break;
}
/* setup for next cmd */
s->p = holdp + cmd_bytes;
Expand Down Expand Up @@ -488,6 +493,7 @@ xorg_process_message(struct xorgxrdp_info *xi, struct stream *s)
int size;
int index;
char *phold;
char *endhold;
int width;
int height;
int magic;
Expand All @@ -506,31 +512,40 @@ xorg_process_message(struct xorgxrdp_info *xi, struct stream *s)
phold = s->p;
in_uint16_le(s, type);
in_uint16_le(s, size);
endhold = s->end;
s->end = phold + size;
switch (type)
{
case 62:
/* process_server_egfx_shmfd */
if (xorg_process_message_62(xi, s) != 0)
{
LOG(LOG_LEVEL_ERROR, "xorg_process_message: "
"xorg_process_message_62 failed");
return 1;
}
break;
case 63:
/* process_server_set_pointer_shmfd */
if (xorg_process_message_63(xi, s) != 0)
{
LOG(LOG_LEVEL_ERROR, "xorg_process_message: "
"xorg_process_message_63 failed");
return 1;
}
break;
case 64:
/* process_server_paint_rect_shmfd */
if (xorg_process_message_64(xi, s) != 0)
{
LOG(LOG_LEVEL_ERROR, "xorg_process_message: "
"xorg_process_message_64 failed");
return 1;
}
break;
}
s->p = phold + size;
s->end = endhold;
}
if (xi->resizing > 0)
{
Expand Down
10 changes: 6 additions & 4 deletions xrdp/xrdp_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,12 @@ out_RFX_AVC420_METABLOCK(struct xrdp_egfx_rect *dst_rect,
}
for (index = 0; index < num_rects; index++)
{
rect.left = MAX(dst_rect->x1, rects[index].x1 - 1);
rect.top = MAX(dst_rect->y1, rects[index].y1 - 1);
rect.right = MIN(dst_rect->x2, rects[index].x2 + 1);
rect.bottom = MIN(dst_rect->y2, rects[index].y2 + 1);
rect.left = MAX(0, rects[index].x1 - dst_rect->x1 - 1);
rect.top = MAX(0, rects[index].y1 - dst_rect->y1 - 1);
rect.right = MIN(dst_rect->x2 - dst_rect->x1,
rects[index].x2 - dst_rect->x1 + 1);
rect.bottom = MIN(dst_rect->y2 - dst_rect->y1,
rects[index].y2 - dst_rect->y1 + 1);
xrdp_region_add_rect(reg, &rect);
}
index = 0;
Expand Down
2 changes: 1 addition & 1 deletion xrdp/xrdp_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ xrdp_mm_egfx_caps_advertise(void *user, int caps_count,
ver_flags[index].version = versions[index];
ver_flags[index].flags = flagss[index];
}
/* sort by versiion */
/* sort by version */
g_qsort(ver_flags, caps_count, sizeof(struct ver_flags_t), cmpverfunc);
best_index = -1;
best_h264_index = -1;
Expand Down

0 comments on commit 28b4dbe

Please sign in to comment.