Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

UltraVNC 1.2.2.1 - Download links

Post Reply
Thomas Levering
40
40
Posts: 84
Joined: 2015-01-23 06:45

Re: Release 1.2.2.1

Post by Thomas Levering »

add
&& (m_encoder != NULL)

:D

Code: Select all

vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
{
	if (m_scrinfo.format.bitsPerPixel!=32 && encoding==rfbEncodingUltra2)
	{
		//This is not supported, jpeg require 32bit buffers
		//to avoif a server crash we switch to zrle encoding
		//hextile is better as u2 replacement
		encoding = rfbEncodingHextile;
	}

	if ((encoding == m_encoding) && (m_encoder != NULL))
		return TRUE;
	if (reinitialize)
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

Next test

change
uvnckeyboardhelper only used on win8: New version detection code works without manifest
uvnckeyboardhelper can be enable/disabled from option menu server
function call protection ubvnckeyboardhelper calls changed by some own checker, using multiple therads it wasn't working 100%
Some NULL pointer crash fixed
homas crash fix

svn_1133

https://www.uvnc.eu/download/1222/winvn_svn1133.zip
Thomas Levering
40
40
Posts: 84
Joined: 2015-01-23 06:45

Re: Release 1.2.2.1

Post by Thomas Levering »

Good Job :P

Tested: WindowsXP, Windows7x64, Windows10x64, Windows7Embeddedx86
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

Hi,

Edit: With 1133 the Initial Screen is no longer black when second Monitor is on the right, great!

I still have the Problem, that with ddegine64.dll, the secondary Screen is always black, no matter which side of the main Monitor it is.

The mouse also does not work correctly when secondary Monitor is on the left of Main monitor.

Also, in debug mode, I only see updates from ddengine for main Monitor no matter where it is.

My Server is win 10 professional.

Regrads,
Chrispy
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

Anything special in the dual monitor setup, it isn't something general

Test server:
win10 with 2 displays
1 x intel
1 x nvidia
Standard we test with a screen connected to each video card.
I also tested with 2 screens conneected to the nvidia.

Your setup
[prim] [sec]
You test and only see prim, pressing the screenswitch button you get follwoing 3 states: prim, black, prim+black
The you just select the other screen as prim in the screensettings
[sec][prim]
You test and only see the prim ? The primary is the screen that was black in the first test ?


I can pass the ddengine64.dll debug version.
Then you see the detection and rects in in the ddengine. The output also goes the the debugger output window.
I also have some little test util that run independed of vnc
showing screen changes in his console
screen 0 rect a,b,c,d
screen 1 rect a,b,c,d
...
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

Thanks for the reply

Test System:
win 10 Prof
1 NVIDIA Quadro K600 with 2 Monitors (1280x1024,1280x1024)
shared graphic Memory 9193 MB, Dedicated 1024 MB, Video Memory 0

[prim][sec]
1280x1024 Monitor[0] - xoffset=0,updates correct, mouse correct
1280x1024 Monitor[1] - xoffset=1280, Always black, mouse events correct
2560x1024 Monitor[3] - xoffset=0, right side black, left side correct with updates, mouse correct

[sec][prim]
1280x1024 Monitor[0] - xoffset=0, black Initial update, no update with refresh, mouse correct
1280x1024 Monitor[1] - xoffset=-1280, Always black, mouse events on prim and no update rects from ddengine
2560x1024 Monitor[3] - xoffset=-1280, Left side black, right side correct with updates, mouse on right not seen, mouse on left Show on prim Monitor

I would be happy to test with your debug ddengine64.dll (using vc2017 debug redist?)

My main concern right now is [sec][prim].

On the real System the secondary Monitor will be 4k. Can you handle that? The old mirror Driver under win 7 could not.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
Skyfighter
40
40
Posts: 127
Joined: 2014-12-31 22:10

Re: Release 1.2.2.1

Post by Skyfighter »

short test of svn1133:
- win10: perfect - all good (no InitialDelay!)
- win8.1 + EnableWin8Helper=0: perfect - all good (no InitialDelay!)
- win8.1 + EnableWin8Helper=1: seems to be stable -> good! ...but ALT+TAB and WIN+X does not work **1

**1 With EnableWin8Helper=1 there is a delay while connecting (viewer side) and I can see that uvnckeyboardhelper.exe is loaded (server side)...but vnckeyboardhelper.exe vanishes (after ~1-2 seconds) before the viewer shows the initial screen of the remote machine. (The Helper doesn't come back even after some minutes.)

UltraVNC.ini: Default setting of the new parameter seems to be EnableWin8Helper=0 -> shouldn't it be enabled by default? (because your os-check doesn't load/use it if os <> Win8.x)

Thank you very much for your efforts, Rudi!
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

All, thanks for the feedback...

Gonna try to test vnckeyboardhelper.exe again.
1° needed to be signed (ok exe is signed)
2° needed to be installed in a secure location ( like program files) with an installer... unzipping from network location doesn't set
the correct file permissions.
3° calling application need to have elevated admin access ( OK: service)
Never understood why MS made a simple alt-tab so difficult to inject in windows 8

And prepare some test app for multiple screens.

I didn't activated it by default because you only need it for a few special keys, and you get a timeout
when unvckeyboardhelper fail to start correct. It's better to set the fastest method out of the box.

I don't have a 4k for testing... but don't expect 25FPS with a video
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

I don't need video on 4k, just faster refresh with "mirror" driver like functionality. The mirror driver for win 7 doesn't load when it encounters a 4k Screen.

If you make some little test app for win 10, I will be happy to use it and share the results.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
Skyfighter
40
40
Posts: 127
Joined: 2014-12-31 22:10

Re: Release 1.2.2.1

Post by Skyfighter »

I didn't activated it by default because you only need it for a few special keys, and you get a timeout
when unvckeyboardhelper fail to start correct. It's better to set the fastest method out of the box.
Makes sense :thumbs:
On the real System the secondary Monitor will be 4k. Can you handle that? The old mirror Driver under win 7 could not.
I'm using a 4K Monitor (with 150% scaling; Nvidia 1030) under Win10-1703 and remote control that machine using uvnc on regular basis -> works flawless and with ddengine it is fast - nothing to complain about. (Did not compare the perfomance of uvnc with teamviewer, ammyy, ...)
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

works flawless and with ddengine it is fast
Thanks for the info. That's what I am counting on, now I just Need the Multi-Monitor [sec][prim] to work, and I am good to go.

Of course, I will also help you test the [prim][sec] to get it working too.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

ddengine64 debug
https://www.uvnc.eu/download/1222/ddengine64.zip

debug output
ddengine BLIT apdaper %i monitor %i left=%i + %i top=%i right=%i bottom=%i
adapter = video card
monitor = nr connected monitor
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

thanks
I will try it at home too. There I have NVIDIA Geforce GTX 1060 6GB with three Monitors (3x 1920x1080) that has the same Problems with the black screens.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

change for win8 only, other versions don't use it.

https://www.uvnc.eu/download/1222/winvnc_svn1136.zip

*uvnckeyboardhelper.exe en uvnc need to get in sync, timing was set a little to critical, and often they didn't found each other.
Then after a wait time it continue. Wait is 5 seconds, but normal helper and vnc should find each other in a sec.

I was only able to test the connection on a win8 (hyper-v), don'ty have any real win8 system.

You need to download the zip and then copy from the zip on the local disk... don't copy from the extractde zip
insite the browser, it add a unsecure bit.
Skyfighter
40
40
Posts: 127
Joined: 2014-12-31 22:10

Re: Release 1.2.2.1

Post by Skyfighter »

test of svn1136 (winvnc.exe running as a service; vncviewer.exe @Win10x64-1703; connection encrypted using SecureVNCPlugin64.dsm):
1) win10 + EnableWin8Helper=0: perfect - all good (no InitialDelay!)
1) win10 + EnableWin8Helper=1: perfect - all good (no InitialDelay!)
3) win8.1 + EnableWin8Helper=0: perfect - all good (no InitialDelay!)
4) win8.1 + EnableWin8Helper=1: stable, InitialDelay is there but seems to be improved (2-3 seconds), ALT+TAB and WIN+X working as expected ==> Great improvement! :thumbs: (...but look below, found something...)

