Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The screen flickers and in unreadable. #2127

Closed
nightshade427 opened this issue Jun 16, 2021 · 25 comments
Closed

The screen flickers and in unreadable. #2127

nightshade427 opened this issue Jun 16, 2021 · 25 comments

Comments

@nightshade427
Copy link

nightshade427 commented Jun 16, 2021

Problem description
The screen flickers and is unreadable.

Steps to reproduce
Run htop or any other app that refrehes screen while in tablet mode in android.

Expected behavior
screen doesnt flicker

Transcript

~ $ htop

Termux App Info

APP_NAME: Termux
PACKAGE_NAME: com.termux
VERSION_NAME: 0.114
VERSION_CODE: 114
TARGET_SDK: 28
IS_DEBUG_BUILD: false
APK_RELEASE: F-Droid
SIGNING_CERTIFICATE_SHA256_DIGEST: 228FB2CFE90831C1499EC3CCAF61E96E8E1CE70766B9474672CE427334D41C42

Device Info

Software

OS_VERSION: 5.4.61-qgki-21556280-abG991USQU3AUDB
SDK_INT: 30
RELEASE: 11
ID: RP1A.200720.012
DISPLAY: RP1A.200720.012.G991USQU3AUDB
INCREMENTAL: G991USQU3AUDB
SECURITY_PATCH: 2021-05-01
IS_DEBUGGABLE: 0
IS_TREBLE_ENABLED: true
TYPE: user
TAGS: release-keys

Hardware

MANUFACTURER: samsung
BRAND: samsung
MODEL: SM-G991U
PRODUCT: o1qsqw
BOARD: lahaina
HARDWARE: qcom
DEVICE: o1q
SUPPORTED_ABIS: arm64-v8a, armeabi-v7a, armeabi

Termux APT Info

Subscribed Repositories

sources.list

deb https://packages.termux.org/apt/termux-main/ stable main

game-repo (sources.list.d/game.list)

deb https://packages.termux.org/apt/termux-games games stable

science-repo (sources.list.d/science.list)

deb https://packages.termux.org/apt/termux-science science stable

Updatable Packages

All packages up to date

@agnostic-apollo
Copy link
Member

Please provide following:

  1. Video for said flickering.
  2. Also check "Fix issue where soft keyboard overlaps extra keys or terminal in some cases." section in release post and provide a logcat log, since flickering may be related.

Thanks

@RalfWerner
Copy link

Immediately before the start of the video, I've used the installed v113 without flickers. After the v114 update, the flickering starts at second 10 and ends at second 22. Here, the AVD emulator is Pixel-C uses with Android 11. Identical results I get with Pixel 2/4 (you @agnostic-apollo use) and also Android 10 and on my real device.
The flicker does not always end when the split is closed but the latest after a screen rotation is ended (workaround).

flicker.mp4

@ghost
Copy link

ghost commented Jun 17, 2021

I also have the same issue where i needed to split-screen to termux app then it flickers

to reproduce it, Termux app should enter to split screen mode

@agnostic-apollo
Copy link
Member

I have confirmed this at least for split screen, middle of something else, so will look into fixing it after that.

@creepy-pasta101
Copy link

I also have the same issue where i needed to split-screen to termux app then it flickers

to reproduce it, Termux app should enter to split screen mode

Yes... this has been a problem since the cursor styles commit had been added....
My termux app is the debug artifact of it...

@agnostic-apollo
Copy link
Member

Yes... this has been a problem since the cursor styles commit had been added....

e7dd0ee was added before f545ebf

@Grimler91
Copy link
Member

We received a video on the mailing list as well: https://groups.io/g/termux/message/604, with samsung dex

@agnostic-apollo
Copy link
Member

@Grimler91 Thanks for posting. But I can't know what's going on internally without logs. If this is triggered by a different reason than that of split screen, then it may not get fixed.

Might add termux.properties to disable margin adjustment.

@hmcanady
Copy link

I posted the video on the mailing list link above. I have since discovered that when I maximize the window in Samsung DeX, it no longer flickers.
logfile-flickerissue.txt

I ran logcat log, as suggested in one of the earlier posts in this thread, and am attaching it.

@agnostic-apollo
Copy link
Member

I maximize the window in Samsung DeX, it no longer flickers.

I see, similar to split screen then.

I ran logcat log,

Did you set log level to Verbose and enable the Terminal View Key Logging toggle? You may need to exit termux after updating settings if termux is in mini screen ( I noticed this earlier, not sure if its actually a bug).

