这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e98e8c1
WIP moving fake compositor to CmdEntryPoint, getting rid of backgroun…
twaik Feb 24, 2023
388e79a
Reconnecting to existing session.
twaik Feb 25, 2023
6a247fe
Basic pointer support. Scroll does not work yet.
twaik Feb 26, 2023
71cbf9e
Current [non] progress with delayed tasks...
twaik Feb 26, 2023
d893a3e
Fixing drawing permonance and delayed tasks...
twaik Feb 27, 2023
1628809
Basic super primitive keyboard support
twaik Feb 27, 2023
272d79f
Basic multiple layout support (using setxkbmap). Only software keyboard.
twaik Mar 1, 2023
1ea405c
Basic ExtraKeys support
twaik Mar 1, 2023
4574fd9
Physical keyboard support. Fixing ExtraKeys's text input view. Now it…
twaik Mar 1, 2023
252706d
Added toggling ExtraKeys bar with triple finger swipe down.
twaik Mar 1, 2023
b12bda6
Fixing broken `wl_shell` protocol to handle old Xwayland...
twaik Mar 1, 2023
8ddb654
Basic chroot Xorg support... Enabling stderr-to-logcat by default to …
twaik Mar 2, 2023
32236a1
Fix appearing of extra keys when it is unchecked in preferences.
twaik Mar 2, 2023
34ea025
Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11…
twaik Mar 2, 2023
fbb95d3
ExtraKeys special button fix.
twaik Mar 2, 2023
57d6938
Fix for `xkbcommon: ERROR: failed to add default include path`
twaik Mar 2, 2023
a49389c
Fixing extra key appearing after preferences changed. Updatig documen…
twaik Mar 2, 2023
401b4a4
Scrolling support
twaik Mar 2, 2023
504bd20
Fix appearing ExtraKeys in PiP mode.
twaik Mar 2, 2023
877df08
Trying to fix root issues...
twaik Mar 2, 2023
a0d9d1a
Fixing root starting issues
twaik Mar 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
[submodule "app/src/main/jni/wayland"]
path = app/src/main/jni/wayland
[submodule "app/src/main/cpp/wayland"]
path = app/src/main/cpp/wayland
url = https://gitlab.freedesktop.org/wayland/wayland
ignore = dirty
[submodule "x11-client-experimental/src/main/cpp/libxcb"]
path = x11-client-experimental/src/main/cpp/libxcb
[submodule "app/src/main/cpp/libxcb"]
path = app/src/main/cpp/libxcb
url = https://gitlab.freedesktop.org/xorg/lib/libxcb
ignore = dirty
[submodule "x11-client-experimental/src/main/cpp/xorgproto"]
path = x11-client-experimental/src/main/cpp/xorgproto
[submodule "app/src/main/cpp/xorgproto"]
path = app/src/main/cpp/xorgproto
url = https://gitlab.freedesktop.org/xorg/proto/xorgproto
ignore = dirty
[submodule "x11-client-experimental/src/main/cpp/xcbproto"]
path = x11-client-experimental/src/main/cpp/xcbproto
[submodule "app/src/main/cpp/xcbproto"]
path = app/src/main/cpp/xcbproto
url = https://gitlab.freedesktop.org/xorg/proto/xcbproto
ignore = dirty
[submodule "x11-client-experimental/src/main/cpp/libXau"]
path = x11-client-experimental/src/main/cpp/libXau
[submodule "app/src/main/cpp/libXau"]
path = app/src/main/cpp/libXau
url = https://gitlab.freedesktop.org/xorg/lib/libxau
ignore = dirty
[submodule "x11-client-experimental/src/main/cpp/libxcb-errors"]
path = x11-client-experimental/src/main/cpp/libxcb-errors
[submodule "app/src/main/cpp/libxcb-errors"]
path = app/src/main/cpp/libxcb-errors
url = https://gitlab.freedesktop.org/xorg/lib/libxcb-errors
ignore = dirty
[submodule "x11-client-experimental/src/main/cpp/libxcvt"]
path = x11-client-experimental/src/main/cpp/libxcvt
[submodule "app/src/main/cpp/libxcvt"]
path = app/src/main/cpp/libxcvt
url = https://gitlab.freedesktop.org/xorg/lib/libxcvt
ignore = dirty
[submodule "app/src/main/cpp/libxkbcommon"]
path = app/src/main/cpp/libxkbcommon
url = https://github.com/xkbcommon/libxkbcommon
ignore = dirty
[submodule "app/src/main/cpp/libandroid-support"]
path = app/src/main/cpp/libandroid-support
url = https://github.com/termux/libandroid-support/
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
versionName "1.02.06"

externalNativeBuild {
ndkBuild {
arguments "WAYLAND_GENERATED=${waylandOut}"
cmake {
arguments "-DWAYLAND_GENERATED_DIR=${waylandOut}"
}
}
}
Expand Down Expand Up @@ -52,8 +52,8 @@ android {
}

