Re: spice-html5 cursor positioning problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't know about performance issues but I would suggest to calculate the pointer position relative to the canvas like this:

   var rect = sc.display.surfaces[sc.display.primary_surface].canvas.getBoundingClientRect();
   this.x = e.clientX - rect.left;
   this.y = e.clientY - rect.top;

I don't think I had any special reason for the method I used; I am not especially a viewport/css/javascript expert, so what the code uses is mostly the result of my trial and error efforts.

So, it sounds worthwhile to me. (My only requirement is that any change retain support for Firefox, Chrome,and IE).

I'm not sure how SpiceMsgcMouseMotion would be changed since it takes the distance from the offsetParent into account but not any scrolling.
In my tests I couldn't observe that function running (sc.mouse_mode == SPICE_MOUSE_MODE_CLIENT every time I checked). Can someone explain briefly or point me to an explanation about mouse modes and when they are used?

I also no longer recall the origins of that else code. I do know that the spice-html5 client responds to any change in the mouse mode with a request to use mouse mode client, so the expectation is that the spice-html5 client will always operate in client mode.

I imagine it would be easy to test; in the v2 patch I've just pushed, main.js, the new function, handle_mouse_mode, just invert the client/server logic there. That should force the client into 'server' mouse mode.

Cheers,

Jeremy
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]