There are currently no termux verbose entries in the log you attached. I mainly need ones from Termux:TermuxActivityRootView component.

And thanks for the attempt.

@hmcanady
Copy link

Here is another attempt at logs. It still may not be what you need. I found the two settings you mentioned and there are Termux:TermuxActivityRootView items in it now. Thanks!
logfile-flickerissue2.txt

@dvlahakis
Copy link

I can confirm screen flickering in Samsung Dex when the cursor reaches the bottom of the window. It does not occur when termux window is maximized. It occurred for me in dex on windows, dex via miracast, or through scrcpy. I'm running termux .114 and this didn't happen with prior versions that I recall. Thanks.

@k-caps
Copy link

k-caps commented Jun 28, 2021

Same issue using the app in non-fullscreen mode in Motorola Ready For (similar to Dex).

agnostic-apollo added a commit that referenced this issue Jun 30, 2021
Margin adjustment was causing screen flickering due to invalid values being calculated in landscape and split screen mode.

Attempts to fix issue #2127
@agnostic-apollo
Copy link
Member

agnostic-apollo commented Jun 30, 2021

So I have attempted to fix the flickering in e5a9b99 and hopefully it should work but can't say for sure since dimensions are crazy on phones. I have tested on android 7 device and android 10 and 11 avd in landscape/potrait/split screen, also tested on android 7 with freeform mode with Taskbar app and don't seem to able to initiate the flickering anymore. I don't have access to dex so can't test that. If some of you are using debug builds, it would be better to test this out before release.

However, if it does flicker, adding disable-terminal-margin-adjustment=true to termux.properties file will disable margin adjustment as per 3213502.

Also it would be better for guys reporting the issue to check logs even on the next release in case infinite loop of log entries are being logged without flickering, it could happen.

@agnostic-apollo
Copy link
Member

Btw @hmcanady thanks for the logs, they were helpful.

@RalfWerner
Copy link

RalfWerner commented Jun 30, 2021

I have only checked on Huawei (Android 8). AVD you already have already done and have here No more flickering. My other concerns in this issue are not solved. I did not quite understand the value in *properties. It does not affect my Swift KB.

@agnostic-apollo
Copy link
Member

No more flickering.

Thanks for testing.

My other concerns in this issue are not solved.

Issue is only about flickering.

If with e5a9b99 no flickering -> issue solved.
If flickering, set disable-terminal-margin-adjustment=true, then there will automatically be no flickering but gboard clipbar will cover extra keys/terminal view -> issue of flickering still solved.

If disable-terminal-margin-adjustment=true, then Termux will not add margin to try to push up the extra keys/terminal view if its covered by the soft keyboard. Behaviour will be same as < 0.114.

It does not affect my Swift KB.

Is this related to flickering?

@RalfWerner
Copy link

.... but gboard clipbar will cover ... extra keys/terminal view if its covered by the soft keyboard

That I assumed and repeated the check with an AVD (with gboard) and could also detect no difference with/without the line - you?
grafik

Is this related to flickering?

No but it was the first device on which I discovered it and it has no influence at the disable* line. Up to now flickering is solved in all my checks - Thanks!

@agnostic-apollo
Copy link
Member

could also detect no difference with/without the line - you?

Did you exit and restart termux after updating value?

@RalfWerner
Copy link

Did you exit and restart termux after updating value?

Yes of course! Actions: termux-reload-settings, New Session, exit, Restart Phone and reinstall of Termux v116 - all have the same effect! The Gboard KB is then no longer displayable by the extra key KEYBOARD toggle. But this can be done by a workaround

e.g. Search in the File App (Split) but only in Landacape mode (Shot above) Termux is finished in Portrait mode. Unfortunately, the workaround must be repeated after some actions. The clipboard line replaces the numbers line (no additional)

My *properties can be seen in the shot above. With # disable* in the first line, the behavior is identical. I use Pixel_2_API_R.avd with Android 10, but can also check my others 7 AVD. Can you not repeat the behavior on any of your AVD?

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Jul 2, 2021

I have tested on both android 7 device and android 11 avd and likely android 10 previosuly. The disable-terminal-margin-adjustment=true is working as intended.

  • Set disable-terminal-margin-adjustment=false and enforce-char-based-input=true and exit termux. Then open it and copy text. Gboard clipboard will not overlap extra keys.
  • Set disable-terminal-margin-adjustment=true and enforce-char-based-input=true and exit termux. Then open it and copy text. Gboard clipboard will overlap extra keys same as < 0.114.

