这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dkramer95
Copy link
Contributor

This is only applicable for Android 10+ devices that support HDMI output over USB and have enabled the Experimental desktop mode developer option. (Oreo technically supports external displays, but keyboard + mouse input isn't mapped properly, so wouldn't be very useful.)

If there is an external display connected, the MainActivity will be launched on that external display. It will also be displayed in fullscreen w/o any navigation / floating window controls, allowing to use entire display surface area.

  • To get full screen to show properly, the correct theme needs to be set at runtime (instead of in Manifest)

My Setup

On my personal device, I have a tasker termux shortcut accessible from home screen that runs the commands from the README

export XDG_RUNTIME_DIR=${TMPDIR}
termux-x11 :1 &
env DISPLAY=:1 xfce4-session

Now, when I tap the shortcut the MainActivity will be launched on my external display if it is connected.

  • Tested w/ OnePlus 8T - Android 11

@twaik
Copy link
Member

twaik commented Sep 11, 2022

Looks interesting. Did you override navbar appearing on external display? Or navbar appears every time you try to use taskbar in GUI?

@dkramer95
Copy link
Contributor Author

Ya the nav bar consumed ~100px of vertical height on external display and is basically dead space. (No part of the Activity can show in that blank area, it's just grey) So for external displays, it will be hidden.

@twaik twaik merged commit b3969fe into termux:master Sep 16, 2022
@5A52
Copy link

5A52 commented Sep 16, 2022

Unfortunatelly does not change anything in samsung DEX mode. Im not good in android programming, but can i provide any log or debug information?

@twaik
Copy link
Member

twaik commented Sep 16, 2022

It is intended to work with Android Desktop mode, not Dex.

@5A52
Copy link

5A52 commented Sep 16, 2022

Is there any way to recognise Dex as an external display also?

@twaik
Copy link
Member

twaik commented Sep 16, 2022

As far as I know it is not external display, or at least not in traditional meaning.

@dkramer95
Copy link
Contributor Author

@5A52 It might be possible... I don't have a Samsung DEX capable device to test... Currently it is checking for the Experimental Desktop mode flag. Since DEX is a much more polished implementation, I highly doubt that flag exists on Samsung devices, but if you have adb installed you can check with:

adb shell settings get global "force_desktop_mode_on_external_displays"

If null is returned then it doesn't exist.

If you have Android Studio, you can just comment out that check:

Change this line to:

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O || /*!hasEnabledAndroidDesktopModeSetting()*/ || externalDisplay == null) {

and see if it works...

I'm not sure how/if Samsung handles mapping keyboard + mouse input on external displays if it wasn't launched from DEX.

@v8karlo
Copy link

v8karlo commented Sep 17, 2022

Samsung S20 DEX

Full screen without upper Nav Bar and down Bar

image

Enabled Force Desktop Mode [ Experimental Desktop mode on secondary displays ]
Restart DEX [ Build#196 installed ] and start X11

image

image

@5A52
Copy link

5A52 commented Sep 17, 2022

@v8karlo Thanks, works, but at least with 3 disadvantages

  1. starts minimised
  2. With force desktop mode enabled, touchpad icon disapiers from phone NAV bar
  3. When hitting bottom edge with cursor DEX bar pops out
    I think the better option will be to have "full screen" chekbox in preferencies. Because even on phone screen full screen is useful sometime.

@twaik
Copy link
Member

twaik commented Sep 17, 2022

When hitting bottom edge with cursor DEX bar pops out
I think the better option will be to have "full screen" chekbox in preferencies. Because even on phone screen full screen is useful sometime.

We can not disable this behaviour. It happens in normal Android, desktop mode and DEX. I can try to write a tool which can work with adb or root rights and intercept mouse and keyboard events, but it will not happen soon.

@5A52
Copy link

5A52 commented Sep 17, 2022

We can not disable this behaviour. It happens in normal Android, desktop mode and DEX. I can try to write a tool which can work with adb or root rights and intercept mouse and keyboard events, but it will not happen soon.

xsdl Xserver does somehow. Not sure if it intercepts mouse. Also most full screen app does, m$ RDP, any full screen game. Anyway intercepting mouse\keyboard is a GREAT idea, alt+f4 will be intercepted in this case!! And not in a far future, is it possible to add a full screen chekbox in preferencies screen? It is much better than auto launch full screen by detecting screen modes.

@twaik
Copy link
Member

twaik commented Sep 17, 2022

As far as I know no app can app can avoid navbar appearing. It is a part of security mechanisms of Android...
But we can intercept Alt+F4 and other key combinations on Samsungdevices suporting DEX. See #47 (comment)

@twaik
Copy link
Member

twaik commented Sep 18, 2022

Regular application can hide navbar but can not disable it completely. Anyway it appears when you move mouse to area of navbar or do swipe up bottom edge of screen...

@pecbraz
Copy link

pecbraz commented Sep 19, 2022

I have a strange issue using the hdmi output. It goes indeed fullscreen, but the colors are all lighter/brighter, and it's very noticiable. For example, black turn into grey...
This is super annoying. Could it be some android setting that affects full screen apps?
If I disable Force Desktop Mode in developer settings, the colors are normal again, but no fullscreen in this case...

I'm also having the issue of it starting minimized, but not so annoying as the color issue.

The DEX bar pops out moving the mouse to the bottom, but this does not annoy me, it's actually good, so then I can close termux-x11 from the notifications shortcut, or change to other apps from there.

I'm still able to use the phone as a touchpad, so this issue I do not have.

PS: my device is a Z Fold 4 with proot-distro with xfce4

@v8karlo
Copy link

v8karlo commented Sep 19, 2022

@v8karlo Thanks, works, but at least with 3 disadvantages

  1. starts minimised
  2. With force desktop mode enabled, touchpad icon disapiers from phone NAV bar
  3. When hitting bottom edge with cursor DEX bar pops out
    I think the better option will be to have "full screen" chekbox in preferencies. Because even on phone screen full screen is useful sometime.

  1. Yes , minimized , I can live with that , no big deal .
  2. I am working with Linux only in DEX mode on big screen , never on mobile , so for me thats ok !
    Mosue and keyboard only .
  3. I mix all the time DEX and Linux software and bottom DEX bar is wanted to use both Android and Linux together ,
    the only thing which is missing is Clipboard beetween Android and Linux in order to use both as one OS .

The Clipboard Android Linux is last step which I need .

I hope you understand what I am trying to accomplish .

@twaik
Copy link
Member

twaik commented Sep 19, 2022

the only thing which is missing is Clipboard beetween Android and Linux in order to use both as one OS .

I am already on it, but it will take some time.

@v8karlo
Copy link

v8karlo commented Sep 19, 2022

Thx Twaik , the Clipboard Android Liinux is essencial .

Anyway thx for all the huge effort you did till now !

@v8karlo
Copy link

v8karlo commented Sep 19, 2022

Zman from Ubuntu on Android already have some success on Clipboard ,

and is almost done .

Maybe will be good idea to invite him on this matter ?

@v8karlo
Copy link

v8karlo commented Sep 19, 2022

I proposed same to Zman .

@twaik
Copy link
Member

twaik commented Sep 19, 2022

I already know what exactly I must do to make clipboard support, but first I need to write wayland protocol parser and get rid of JNI in core code. It is pretty simple, but requires a lot of time for writing and debugging code.

@v8karlo
Copy link

v8karlo commented Sep 19, 2022

I understand how much time and effort it needs .

Thx again on your excelent work !!!

@5A52
Copy link

5A52 commented Sep 20, 2022

3. the only thing which is missing is Clipboard beetween Android and Linux

Yes this will be very good feature, but "full screen" chek box in preferencies is also very usefull. I prefere to have full screen even on phone screen.

@twaik
Copy link
Member

twaik commented Sep 20, 2022

It is already in TODO list.

@twaik
Copy link
Member

twaik commented Sep 20, 2022

For some reason it was disabled by @suhan-paradkar . a7f4111

@twaik
Copy link
Member

twaik commented Sep 20, 2022

a detailed knowledge of your lorie implementation

I am preparing a big update so it will be a bit outdated.

I still find the idea (common ExtraKeys) very interesting.

Me too.

@v8karlo
Copy link

v8karlo commented Sep 20, 2022

Enabled Force Desktop Mode [ Experimental Desktop mode on secondary displays ]

messed up my phone display ( DEX worked fine ) , when I disable it everything went back to normal .

So I can not use it for full screen .

Maybe full screen check box is a good idea at the end .

@kulturguda
Copy link

Build is expired, how can I download to test it?

@termux termux deleted a comment from RalfWerner Mar 10, 2024
@termux termux deleted a comment from RalfWerner Mar 10, 2024
@termux termux deleted a comment from RalfWerner Mar 10, 2024
@termux termux deleted a comment from RalfWerner Mar 10, 2024
@termux termux deleted a comment from RalfWerner Mar 10, 2024
@termux termux deleted a comment from RalfWerner Mar 10, 2024
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

Successfully merging this pull request may close these issues.

6 participants