termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.96k stars 301 forks source link

Keyboard Not Working #236

Closed ask9027 closed 1 year ago

ask9027 commented 1 year ago

in latest build #233 onBackPressed.

twaik commented 1 year ago

I checked it now. It works. onBackPressed asways was empty, back presses are dispatched in onKey.

ask9027 commented 1 year ago

here is short video about problem @twaik

https://user-images.githubusercontent.com/61283438/220872507-3200608f-314a-4c61-adb3-a66e9682008e.mp4

twaik commented 1 year ago

Post termux-info output.

ask9027 commented 1 year ago
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~uhTbAw14idvNdutaipH-9A==/com.termux-Z7j9ZKKMcgS5lv_oxjnt-Q==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=21738
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c74,c257,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c74,c257,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10330
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0+8421173
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0+8421173
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11/ x11 main
Updatable packages:
harfbuzz-icu/stable 7.0.1 aarch64 [upgradable from: 7.0.0]
harfbuzz/stable 7.0.1 aarch64 [upgradable from: 7.0.0]
pango/stable 1.50.13 aarch64 [upgradable from: 1.50.12]
unrar/stable 6.2.6 aarch64 [upgradable from: 6.2.5]
xwayland/x11 22.1.8 aarch64 [upgradable from: 1.20.5-16]
termux-tools version:
1.37.0
Android version:
12
Kernel build information:
Linux localhost 4.14.190-perf-g54a1ddf7276a #1 SMP PREEMPT Wed Jan 4 12:20:07 CST 2023 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
M2101K9AI
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
twaik commented 1 year ago

I see here no criminal. Can you get logcat of com.termux.x11? And can you please try to invoke Hacker's keyboard from it's notification?

ask9027 commented 1 year ago

Termux-x11 log when start termux-x11 &

java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml: open failed: ENOENT (No such file or directory)
        at libcore.io.IoBridge.open(IoBridge.java:574)
        at java.io.FileInputStream.<init>(FileInputStream.java:160)
        at java.io.FileInputStream.<init>(FileInputStream.java:115)
        at java.io.FileReader.<init>(FileReader.java:60)
        at miui.content.res.ThemeCompatibilityLoader.getVersion(ThemeCompatibilityLoader.java:108)
        at miui.content.res.ThemeCompatibilityLoader.getConfigDocumentTree(ThemeCompatibilityLoader.java:126)
        at miui.content.res.ThemeCompatibilityLoader.loadConfig(ThemeCompatibilityLoader.java:59)
        at miui.content.res.ThemeCompatibility.<clinit>(ThemeCompatibility.java:31)
        at miui.content.res.ThemeCompatibility.isThemeEnabled(ThemeCompatibility.java:111)
        at android.content.res.MiuiResourcesImpl.<clinit>(MiuiResourcesImpl.java:41)
        at android.content.res.MiuiResources.<init>(MiuiResources.java:58)
        at android.content.res.IMiuiResourceImpl.createResources(IMiuiResourceImpl.java:13)
        at android.content.res.ThemeManagerStub.createMiuiResources(ThemeManagerStub.java:56)
        at android.content.res.Resources.getSystem(Resources.java:235)
        at android.app.ActivityManager.isHighEndGfx(ActivityManager.java:1084)
        at android.view.ThreadedRenderer.initForSystemProcess(ThreadedRenderer.java:217)
        at android.app.ActivityThread.systemMain(ActivityThread.java:7901)
        at com.termux.x11.Loader.main(Loader.java:37)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:363)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
        at libcore.io.Linux.open(Native Method)
        at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
        at libcore.io.IoBridge.open(IoBridge.java:560)
        ... 19 more
res = 0
Activity is started
Got getWaylandFD
{ParcelFileDescriptor: java.io.FileDescriptor@aa287e5}
Lorie requested fd
Got getLogFD
{ParcelFileDescriptor: java.io.FileDescriptor@cb9d2ba}
Got finish request
App sent finishing command
Starting Xwayland

keyboard also not working with gboard.

ask9027 commented 1 year ago

I see here no criminal. Can you get logcat of com.termux.x11? And can you please try to invoke Hacker's keyboard from it's notification?

i dont have pc right now so i cant get logcat of termux-x11

ask9027 commented 1 year ago

here is the termux-x11 cat log Level Error 2023-02-23-17-15-35.txt 2023-02-23-17-16-49.txt

i hope this will help

twaik commented 1 year ago

Wow. I did not know there is a SIGSEGV. Thank you.

ask9027 commented 1 year ago

Wow. I did not know there is a SIGSEGV. Thank you.

🙏

Rhys-T commented 1 year ago

I'm having the same issue on a Samsung Tab S7+ running Android 13, after updating to the latest build (#281). Pressing the back button does nothing but make the device vibrate. If it helps, I can provide termux-info and logcat from my device too.