Also ensure Gboard number key row is enabled in its settings.

The clipboard line replaces the numbers line (no additional)

This will happen if Gboard number key row is disabled in its settings and overlap will not happen, even if termux does not do any margin adjustment.

Check TermuxActivityRootView javadocs for details as mentioned in the e7dd0ee commit message. Commit messages are meant to be read by testers (not general users) and I can't and won't retype everything.

@RalfWerner
Copy link

The disable-terminal-margin-adjustment=true is working as intended ... number key row is enabled in its settings.

Your example is what I would expect but not get with my *.avd enabled numbers see above! One of us have a "very special" AVD!
I've continued checks with my real Gigaset devive (Android 9) and get the same behavior as you've describe above.
Also checked Pixel_C_API_30.avd (Android 11 without google play store). Here I couldn't update gboard 9.* to version 10.* and don't get the exta line. But gboard-KB open after press KEYBOARD 3-4 times but the device reboot after some actions.

Next I checked Pixel_2_API_30.avd (Android 11 with google play store and gboard 10.6.*). Here again no chance for KEYBOARD toggle like above but have used here the 8 steps workaround Drawer->Settings-> ... for activating. These where also relevant for other Apps (search/Suchen in split screen) but has different lines:
grafik

Conclusion: disable*=true has no profit but v116 is on all my AVD installed and -
I know - these concerns are not related to flickers (so let's stop here)

Commit messages are meant to be read by testers (not general users)

Sorry that I've not analysed your sources detailed and check like a normal/general user. My attempts to contribute in the paste were rejected, so I've give up and manage my own patches but not for these general features.

@agnostic-apollo
Copy link
Member

One of us have a "very special" AVD!

If disable-terminal-margin-adjustment=true is indeed not working and still adjusting margin, people using F-Droid releases will report later so we will found out then.

Sorry that I've not analysed your sources detailed and check like a normal/general user. My attempts to contribute in the paste were rejected, so I've give up and manage my own patches but not for these general features.

Apologies for the wrong assumption. Will consider you a general user from now on and you can check Changelog on releases for any details and report issues after releases.

@k-caps
Copy link

k-caps commented Jul 4, 2021

If disable-terminal-margin-adjustment=true is indeed not working and still adjusting margin, people using F-Droid releases will report later so we will found out then.

I added the disable-terminal.... line to termux.properties, but it still flickers. The latest version on F-droid is 0.114, which is what I'm using.

@agnostic-apollo
Copy link
Member

The latest version on F-droid is 0.114, which is what I'm using.

Wait for v0.115.

AdamMickiewich pushed a commit to VolyaTeam/dzida-app that referenced this issue Aug 8, 2022
Margin adjustment was causing screen flickering due to invalid values being calculated in landscape and split screen mode.

Attempts to fix issue termux#2127
AdamMickiewich pushed a commit to VolyaTeam/dzida-app that referenced this issue Aug 8, 2022
The user can add `disable-terminal-margin-adjustment=true` entry to `termux.properties` file to disable terminal view margin adjustment that is done to prevent soft keyboard from covering bottom part of terminal view on some devices. Margin adjustment may cause screen flickering on some devices and so should be disabled. The default value is `false`. So adding the entry `disable-terminal-margin-adjustment=true` to `termux.properties` file will disable margin adjustment. Exit termux and restart for changes to take affect after updating value.

In case e5a9b99 did not fix screen flickering issues for termux#2127, then this can be used to disable it. Closes termux#2127.
shrihankp pushed a commit to reisxd/termux-app that referenced this issue Oct 20, 2022
Margin adjustment was causing screen flickering due to invalid values being calculated in landscape and split screen mode.

Attempts to fix issue termux#2127
shrihankp pushed a commit to reisxd/termux-app that referenced this issue Oct 20, 2022
The user can add `disable-terminal-margin-adjustment=true` entry to `termux.properties` file to disable terminal view margin adjustment that is done to prevent soft keyboard from covering bottom part of terminal view on some devices. Margin adjustment may cause screen flickering on some devices and so should be disabled. The default value is `false`. So adding the entry `disable-terminal-margin-adjustment=true` to `termux.properties` file will disable margin adjustment. Exit termux and restart for changes to take affect after updating value.

In case e5a9b99 did not fix screen flickering issues for termux#2127, then this can be used to disable it. Closes termux#2127.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants