gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
660 stars 59 forks source link

[Bug]: Clipboard only synced one-way #120

Closed babaric-dev closed 1 year ago

babaric-dev commented 1 year ago

62 occurs on my device. Still not fixed.

Text on Android clipboard gets sent to remote before connecting but not while connected. Text copied from remote are, however, reflected on client.

Now, everytime I copy something from Android's browser, I need to reconnect to paste to remote.

Idk much about Kotlin and Android apps, but it seems that onResume is already implemented (correct me if I am wrong).

Device running Android 13, One UI 5

gujjwal00 commented 1 year ago

I am out of town for couple of weeks, so can't do much right now. But as you said AVNC only sends text to server when it comes to foreground, i.e. onResume. It doesn't listen to clipboard changes in background.

Are you using AVNC in multi-window mode?

babaric-dev commented 1 year ago

either way, it doesn't work.

gujjwal00 commented 1 year ago

Can you please test the following APK: app-debug.zip

After copying something, you need to give focus to AVNC (simply tap anywhere on AVNC). Android restricts clipboard access to focused apps (on API 29+). There is no workaround for this behavior.

gujjwal00 commented 1 year ago

After copying something, you need to give focus to AVNC (simply tap anywhere on AVNC). Android restricts clipboard access to focused apps (on API 29+). There is no workaround for this behavior.

I think you will do this anyway when you will paste the copied value on server. So it doesn't seem like as big of an issue as I originally thought.

Saikatsaha1996 commented 1 year ago

Can you please test the following APK: app-debug.zip

After copying something, you need to give focus to AVNC (simply tap anywhere on AVNC). Android restricts clipboard access to focused apps (on API 29+). There is no workaround for this behavior.

My Android device api 31 Copy & pst works just fine.. & yes when anyone wants to pst something avnc should on in background

gujjwal00 commented 1 year ago

Fixed in https://github.com/gujjwal00/avnc/commit/71f84b594bf6269c52d37053a105e09c7ddb94ad.