The following changes I made to get the below results ( I:/UltraVNC/UltraVNC_src_1221 are my changes):
[sec][prim]
1280x1024 Monitor[0] - xoffset=0, Initial and updates correct, mouse not correct
1280x1024 Monitor[1] - xoffset=-1280, Initial and updates correct, mouse correct
2560x1024 Monitor[3] - xoffset=-1280, left side correct with updates, right side correct with updates, mouse on right correct, mouse on left correct
[prim][sec]
1280x1024 Monitor[0] - xoffset=0, Initial and updates correct, mouse correct
1280x1024 Monitor[1] - xoffset=1280, Initial and updates correct, mouse not correct
2560x1024 Monitor[3] - xoffset=0, right and left side correct with updates, mouse left side Shows on secondary Monitor, no mouse on right at all
So, you can see the mouse is the only Problem now.
Code: Select all
*** I:/UltraVNC/UltraVNC_src_1221/winvnc/winvnc/vncdesktop.cpp Fri Jul 27 13:09:35 2018
--- D:/install/ultravnc/ultravnc_src_1221/ultravnc-code-r1127/UltraVNC Project Root/UltraVNC/winvnc/winvnc/vncdesktop.cpp Wed Jun 06 20:07:27 2018
***************
*** 1450,1465 ****
}
DWORD
vncDesktop::Init(vncServer *server)
{
vnclog.Print(LL_INTINFO, VNCLOG("initialising desktop handler\n"));
- m_bFirstInit = true;
-
// Save the server pointer
m_server = server;
// Load in the arrow cursor
m_hdefcursor = LoadCursor(NULL, IDC_ARROW);
m_hcursor = m_hdefcursor;
m_hOldcursor = m_hdefcursor; //sf@2002
--- 1448,1461 ----
*** I:/UltraVNC/UltraVNC_src_1221/winvnc/winvnc/vncdesktop.h Fri Jul 27 13:09:35 2018
--- D:/install/ultravnc/ultravnc_src_1221/ultravnc-code-r1127/UltraVNC Project Root/UltraVNC/winvnc/winvnc/vncdesktop.h Wed Jun 06 20:07:27 2018
***************
*** 252,266 ****
friend class vncDesktopThread;
friend LRESULT CALLBACK DesktopWndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
// Create/Destroy methods
vncDesktop();
~vncDesktop();
- bool m_bFirstInit;
DWORD Init(vncServer *pSrv);
// Tell the desktop hooks to grab & update a particular rectangle
void UpdateFullScreen();
// Kick the desktop hooks to perform an update
void TriggerUpdate();
--- 252,265 ----
*** I:/UltraVNC/UltraVNC_src_1221/winvnc/winvnc/vncDesktopSW.cpp Fri Jul 27 14:41:34 2018
--- D:/install/ultravnc/ultravnc_src_1221/ultravnc-code-r1127/UltraVNC Project Root/UltraVNC/winvnc/winvnc/vncDesktopSW.cpp Mon May 28 21:35:34 2018
***************
*** 114,141 ****
m_ScreenOffsetx = mymonitor[3].offsetx;
m_ScreenOffsety = mymonitor[3].offsety;
if (!show_multi_monitors) {
m_ScreenOffsetx = mymonitor[0].offsetx;
m_ScreenOffsety = mymonitor[0].offsety;
}
m_bmrect = rfb::Rect(offesetx, offsety, width, height);
! //m_bmrect = rfb::Rect(0, 0, width, height);
! m_SWOffsetx = m_ScreenOffsetx-mymonitor[3].offsetx;// m_bmrect.tl.x;
! m_SWOffsety = m_ScreenOffsety - mymonitor[3].offsety;//m_bmrect.tl.y;
m_Cliprect.tl.x = 0;
m_Cliprect.tl.y = 0;
m_Cliprect.br.x = m_bmrect.br.x;
m_Cliprect.br.y = m_bmrect.br.y;
if (m_screenCapture && (m_current_monitor == MULTI_MON_PRIMARY || m_current_monitor == MULTI_MON_SECOND || m_current_monitor == MULTI_MON_THIRD)) {
int mon = m_current_monitor -1;
! /*m_Cliprect.tl.x = mymonitor[mon].offsetx;
m_Cliprect.tl.y = mymonitor[mon].offsety;
m_Cliprect.br.x = mymonitor[mon].offsetx + mymonitor[mon].Width;
! m_Cliprect.br.y = mymonitor[mon].offsety + mymonitor[mon].Height;*/
!
! m_Cliprect.tl.x = mymonitor[mon].offsetx - mymonitor[3].offsetx;
! m_Cliprect.tl.y =mymonitor[mon].offsety - mymonitor[3].offsety;
! m_Cliprect.br.x = mymonitor[mon].offsetx +mymonitor[mon].Width - mymonitor[3].offsetx;
! m_Cliprect.br.y = mymonitor[mon].offsety + mymonitor[mon].Height - mymonitor[3].offsety;
}
}
--- 114,135 ----
m_ScreenOffsetx = mymonitor[3].offsetx;
m_ScreenOffsety = mymonitor[3].offsety;
if (!show_multi_monitors) {
m_ScreenOffsetx = mymonitor[0].offsetx;
m_ScreenOffsety = mymonitor[0].offsety;
}
m_bmrect = rfb::Rect(offesetx, offsety, width, height);
! m_SWOffsetx = m_bmrect.tl.x;
! m_SWOffsety = m_bmrect.tl.y;
m_Cliprect.tl.x = 0;
m_Cliprect.tl.y = 0;
m_Cliprect.br.x = m_bmrect.br.x;
m_Cliprect.br.y = m_bmrect.br.y;
if (m_screenCapture && (m_current_monitor == MULTI_MON_PRIMARY || m_current_monitor == MULTI_MON_SECOND || m_current_monitor == MULTI_MON_THIRD)) {
int mon = m_current_monitor -1;
! m_Cliprect.tl.x = mymonitor[mon].offsetx;
m_Cliprect.tl.y = mymonitor[mon].offsety;
m_Cliprect.br.x = mymonitor[mon].offsetx + mymonitor[mon].Width;
! m_Cliprect.br.y = mymonitor[mon].offsety + mymonitor[mon].Height;
}
}
*** I:/UltraVNC/UltraVNC_src_1221/winvnc/winvnc/vncdesktopthread.cpp Fri Jul 27 13:49:39 2018
--- D:/install/ultravnc/ultravnc_src_1221/ultravnc-code-r1127/UltraVNC Project Root/UltraVNC/winvnc/winvnc/vncdesktopthread.cpp Wed Jun 13 00:11:32 2018
***************
*** 462,490 ****
m_desktop->m_displaychanged = FALSE;
m_desktop->m_hookswitch = FALSE;
m_desktop->Hookdll_Changed = m_desktop->On_Off_hookdll; // Set the hooks again if necessary !
//****************************************************************************
//************* SCREEN SIZE CHANGED
//****************************************************************************
! if (screensize_changed || m_desktop->m_bFirstInit) {
vnclog.Print(LL_INTERR, VNCLOG("Size changed\n"));
POINT CursorPos;
GetCursorPos(&CursorPos);
CursorPos.x -= m_desktop->m_ScreenOffsetx;
CursorPos.y -= m_desktop->m_ScreenOffsety;
m_desktop->m_cursorpos.tl = CursorPos;
m_desktop->m_cursorpos.br = rfb::Point(GetSystemMetrics(SM_CXCURSOR),
GetSystemMetrics(SM_CYCURSOR)).translate(CursorPos);
m_server->SetBufferOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
// Adjust the UpdateTracker clip region
updates.set_clip_region(m_desktop->m_Cliprect);
m_desktop->m_buffer.ClearCache();
- m_desktop->m_bFirstInit = false;
- m_desktop->m_buffer.BlackBack();
}
// JnZn558
RECT rc = { 0 };
//
if (monitor_changed && m_desktop->m_screenCapture) {
// we are using the driver, so a monitor change is a view change, like a special kind of single window
--- 459,485 ----
m_desktop->m_displaychanged = FALSE;
m_desktop->m_hookswitch = FALSE;
m_desktop->Hookdll_Changed = m_desktop->On_Off_hookdll; // Set the hooks again if necessary !
//****************************************************************************
//************* SCREEN SIZE CHANGED
//****************************************************************************
! if (screensize_changed) {
vnclog.Print(LL_INTERR, VNCLOG("Size changed\n"));
POINT CursorPos;
GetCursorPos(&CursorPos);
CursorPos.x -= m_desktop->m_ScreenOffsetx;
CursorPos.y -= m_desktop->m_ScreenOffsety;
m_desktop->m_cursorpos.tl = CursorPos;
m_desktop->m_cursorpos.br = rfb::Point(GetSystemMetrics(SM_CXCURSOR),
GetSystemMetrics(SM_CYCURSOR)).translate(CursorPos);
m_server->SetBufferOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
// Adjust the UpdateTracker clip region
updates.set_clip_region(m_desktop->m_Cliprect);
m_desktop->m_buffer.ClearCache();
}
// JnZn558
RECT rc = { 0 };
//
if (monitor_changed && m_desktop->m_screenCapture) {
// we are using the driver, so a monitor change is a view change, like a special kind of single window
***************
*** 569,590 ****
int nCurrentMon = m_desktop->m_current_monitor - 1;
m_desktop->m_SWOffsetx=m_desktop->mymonitor[nCurrentMon].offsetx-m_desktop->mymonitor[3].offsetx;
m_desktop->m_SWOffsety=m_desktop->mymonitor[nCurrentMon].offsety-m_desktop->mymonitor[3].offsety;
m_server->SetBufferOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
! m_desktop->m_ScreenOffsetx = m_desktop->mymonitor[nCurrentMon].offsetx;// -m_desktop->mymonitor[3].offsetx;
! m_desktop->m_ScreenOffsety = m_desktop->mymonitor[nCurrentMon].offsety;// -m_desktop->mymonitor[3].offsety;
! m_server->SetScreenOffset(m_desktop->m_ScreenOffsetx, m_desktop->m_ScreenOffsety, m_desktop->nr_monitors);// no lock ok
!
! m_desktop->m_Cliprect.tl.x = m_desktop->mymonitor[nCurrentMon].offsetx-m_desktop->mymonitor[3].offsetx;
! m_desktop->m_Cliprect.tl.y = m_desktop->mymonitor[nCurrentMon].offsety-m_desktop->mymonitor[3].offsety;
! m_desktop->m_Cliprect.br.x = m_desktop->mymonitor[nCurrentMon].offsetx+m_desktop->mymonitor[nCurrentMon].Width-m_desktop->mymonitor[3].offsetx;
! m_desktop->m_Cliprect.br.y = m_desktop->mymonitor[nCurrentMon].offsety+m_desktop->mymonitor[nCurrentMon].Height-m_desktop->mymonitor[3].offsety;
rc.right = m_desktop->mymonitor[nCurrentMon].Width;
rc.bottom = m_desktop->mymonitor[nCurrentMon].Height;
vnclog.Print(LL_INTINFO, VNCLOG("Monitor %d: width = %d height = %d\n"), m_desktop->m_current_monitor, rc.right, rc.bottom);
}
--- 564,581 ----
int nCurrentMon = m_desktop->m_current_monitor - 1;
m_desktop->m_SWOffsetx=m_desktop->mymonitor[nCurrentMon].offsetx-m_desktop->mymonitor[3].offsetx;
m_desktop->m_SWOffsety=m_desktop->mymonitor[nCurrentMon].offsety-m_desktop->mymonitor[3].offsety;
m_server->SetBufferOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
! m_desktop->m_Cliprect.tl.x = m_desktop->mymonitor[nCurrentMon].offsetx;//-m_desktop->mymonitor[3].offsetx;
! m_desktop->m_Cliprect.tl.y = m_desktop->mymonitor[nCurrentMon].offsety;//-m_desktop->mymonitor[3].offsety;
! m_desktop->m_Cliprect.br.x = m_desktop->mymonitor[nCurrentMon].offsetx+m_desktop->mymonitor[nCurrentMon].Width;//-m_desktop->mymonitor[3].offsetx;
! m_desktop->m_Cliprect.br.y = m_desktop->mymonitor[nCurrentMon].offsety+m_desktop->mymonitor[nCurrentMon].Height;//-m_desktop->mymonitor[3].offsety;
rc.right = m_desktop->mymonitor[nCurrentMon].Width;
rc.bottom = m_desktop->mymonitor[nCurrentMon].Height;
vnclog.Print(LL_INTINFO, VNCLOG("Monitor %d: width = %d height = %d\n"), m_desktop->m_current_monitor, rc.right, rc.bottom);
}
ddengine works great now! (Will test on the weekend at home with 3 monitors)