regarding 4): If you lock the workstation while connected using uvnc **1** (and do not close the viewer) [alternative way: power-management "display off"-feature kicks in]
- one time [can't replicate it] I couldn't enter the user password (had to go to the user-overview of the login screen using the back-arrow on the screen, viewer auto-reconnect, reselect previous logged on user, was able to enter the password + login, viewer auto-reconnect...and was back on remote-pc's desktop + everything working as expected.)
- 100% replicateable: after entering user password (unlock remote pc/re-login the user) keyboardhelper.exe is gone...it comes back after 5-10 seconds but vanishes again after 1-2 seconds and then it stays away...from now on the screen updates on the viewer side are extremely sluggish; a manual screen refresh on the viewer side doesn't help to recover (on the other hand: both winvnc.exe processes on the server side do not crash = keep running). Close the viewer, wait a few seconds, reconnect to remote-pc: connection needs a little more time (~5 seconds) but works and sluggish screen updates are gone (= fast again); keyboardhelper is back, too. But there is something highly questionable going on: if you now press ALT+TAB (on the viewer side or the server side - doesn't matter)...on the server side the task-switch overview stays open (the menu normally only stays open if you keep pressing ALT)!? You can close it with ESC which brings up the start menu, click somewhere on the desktop to close the start menu and repeat this over-and-over again using ALT+TAB again. :what?: ...to stop this "ghosting" press CTRL once everything is back to normal (now ALT+TAB works as expected = task switch menu automaticalle closes).

**1**If you lock the remote-pc while you are not connected using uvnc...connecting to the remote-pc while it is locked and then log in: everything works flawless (including ALT+TAB).

(To test the lock workstation thing I'd recommend creating a shortcut "rundll32.exe user32.dll, LockWorkStation".)

Thank you very much, Rudi!
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

Thanks for the feedback and the howto repeat it.

R.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

look like user lock/unlock is fixed.
It take a few seconds to get back to full speed but no more reconnect is needed.

https://www.uvnc.eu/download/1222/winvnc_svn1137.zip

The cntr alt shift down keys can happen when you press down in the viewer and up outsite.
This way you only transmit down to server...You need to press the key again to unlock.
Skyfighter
40
40
Posts: 127
Joined: 2014-12-31 22:10

Re: Release 1.2.2.1

Post by Skyfighter »

Only a short test under Win8.1 but I couldn't provoke any keyboardhelper-hickups anymore. Well done, Rudi! :thumbs:
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

Hi,

Here the URL for the results from debug ddengine64.dll.

http://www.resource-solutions.de/ultra/ ... ecPrim.txt

[sec][prim]
Secondary is running Process Explorer, so -1280 to 0 (0-1280) for updates
Primary, vc 2017 with ddengine64.dll in Output window , so 0 - 1280 (1280-2560) for updates

Hope this helps.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

Looks like the ddenfine just doesn't see the second monitor...
Normal, updates of the sec should be showing as "ddengine BLIT apdaper 0 monitor 1"

The blit engine capture each monitor seperate and place it in the output buffer.

Code: Select all

ddengine BLIT apdaper 0 monitor 0  left=754 + 1280 top=821  right=2536 bottom=83
We copy data from prim ( monitor0) to screen buffer at position (1280+754,821)
This is correct, the sec is normal copied at startpos (0,0)
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

Thanks

Can you do anything about it seeing monitor 1? It doesn't seem to matter which side or coordinates it has.

What function are you using to get the Monitors?

Monitor 0 is DVI, Monitor 1 is Display Port

This sample for desktop duplication finds the monitors:

https://code.msdn.microsoft.com/windows ... e-da4c696a

I compiled it for VC2017/2015 and it runs on my win 10.

Hope that helps.

It looks like your ddengine source is not open, if I am wrong, I would be willing to debug it to see why it does not find monitor 1 for you, otherwise we can keep doing it this way with debug output.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

Looks like i found it
Debug code !ç"§'è!ç&é§'&ç§
//return nr_monitors;
return 1;

With change 2 monitors on the same video card are also detected

Initialize MonitorManager
Initialize DesktopManager for adapter 0
adapter->EnumOutputs( 0, &output);
adapter->EnumOutputs( 1, &output);
Found 2 monitors
Initialize monitor 0 for adapter 0
Initialize monitor 1 for adapter 0

downloads 1222 now has the updated ddengine
http://forum.ultravnc.info/viewtopic.php?f=72&t=34021
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

Fantastic, will test it first thing tomorrow morning!!!
You realize, my system at home has 3 monitors on the same graphic card?
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

The ddengine wil works with any number of monitors, but i don't know if vnc is able to switch to the third.

There is a performance issue.
2 monitors on 2 cards capture simultaneous
2 monitors the same card need to be captured one by one.
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

We must also remember secondary 4k, prim hd.
It must be only faster than polling!
Any help you need, I am there.
I have programmed over 30 years in c++ in windows and vc, so use me!
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

New test results from 1222

Test System:
win 10 Prof
1 NVIDIA Quadro K600 with 2 Monitors (1280x1024,1280x1024)
shared graphic Memory 9193 MB, Dedicated 1024 MB, Video Memory 0

[sec][prim]
1280x1024 Monitor[0] - xoffset=0, updates from secondary monitor, mouse correct
1280x1024 Monitor[1] - xoffset=-1280, Initial Screen correct, mouse events on prim and no updates
2560x1024 Monitor[3] - xoffset=-1280, left side correct with updates, right side correct with updates, mouse on right not seen, mouse on left Show on prim Monitor
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

Yes, i can use some help.. :)
Doing all programming alone... after hours... for several years.
Time is limited and can test all.

Will pm you, first need to check with customer if i can give you the ddengine code for cross checking.
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

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)
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Chrispy
40
40
Posts: 103
Joined: 2018-07-11 09:06
Contact:

Re: Release 1.2.2.1

Post by Chrispy »

vncclient.cpp line ~3366

Code: Select all

if (m_client->Sendinput.isValid())
{							
  INPUT evt;
  evt.type = INPUT_MOUSE;
  //int xx=msg.pe.x-GetSystemMetrics(SM_XVIRTUALSCREEN)+ (m_client->monitor_Offsetx+m_client->m_ScreenOffsetx);
  int xx = msg.pe.x + m_client->monitor_Offsetx;// <=<=<=
...
Mouse works in win 10 for [prim][sec] and [sec][prim] with the code Change above, plus the changes from before.

This code does not work in non-capture mode, but the commented out line works then.

Could do?

Code: Select all

int xx=msg.pe.x-GetSystemMetrics(SM_XVIRTUALSCREEN)+ (m_client->monitor_Offsetx+m_client->m_ScreenOffsetx);
if(m_server->Driver())
   xx = msg.pe.x + m_client->monitor_Offsetx;
Ok, this works now for win 7 (mirror)/10 (DeskDup) and win 7 polling.
Opc Servers: http://www.wowbms.com/index.php/opc-servers
Wow Building & Energy Management System: http://www.wowbms.com/index.php
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6863
Joined: 2004-04-23 10:21
Contact:

Re: Release 1.2.2.1

Post by Rudi De Vos »

You can also have a monitor top/bottom
Then the same should also fix it for yy

Code: Select all

if(m_server->Driver()) {
										xx = msg.pe.x + m_client->monitor_Offsetx;
										yy = msg.pe.y + m_client->monitor_Offsety;
								}
Post Reply