mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-919: Restore CSS3 cursor-related code from GUAC-823 and GUAC-842.
This commit is contained in:
		| @@ -341,6 +341,16 @@ angular.module('client').directive('guacClient', [function guacClient() { | ||||
|                  * Handle mouse and touch events relative to the display element. | ||||
|                  */ | ||||
|  | ||||
|                 var localCursor = false; | ||||
|  | ||||
|                 // Ensure software cursor is shown | ||||
|                 guac.getDisplay().showCursor(true); | ||||
|  | ||||
|                 // Use local cursor if possible. | ||||
|                 guac.getDisplay().oncursor = function(canvas, x, y) { | ||||
|                     localCursor = mouse.setCursor(canvas, x, y); | ||||
|                 }; | ||||
|  | ||||
|                 // Touchscreen | ||||
|                 var touch_screen = new Guacamole.Mouse.Touchscreen(guac_display); | ||||
|                 $scope.touch_screen = touch_screen; | ||||
| @@ -353,6 +363,9 @@ angular.module('client').directive('guacClient', [function guacClient() { | ||||
|                 var mouse = new Guacamole.Mouse(guac_display); | ||||
|                 mouse.onmousedown = mouse.onmouseup = mouse.onmousemove = function(mouseState) { | ||||
|  | ||||
|                     // Hide software cursor if local cursor is in use | ||||
|                     guac.getDisplay().showCursor(!localCursor); | ||||
|  | ||||
|                     // Scale event by current scale | ||||
|                     var scaledState = new Guacamole.Mouse.State( | ||||
|                             mouseState.x / guac.getDisplay().getScale(), | ||||
| @@ -368,6 +381,11 @@ angular.module('client').directive('guacClient', [function guacClient() { | ||||
|  | ||||
|                 }; | ||||
|  | ||||
|                 // Hide software cursor when mouse leaves display | ||||
|                 mouse.onmouseout = function() { | ||||
|                     guac.getDisplay().showCursor(false); | ||||
|                 }; | ||||
|  | ||||
|                 // Hide any existing status notifications | ||||
|                 $scope.$emit('guacClientStatusChange', guac, null); | ||||
|                  | ||||
| @@ -377,8 +395,8 @@ angular.module('client').directive('guacClient', [function guacClient() { | ||||
|                 $display.html(""); | ||||
|  | ||||
|                 // Add client to UI | ||||
|                 guac.getDisplay().getElement().className = "software-cursor"; | ||||
|                 $display.append(guac.getDisplay().getElement()); | ||||
|                 guac_display.className = "software-cursor"; | ||||
|                 $display.append(guac_display); | ||||
|  | ||||
|             }; | ||||
|              | ||||
|   | ||||
		Reference in New Issue
	
	Block a user