Skip to content

Commit

Permalink
Add WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR to fix cursor …
Browse files Browse the repository at this point in the history
…position on small screen devices
  • Loading branch information
Xtr126 committed Oct 5, 2024
1 parent 7c7e970 commit f4670d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/java/xtr/keymapper/TouchPointer.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public void enablePointer() {
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |
WindowManager.LayoutParams.FLAG_FULLSCREEN |
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN |
WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR |
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
// Make the underlying application window visible
// through the cursor
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/xtr/keymapper/server/RemoteService.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void addCursorView() {
PixelFormat.TRANSLUCENT);
try {
windowManager.addView(cursorView, params);
} catch (IllegalStateException e) {
} catch (IllegalStateException e) { // A14 QPR3 https://gist.github.com/RikkaW/be3fe4178903702c54ec73b2fc1187fe
Log.e(TAG, e.getMessage(), e);
cursorView = null;
}
Expand All @@ -147,6 +147,9 @@ public static void loadLibraries() {
System.loadLibrary("touchpad_relative");
}

/**
* Executes getevent command and processes the output
*/
void start_getevent() {
new Thread(() -> {
try {
Expand Down

0 comments on commit f4670d8

Please sign in to comment.