Fixed following mouse cursor when keyboard is shown

This commit is contained in:
Sergii Pylypenko
2014-12-26 23:24:22 +02:00
parent 934f3981a9
commit 50a6d7e253
7 changed files with 128 additions and 78 deletions

View File

@@ -353,23 +353,21 @@ public class MainActivity extends Activity
DimSystemStatusBar.get().dim(_videoLayout);
DimSystemStatusBar.get().dim(mGLView);
if( Globals.ScreenFollowsMouse )
Rect r = new Rect();
_videoLayout.getWindowVisibleDisplayFrame(r);
mGLView.nativeScreenVisibleRect(r.left, r.top, r.right, r.bottom);
_videoLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
{
Rect r = new Rect();
_videoLayout.getWindowVisibleDisplayFrame(r);
mGLView.nativeScreenVisibleRect(r.left, r.top, r.right, r.bottom);
_videoLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
public void onGlobalLayout()
{
public void onGlobalLayout()
{
Rect r = new Rect();
_videoLayout.getWindowVisibleDisplayFrame(r);
int heightDiff = _videoLayout.getRootView().getHeight() - _videoLayout.getHeight(); // Take system bar into consideration
mGLView.nativeScreenVisibleRect(r.left, r.top + heightDiff, r.width(), r.height());
Log.v("SDL", "Main window visible region changed: " + r.left + ":" + r.top + ":" + r.width() + ":" + r.height() );
}
});
}
Rect r = new Rect();
_videoLayout.getWindowVisibleDisplayFrame(r);
int heightDiff = _videoLayout.getRootView().getHeight() - _videoLayout.getHeight(); // Take system bar into consideration
int widthDiff = _videoLayout.getRootView().getWidth() - _videoLayout.getWidth(); // Nexus 5 has system bar at the right side
mGLView.nativeScreenVisibleRect(r.left + widthDiff, r.top + heightDiff, r.width(), r.height());
Log.v("SDL", "Main window visible region changed: " + r.left + ":" + r.top + ":" + r.width() + ":" + r.height() );
}
});
}
@Override