externalNativeBuild {
ndkBuild {
path "src/main/jni/Android.mk"
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}

Expand All @@ -69,8 +69,8 @@ android {

task patchWayland {
println("Patch can fail here, it is normal if a patch was already applied")
ant.patch(patchfile: "${project.projectDir}/src/main/jni/wayland.patch", dir: "${project.projectDir}/src/main/jni/wayland/src", failonerror:false)
ant.patch(patchfile: "${project.projectDir}/src/main/jni/wayland2.patch", dir: "${project.projectDir}/src/main/jni/wayland", failonerror:false)
ant.patch(patchfile: "${project.projectDir}/src/main/cpp/wayland.patch", dir: "${project.projectDir}/src/main/cpp/wayland/src", failonerror:false)
ant.patch(patchfile: "${project.projectDir}/src/main/cpp/wayland2.patch", dir: "${project.projectDir}/src/main/cpp/wayland", failonerror:false)
}

tasks.matching { it.name.toLowerCase().contains("ndk") && !it.name.toLowerCase().contains("clean") }
Expand All @@ -84,7 +84,7 @@ wayland {

dependencies {
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.termux.termux-app:termux-shared:-SNAPSHOT'
implementation 'com.termux.termux-app:termux-shared:2f5a6f7de6'
implementation 'com.google.android.material:material:1.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleDependency
Expand All @@ -95,5 +95,5 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'androidx.annotation:annotation:1.5.0'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
compileOnly project(':app:stub')
compileOnly project(':shell-loader:stub')
}
22 changes: 10 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
Expand All @@ -18,13 +19,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
>
<service
android:name=".LorieService"
android:enabled="true"
android:exported="false"/>
<activity android:name=".MainActivity"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".MainActivity"
android:taskAffinity=".MainActivity"
android:launchMode="singleInstance"
android:supportsPictureInPicture="true"
android:configChanges="fontScale|orientation|screenSize|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|screenLayout|touchscreen|uiMode|smallestScreenSize|density"
Expand All @@ -43,20 +41,20 @@
<activity
android:theme="@style/Theme.AppCompat.DayNight"
android:excludeFromRecents="true"
android:name=".LoriePreferences"
android:name=".LoriePreferences"
android:taskAffinity=".LoriePreferences"
android:supportsPictureInPicture="false"
android:resizeableActivity="true">
android:resizeableActivity="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name=".GettingStartedActivity"
android:taskAffinity=".GettingStartedActivity"
android:theme="@style/Theme.BaseActivity.DayNight.NoActionBar"
android:exported="true" />
<activity android:name=".TermuxX11StarterReceiver"
android:excludeFromRecents="true"
android:exported="true" />
<meta-data android:name="com.samsung.android.multidisplay.keep_process_alive" android:value="true"/>
<meta-data android:name="android.allow_multiple_resumed_activities" android:value="true" />
</application>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/aidl/com/termux/x11/ICmdEntryInterface.aidl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.termux.x11;

// This interface is used by utility on termux side.
interface ICmdEntryInterface {
void outputResize(int width, int height);
ParcelFileDescriptor getXConnection();
ParcelFileDescriptor getLogcatOutput();
}
8 changes: 0 additions & 8 deletions app/src/main/aidl/com/termux/x11/ITermuxX11Internal.aidl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ set(CMAKE_CXX_STANDARD 20)

find_package(Python3 REQUIRED)

####################################################################################################
######################################### LIBWAYLAND ###############################################
####################################################################################################

set(WAYLAND_SOURCES connection.c event-loop.c wayland-protocol.c wayland-server.c wayland-shm.c wayland-os.c wayland-util.c)
list(TRANSFORM WAYLAND_SOURCES PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/wayland/src/)
add_library(wayland-server SHARED ${WAYLAND_SOURCES})
target_include_directories(wayland-server PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/wayland ${CMAKE_CURRENT_SOURCE_DIR}/wayland/src)

####################################################################################################
########################################### LORIE ##################################################
####################################################################################################

file(GLOB WAYLAND_GENERATED "${WAYLAND_GENERATED_DIR}/*.cpp")
add_library(lorie SHARED
${CMAKE_CURRENT_SOURCE_DIR}/lorie/compositor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/lorie/lorie_wayland_server.cpp
${WAYLAND_GENERATED}
)
target_include_directories(lorie PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lorie ${WAYLAND_GENERATED_DIR})
target_link_libraries(lorie wayland-server "-landroid" "-llog")

# Nothing special here, only generating xcb headers and building xcb...

####################################################################################################
Expand Down Expand Up @@ -73,6 +95,15 @@ target_include_directories(xcb PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libxcb/src/"
target_compile_options(xcb PRIVATE "-DXCB_QUEUE_BUFFER_SIZE=16384" "-DHAVE_SENDMSG")
target_link_libraries(xcb Xau)

# Those are stubs and needed to check if termux-built xcb behaves the same way
# All the functions they should contain are contained in libxcb itself
add_library(xcb-shm SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
add_library(xcb-xfixes SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
add_library(xcb-xinput SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
add_library(xcb-damage SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)

# TODO: strip unneded symbols to reduce shared library size...

####################################################################################################
####################################### LIBXCB-ERRORS ##############################################
####################################################################################################
Expand Down Expand Up @@ -106,13 +137,43 @@ add_library(xcvt "${CMAKE_CURRENT_SOURCE_DIR}/libxcvt/lib/libxcvt.c")
target_include_directories(xcvt PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libxcvt/include")

####################################################################################################
########################################### LORIE ##################################################
####################################### LIBXKB-COMMON ##############################################
####################################################################################################

add_library(xcb-shm SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
add_library(xcb-xfixes SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
add_library(xcb-xinput SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
add_library(xcb-damage SHARED ${CMAKE_CURRENT_SOURCE_DIR}/loading_sign.c)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.h "")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.c
"#include <keymap.h>
const struct xkb_keymap_format_ops text_v1_keymap_format_ops = {};")
set(XKBCOMMON_SOURCES atom.c context.c context-priv.c keysym.c keysym-utf.c keymap.c keymap-priv.c
state.c text.c utf8.c utils.c x11/keymap.c x11/state.c x11/util.c)
list(TRANSFORM XKBCOMMON_SOURCES PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/libxkbcommon/src/)
set(XKBCOMMON_SOURCES ${XKBCOMMON_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/config.c)
add_library(xkbcommon ${XKBCOMMON_SOURCES})
target_compile_options(xkbcommon PRIVATE
"-DHAVE_STRNDUP=1" "-DDEFAULT_XKB_LAYOUT=\"us\"" "-DDEFAULT_XKB_MODEL=\"pc105\""
"-DDEFAULT_XKB_OPTIONS=NULL" "-DDEFAULT_XKB_RULES=\"evdev\"" "-DDEFAULT_XKB_VARIANT=NULL"
"-DDFLT_XKB_CONFIG_EXTRA_PATH=\"/data/data/com.termux.x11\""
"-DDFLT_XKB_CONFIG_ROOT=\"/data/data/com.termux.x11\"")
target_include_directories(xkbcommon PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/libxkbcommon/src")
target_include_directories(xkbcommon PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/libxkbcommon/include")
target_link_libraries(xkbcommon xcbproto)

####################################################################################################
#################################### LIBANDROID-SUPPORT ############################################
####################################################################################################

set(ANDROID_SUPPORT_MUSL_CTYPE iswalnum.c iswalpha.c iswblank.c iswcntrl.c iswctype.c iswdigit.c
iswgraph.c iswlower.c iswprint.c iswpunct.c iswspace.c iswupper.c iswxdigit.c towctrans.c
wcswidth.c wctrans.c)
set(ANDROID_SUPPORT_MUSL_MULTIBYTE internal.c mblen.c mbsnrtowcs.c mbsrtowcs.c)
list(TRANSFORM ANDROID_SUPPORT_MUSL_CTYPE PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/libandroid-support/src/musl-ctype/)
list(TRANSFORM ANDROID_SUPPORT_MUSL_MULTIBYTE PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/libandroid-support/src/musl-multibyte/)
add_library(android-support STATIC ${ANDROID_SUPPORT_MUSL_CTYPE} ${ANDROID_SUPPORT_MUSL_MULTIBYTE})

####################################################################################################
####################################### LORIE-CLIENT ###############################################
####################################################################################################

add_library(lorie SHARED lorie/lorie.cpp lorie/lorie_message_queue.cpp)
target_link_libraries(lorie xcbproto xcb xcb-errors xcb-shm xcb-xfixes xcb-xinput xcb-damage xcvt "-llog" "-landroid")
add_library(lorie-client SHARED ${CMAKE_CURRENT_SOURCE_DIR}/lorie-client/lorie-client.cpp)
target_link_libraries(lorie-client android-support xkbcommon xcbproto xcb xcb-errors xcb-shm
xcb-xfixes xcb-xinput xcb-damage xcvt "-llog" "-landroid")
1 change: 1 addition & 0 deletions app/src/main/cpp/libXau
Submodule libXau added at c52f54
1 change: 1 addition & 0 deletions app/src/main/cpp/libandroid-support
Submodule libandroid-support added at 2c033e
1 change: 1 addition & 0 deletions app/src/main/cpp/libxkbcommon
Submodule libxkbcommon added at 5b5ec0
5 changes: 5 additions & 0 deletions app/src/main/cpp/loading_sign.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//#include <stdio.h>

//static void __attribute__((__constructor__)) load() {
// puts("libxcb is loaded from apk...\n");
//}
Loading