magnifier: use global.get_pointer instead of gdk_window_get_pointer
(qv https://bugzilla.gnome.org/show_bug.cgi?id=597292) https://bugzilla.gnome.org/show_bug.cgi?id=618915
This commit is contained in:
parent
b02089c435
commit
5de1a15d98
@ -80,8 +80,7 @@ Magnifier.prototype = {
|
|||||||
|
|
||||||
// Create the first ZoomRegion and initialize it according to the
|
// Create the first ZoomRegion and initialize it according to the
|
||||||
// magnification GConf settings.
|
// magnification GConf settings.
|
||||||
let [objUnder, xMouse, yMouse, mask] =
|
let [xMouse, yMouse, mask] = global.get_pointer();
|
||||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
|
||||||
let aZoomRegion = new ZoomRegion(this, this._cursorRoot);
|
let aZoomRegion = new ZoomRegion(this, this._cursorRoot);
|
||||||
this._zoomRegions.push(aZoomRegion);
|
this._zoomRegions.push(aZoomRegion);
|
||||||
let showAtLaunch = this._gConfInit(aZoomRegion);
|
let showAtLaunch = this._gConfInit(aZoomRegion);
|
||||||
@ -187,8 +186,7 @@ Magnifier.prototype = {
|
|||||||
* @return true.
|
* @return true.
|
||||||
*/
|
*/
|
||||||
scrollToMousePos: function(prevCoord) {
|
scrollToMousePos: function(prevCoord) {
|
||||||
let [objUnder, xMouse, yMouse, mask] =
|
let [xMouse, yMouse, mask] = global.get_pointer();
|
||||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
|
||||||
|
|
||||||
if (!prevCoord || prevCoord.x != xMouse || prevCoord.y != yMouse) {
|
if (!prevCoord || prevCoord.x != xMouse || prevCoord.y != yMouse) {
|
||||||
let sysMouseOverAny = false;
|
let sysMouseOverAny = false;
|
||||||
@ -962,8 +960,7 @@ ZoomRegion.prototype = {
|
|||||||
* @return: Whether the system mouse pointer is over the magnified view.
|
* @return: Whether the system mouse pointer is over the magnified view.
|
||||||
*/
|
*/
|
||||||
scrollToMousePos: function() {
|
scrollToMousePos: function() {
|
||||||
let [objUnder, xMouse, yMouse, mask] =
|
let [xMouse, yMouse, mask] = global.get_pointer();
|
||||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
|
||||||
|
|
||||||
if (this._mouseTrackingMode == MouseTrackingMode.PROPORTIONAL) {
|
if (this._mouseTrackingMode == MouseTrackingMode.PROPORTIONAL) {
|
||||||
this._setROIProportional(xMouse, yMouse);
|
this._setROIProportional(xMouse, yMouse);
|
||||||
@ -1055,8 +1052,7 @@ ZoomRegion.prototype = {
|
|||||||
let mouseIsOver = false;
|
let mouseIsOver = false;
|
||||||
if (this.isActive()) {
|
if (this.isActive()) {
|
||||||
if (!xMouse || !yMouse) {
|
if (!xMouse || !yMouse) {
|
||||||
let [objUnder, x, y, mask] =
|
let [x, y, mask] = global.get_pointer();
|
||||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
|
||||||
xMouse = x;
|
xMouse = x;
|
||||||
yMouse = y;
|
yMouse = y;
|
||||||
}
|
}
|
||||||
@ -1174,8 +1170,7 @@ ZoomRegion.prototype = {
|
|||||||
x = parseInt(x.toFixed(1));
|
x = parseInt(x.toFixed(1));
|
||||||
y = parseInt(y.toFixed(1));
|
y = parseInt(y.toFixed(1));
|
||||||
let [xCenterMagView, yCenterMagView] = this.getCenter();
|
let [xCenterMagView, yCenterMagView] = this.getCenter();
|
||||||
let [objUnder, xMouse, yMouse, mask] =
|
let [xMouse, yMouse, mask] = global.get_pointer();
|
||||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
|
||||||
let [xMagFactor, yMagFactor] = this.getMagFactor();
|
let [xMagFactor, yMagFactor] = this.getMagFactor();
|
||||||
|
|
||||||
let xMagMouse = xMouse * xMagFactor + x;
|
let xMagMouse = xMouse * xMagFactor + x;
|
||||||
|
Loading…
Reference in New Issue
Block a user