I tried the Hacker's Keyboard notification. Unfortunately, on this device, it always makes the keyboard flash open for a fraction of a second and then disappear again, unless I'm in something that 'should' accept keyboard input and would bring up the keyboard anyway, like the main Termux app or something. It has the same issue in Termux-X11. (I don't know if this is caused by changes in newer Android versions - HK hasn't been updated in a while, as far as I know - or by some of Samsung's customizations/One UI.)

Doing a binary search (and making sure to both install the .apk and apt install --reinstall the .deb each time), it looks like build #269 is the last one where the back button brings up the keyboard, and build #270 is the first one where it does nothing.

Hope this helps.

twaik commented 1 year ago

Can you please check if it happens with latest build here?

Rhys-T commented 1 year ago

Build #12 from your repository does indeed open the keyboard successfully when the back button is pressed, at least on my tablet.

I did run into a few unrelated issues compared to the one from this repo, and that I didn't find any existing GitHub issues for. I can open them separately if you want. But they're this at least makes it usable for me again. Thanks!

The other issues - The `termux-x11` command no longer automatically brings up the Termux:X11 app in the foreground. (It still runs, but I have to actually click its icon before I can see anything.) - Clicking the Termux:X11 app doesn't seem to auto-start Xwayland on the Termux side of things. - The extra keys bar covers the bottom edge of the X11 screen. (At first, I thought I was just getting a black screen with no X11 content showing up. The only thing I had running was i3, and its bar was going behind the extra keys.) - No notification with which to access preferences or close the server. I checked, and it's still allowed to send notifications as far as Android is concerned - it just doesn't show one for some reason.
twaik commented 1 year ago

The termux-x11 command no longer automatically brings up the Termux:X11 app in the foreground. (It still runs, but I have to actually click its icon before I can see anything.)

This is done on purpose. New version is considered to be started with termux's services implementation (not implemented in termux-x11 yet). In this case bringing Termux:X11 to foreground will be annoying.

Clicking the Termux:X11 app doesn't seem to auto-start Xwayland on the Termux side of things.

It should not. And Termux:X11 has no rights to start anything inside termux. It is possible, but it can be a bit unneded/annoying since some people use it with chroot.

The extra keys bar covers the bottom edge of the X11 screen. (At first, I thought I was just getting a black screen with no X11 content showing up. The only thing I had running was i3, and its bar was going behind the extra keys.)

Try swipe down with three fingers. It is a new feature, I finished it 1 hour ago...

No notification with which to access preferences or close the server. I checked, and it's still allowed to send notifications as far as Android is concerned - it just doesn't show one for some reason.

You can open preferences when there is no client or with static shortcut (try to long-tap Termux:X11 icon in launcher).

Rhys-T commented 1 year ago

[termux-x11 not starting app, and app not starting Xwayland]

Got it. Just wanted to mention it, since it was different from how the previous builds seemed to work, and I wasn't sure if it was intentional or not.

Try swipe down with three fingers. It is a new feature, I finished it 1 hour ago...

(Found that in #58 and replied there.)

You can open preferences[…]

Thanks. I figured out that running the app without Xwayland would give me the button, but didn't think to check for a shortcut like that.

Is the notification gone on purpose? Without the notification, is there currently any way to shut down Termux:X11, short of force-stopping it and cleaning up the sockets? (Is it even supposed to be shut down, or is it supposed to just always be there?)

twaik commented 1 year ago

Got it. Just wanted to mention it, since it was different from how the previous builds seemed to work, and I wasn't sure if it was intentional or not.

Yeah, it was intentional. :)

Is the notification gone on purpose? Without the notification, is there currently any way to shut down Termux:X11, short of force-stopping it and cleaning up the sockets? (Is it even supposed to be shut down, or is it supposed to just always be there?)

Yeah, it is gone on purpose. It seems to be annoying when there are two pinned notifications in status bar (1 from com.termux and 1 more from com.termux.x11) so I got rid of it. Since it does not hold compositor you can simply close it like regular app with swipe up from recents screen. But if you want to kill compositor you should do something like pkill Xwayland and termux-x11 will close itself (it tracks Xwayland state if it is not launched detached). But you should now that sometimes Xwayland stays alive even after pkill -9 Xwayland and in this case you must force-stop com.termux app to kill it.

twaik commented 1 year ago

Is a problem solved? Can I close the issue?

ask9027 commented 1 year ago

This build working fine except two finger scrolling.( i mean hold one and move other.)

twaik commented 1 year ago

What is wrong with two finger scrolling?

ask9027 commented 1 year ago

https://user-images.githubusercontent.com/61283438/222423039-37382381-201f-42e7-b837-e0c203866196.mp4

twaik commented 1 year ago

Yeah, you are definitely right, I did not find out how to make scroll with XTest extension...

ask9027 commented 1 year ago

i install it fresh. but when i open, it is not asking Run in termux Environment Permission. does it is not necessary now?

twaik commented 1 year ago

No in current builds. But it will ask for it after merging to termux/termux-x11.

ask9027 commented 1 year ago

No in current builds. But it will ask for it after merging to termux/termux-x11.

Oh, Okay

ask9027 commented 1 year ago

Yeah, you are definitely right, I did not find out how to make scroll with XTest extension...

Look this. is it helpful?

twaik commented 1 year ago

I need to do this with libxcb, not xlib...

twaik commented 1 year ago

Looks like I found it. So stupid, I was sending XCB_KEY_PRESS and wondering why it does not work. Check latest build in my fork.

ask9027 commented 1 year ago

Looks like I found it. So stupid, I was sending XCB_KEY_PRESS and wondering why it does not work. Check latest build in my fork.

Fantastic 👍 it works. Please close this issue also.