1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-20 18:23:21 +00:00

Fixed behavior so when resolution change is detected, it will event the new resolution, and throw out the current CRC buffer, and re-init with the new resolution. This fixes issues on distros that had problems with KVM from login screen transition to logged in user.

This commit is contained in:
Bryan Roe
2021-09-09 17:54:54 -07:00
parent 5fd8d5fd3c
commit e959511d89

View File

@@ -999,8 +999,28 @@ void* kvm_server_mainloop(void* parm)
//fprintf(logFile, "After CheckDesktopSwitch.\n"); fflush(logFile); //fprintf(logFile, "After CheckDesktopSwitch.\n"); fflush(logFile);
imagedisplay = x11_exports->XOpenDisplay(CURRENT_XDISPLAY); imagedisplay = x11_exports->XOpenDisplay(CURRENT_XDISPLAY);
if (imagedisplay == NULL) { g_shutdown = 1; break; } if (imagedisplay == NULL) { g_shutdown = 1; break; }
if (DisplayWidth(imagedisplay, CURRENT_DISPLAY_ID) != SCREEN_WIDTH ||
DisplayHeight(imagedisplay, CURRENT_DISPLAY_ID) != SCREEN_HEIGHT ||
DefaultDepth(eventdisplay, CURRENT_DISPLAY_ID) != SCREEN_DEPTH)
{
int old = TILE_HEIGHT_COUNT;
SCREEN_HEIGHT = DisplayHeight(imagedisplay, CURRENT_DISPLAY_ID);
SCREEN_WIDTH = DisplayWidth(imagedisplay, CURRENT_DISPLAY_ID);
SCREEN_DEPTH = DefaultDepth(imagedisplay, CURRENT_DISPLAY_ID);
if (logFile) { fprintf(logFile, "SLAVE/KVM Resolution Changed: %d x %d x %d bpp\n", SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH); fflush(logFile); }
TILE_HEIGHT_COUNT = SCREEN_HEIGHT / TILE_HEIGHT;
TILE_WIDTH_COUNT = SCREEN_WIDTH / TILE_WIDTH;
if (SCREEN_WIDTH % TILE_WIDTH) { TILE_WIDTH_COUNT++; }
if (SCREEN_HEIGHT % TILE_HEIGHT) { TILE_HEIGHT_COUNT++; }
kvm_send_resolution();
reset_tile_info(old);
}
FD_ZERO(&readset); FD_ZERO(&readset);
FD_ZERO(&errorset); FD_ZERO(&errorset);
FD_ZERO(&writeset); FD_ZERO(&writeset);