Browse Source

Publishing my attempt to create a GTK4 app for android.

master
sergiotarxz 2 months ago
parent
commit
037c01264b
  1. 127
      BUILD.PL
  2. 6
      README.md
  3. 2
      app/build.gradle
  4. 12
      app/src/main/AndroidManifest.xml
  5. 2
      app/src/main/java/me/sergiotarxz/openmg/x11/AdditionalKeyboardView.java
  6. 2
      app/src/main/java/me/sergiotarxz/openmg/x11/KeyboardUtils.java
  7. 4
      app/src/main/java/me/sergiotarxz/openmg/x11/LoriePreferences.java
  8. 129
      app/src/main/java/me/sergiotarxz/openmg/x11/LorieService.java
  9. 2
      app/src/main/java/me/sergiotarxz/openmg/x11/MainActivity.java
  10. 6
      app/src/main/java/me/sergiotarxz/openmg/x11/TermuxX11StarterReceiver.java
  11. 2
      app/src/main/java/me/sergiotarxz/openmg/x11/TouchParser.java
  12. 4
      app/src/main/jni/libxkbcommon/Android.mk
  13. 2
      app/src/main/jni/libxkbcommon/xkbcommon/src/compose/config.h
  14. 2
      app/src/main/jni/libxkbcommon/xkbcommon/src/config.h
  15. 2
      app/src/main/jni/libxkbcommon/xkbcommon/src/xkbcomp/config.h
  16. 6
      app/src/main/jni/libxkbcommon/xkbcommon/tools/interactive-wayland.c
  17. 4
      app/src/main/jni/lorie/backend/android/android-app.cpp
  18. 3
      app/src/main/jni/lorie/compositor.cpp
  19. 323
      app/src/main/jni/lorie/scanner/protocol/wayland.xml
  20. BIN
      app/src/main/jni/prebuilt/x86_64/libwayland-server.so
  21. 2
      app/src/main/res/layout/main_activity.xml
  22. 2
      app/src/main/res/xml/preferences.xml
  23. 2
      build_termux_package
  24. 2
      common/src/main/AndroidManifest.xml
  25. 2
      common/src/main/aidl/me/sergiotarxz/openmg/x11/common/ITermuxX11Internal.aidl
  26. 2
      starter/build.gradle
  27. 2
      starter/src/main/AndroidManifest.xml
  28. 2
      starter/src/main/java/me/sergiotarxz/openmg/x11/starter/ActivityManager.java
  29. 2
      starter/src/main/java/me/sergiotarxz/openmg/x11/starter/CrossVersionReflectedMethod.java
  30. 2
      starter/src/main/java/me/sergiotarxz/openmg/x11/starter/ExecHelper.java
  31. 4
      starter/src/main/java/me/sergiotarxz/openmg/x11/starter/IActivityManager.java
  32. 25
      starter/src/main/java/me/sergiotarxz/openmg/x11/starter/Starter.java
  33. 8
      starter/src/main/jni/exechelper.c
  34. 14
      starter/src/main/jni/starter.c
  35. 4
      termux-startx11
  36. 6
      termux-x11

127
BUILD.PL

@ -0,0 +1,127 @@
use v5.30.0;
use strict;
use warnings;
use Data::Dumper;
use Const::Fast;
use Path::Tiny;
use File::pushd qw/pushd/;
use JSON qw/encode_json/;
sub build;
sub build_packages;
sub generate_jni_libs;
sub generate_deb_iteration_jni;
const my $TERMUX_PACKAGES_URL =>
'https://gitea.sergiotarxz.freemyip.com/sergiotarxz/termux-packages';
build;
sub build {
#### For the release.
## my $tmpdir = Path::Tiny->tempdir;
my $tmpdir = path('tmpdir');
build_packages $tmpdir;
generate_jni_libs $tmpdir;
}
sub generate_deb_iteration_jni {
my $source_file = path(__FILE__)->absolute;
my $current_file = 0;
my %mappings;
return (
sub {
my $deb = shift->absolute;
my $tmpdir_extract_deb = Path::Tiny->tempdir;
my $tmpdir_extract_data = Path::Tiny->tempdir;
my $out_of_scope_deb = pushd $tmpdir_extract_deb;
system qw/ar x/, $deb;
undef $out_of_scope_deb;
system qw/tar -xf/, $tmpdir_extract_deb->child('data.tar.xz'),
'-C', $tmpdir_extract_data;
$tmpdir_extract_data->visit(
sub {
my ( $path, $state ) = @_;
return if $path->is_dir;
my $stripped_path = $path =~ s{/.*?/.*?(?=/)}{}r;
if ($path->basename eq 'libwayland-server.so') {
system qw/cp -v/, $path, path(__FILE__)->parent->child('./app/src/main/jni/prebuilt/x86_64/libwayland-server.so');
}
if ( -l $path || lstat $path && !stat $path ) {
$mappings{$stripped_path} = readlink($path);
return;
}
my $result_file = $source_file->parent->child(
"./app/src/main/jni/prebuilt/x86_64/lib$current_file.so"
);
system 'cp', $path, $result_file
and die "$path not copied.";
$mappings{$stripped_path} =
'@' . $result_file->basename . '';
$current_file++;
},
{
recurse => 1
}
);
},
sub { return \%mappings }
);
}
sub generate_jni_libs {
my $tmpdir = shift;
my %mappings;
my $current_file = 0;
my @debs = $tmpdir->child('output')->children;
@debs = grep { /(?:x86_64|all)\.deb$/ } @debs;
my ( $iterator, $result_func ) = generate_deb_iteration_jni();
for my $deb (@debs) {
$iterator->($deb);
}
my $mapping_so_content = encode_json $result_func->();
my $mapping_so = path('app/src/main/jni/prebuilt/x86_64/libmappings.so');
$mapping_so->spew($mapping_so_content);
}
sub build_packages {
my $tmpdir = shift;
## my $fake_home = Path::Tiny->tempdir;
#### To avoid conflicting with real termux packages.
my $fake_home = path('fake_home')->absolute;
local $ENV{HOME} = $fake_home;
local $ENV{TERMUX_ARCH} = 'x86_64';
#### TODO: Avoid this to be needed to avoid conflicting with real termux packages.
# path('/data/data/.built-packages/')->remove_tree;
say "CLONING $TERMUX_PACKAGES_URL.";
say "-----------------------------";
say '';
say '';
system qw/git clone/, $TERMUX_PACKAGES_URL, $tmpdir;
my $out_of_scope_remove_tempdir = pushd $tmpdir;
say "PULLING $TERMUX_PACKAGES_URL.";
say "-----------------------------";
say '';
say '';
system qw/git pull/;
say "Building i3.";
say "-----------------------------";
say '';
say '';
system qw{./build-package.sh i3};
say "Building xwayland.";
say "-----------------------------";
say '';
say '';
system qw{./build-package.sh xwayland};
say "Building openmg.";
say "-----------------------------";
say '';
say '';
system qw{./build-package.sh openmg};
}

6
README.md

@ -56,9 +56,9 @@ You should start Termux:X11's activity with providing some additional data.
```
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import com.termux.x11.common.ITermuxX11Internal;
import me.sergiotarxz.openmg.x11.common.ITermuxX11Internal;
...
private final String TermuxX11ComponentName = "com.termux.x11/.TermuxX11StarterReceiver";
private final String TermuxX11ComponentName = "me.sergiotarxz.openmg.x11/.TermuxX11StarterReceiver";
private void startTermuxX11() {
Service svc = new Service();
@ -66,7 +66,7 @@ private void startTermuxX11() {
bundle.putBinder("", svc);
Intent intent = new Intent();
intent.putExtra("com.termux.x11.starter", bundle);
intent.putExtra("me.sergiotarxz.openmg.x11.starter", bundle);
ComponentName cn = ComponentName.unflattenFromString(TermuxX11ComponentName);
if (cn == null)
throw new IllegalArgumentException("Bad component name: " + TermuxX11ComponentName);

2
app/build.gradle

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.termux.x11"
applicationId "me.sergiotarxz.openmg.x11"
minSdkVersion 24
//noinspection OldTargetApi
targetSdkVersion 28

12
app/src/main/AndroidManifest.xml

@ -1,17 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.termux.x11"
package="me.sergiotarxz.openmg.x11"
android:installLocation="internalOnly"
>
<uses-permission android:name="com.termux.permission.RUN_COMMAND" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<application
android:extractNativeLibs="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@ -52,7 +47,4 @@
<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>
<queries>
<package android:name="com.termux" />
</queries>
</manifest>

2
app/src/main/java/com/termux/x11/AdditionalKeyboardView.java → app/src/main/java/me/sergiotarxz/openmg/x11/AdditionalKeyboardView.java

@ -1,4 +1,4 @@
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.annotation.SuppressLint;
import android.content.Context;

2
app/src/main/java/com/termux/x11/KeyboardUtils.java → app/src/main/java/me/sergiotarxz/openmg/x11/KeyboardUtils.java

@ -1,4 +1,4 @@
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.app.Activity;
import android.graphics.Rect;

4
app/src/main/java/com/termux/x11/LoriePreferences.java → app/src/main/java/me/sergiotarxz/openmg/x11/LoriePreferences.java

@ -1,4 +1,4 @@
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.content.SharedPreferences;
import android.inputmethodservice.Keyboard;
@ -105,7 +105,7 @@ public class LoriePreferences extends AppCompatActivity implements SharedPrefere
.setTitle("Permission denied")
.setMessage("Android requires WRITE_SECURE_SETTINGS permission to change this setting.\n" +
"Please, launch this command using ADB:\n" +
"adb shell pm grant com.termux.x11 android.permission.WRITE_SECURE_SETTINGS")
"adb shell pm grant me.sergiotarxz.openmg.x11 android.permission.WRITE_SECURE_SETTINGS")
.setNegativeButton("OK", null)
.create()
.show();

129
app/src/main/java/com/termux/x11/LorieService.java → app/src/main/java/me/sergiotarxz/openmg/x11/LorieService.java

@ -1,4 +1,4 @@
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
@ -43,20 +43,27 @@ import android.widget.Toast;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.Iterator;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.json.JSONObject;
@SuppressWarnings({"ConstantConditions", "SameParameterValue", "SdCardPath"})
@SuppressLint({"ClickableViewAccessibility", "StaticFieldLeak"})
public class LorieService extends Service {
static final String LAUNCHED_BY_COMPATION = "com.termux.x11.launched_by_companion";
static final String ACTION_STOP_SERVICE = "com.termux.x11.service_stop";
static final String ACTION_START_FROM_ACTIVITY = "com.termux.x11.start_from_activity";
static final String ACTION_START_PREFERENCES_ACTIVITY = "com.termux.x11.start_preferences_activity";
static final String ACTION_PREFERENCES_CHAGED = "com.termux.x11.preferences_changed";
static final String LAUNCHED_BY_COMPATION = "me.sergiotarxz.openmg.x11.launched_by_companion";
static final String ACTION_STOP_SERVICE = "me.sergiotarxz.openmg.x11.service_stop";
static final String ACTION_START_FROM_ACTIVITY = "me.sergiotarxz.openmg.x11.start_from_activity";
static final String ACTION_START_PREFERENCES_ACTIVITY = "me.sergiotarxz.openmg.x11.start_preferences_activity";
static final String ACTION_PREFERENCES_CHAGED = "me.sergiotarxz.openmg.x11.preferences_changed";
private static LorieService instance = null;
//private
@ -79,11 +86,11 @@ public class LorieService extends Service {
Intent intent = new Intent(act, LorieService.class);
intent.setAction(action);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
act.startForegroundService(intent);
} else {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// act.startForegroundService(intent);
// } else {
act.startService(intent);
}
// }
}
@SuppressLint({"BatteryLife", "ObsoleteSdkInt"})
@ -93,6 +100,40 @@ public class LorieService extends Service {
if (isServiceRunningInForeground(this, LorieService.class)) return;
String datadir = getApplicationInfo().dataDir;
String nativeLibDir = getApplicationInfo().nativeLibraryDir;
String mappingsFile = nativeLibDir + "/libmappings.so";
String usr = "datadir"+"/files/usr";
try {
if (new File(usr).exists()) {
Files.walk(Paths.get(usr))
.map(Path::toFile)
.sorted((o1, o2) -> -o1.compareTo(o2))
.forEach(File::delete);
}
InputStream is = new FileInputStream(mappingsFile);
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
String json = new String(buffer, "UTF-8");
JSONObject mappingsObject = new JSONObject(json);
Iterator keys = mappingsObject.keys();
while (keys.hasNext()) {
String key = (String) keys.next();
String value = mappingsObject.getString(key);
Path target;
if (value.charAt(0) == '@') {
// It is a lib\d+.so
value = nativeLibDir+"/"+value.substring(1);
}
target = Paths.get(value);
new File(key).getParentFile().mkdirs();
Files.createSymbolicLink(Paths.get(key), target);
}
} catch (Exception ex) {
ex.printStackTrace();
}
String[] dirs = {
datadir + "/files/locale",
datadir + "/files/xkb",
@ -155,19 +196,6 @@ public class LorieService extends Service {
.addAction(0, "Preferences", pendingPreferencesIntent)
.addAction(0, "Exit", pendingExitIntent)
.build();
startForeground(1, notification);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
String packageName = getPackageName();
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
if (!pm.isIgnoringBatteryOptimizations(packageName)) {
Intent whitelist = new Intent();
whitelist.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
whitelist.setData(Uri.parse("package:" + packageName));
whitelist.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(whitelist);
}
}
}
@RequiresApi(Build.VERSION_CODES.O)
@ -225,46 +253,27 @@ public class LorieService extends Service {
}
private static void sendRunCommandInternal(Context ctx) {
Intent intent = new Intent();
intent.setClassName("com.termux", "com.termux.app.RunCommandService");
intent.setAction("com.termux.RUN_COMMAND");
intent.putExtra("com.termux.RUN_COMMAND_PATH",
"/data/data/com.termux/files/usr/libexec/termux-x11/termux-startx11");
intent.putExtra("com.termux.RUN_COMMAND_BACKGROUND", true);
Log.d("LorieService", "sendRunCommand: " + intent);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
ctx.startForegroundService(intent);
} else {
ctx.startService(intent);
}
// Process process = Runtime.getRuntime().exec(
// "/data/data/me.sergiotarxz.openmg.x11/files/usr/bin/bash " +
// "/data/data/me.sergiotarxz.openmg.x11/files/usr/bin/startopenmg"
// );
// Intent intent = new Intent();
// intent.setClassName("com.termux", "com.termux.app.RunCommandService");
// intent.setAction("com.termux.RUN_COMMAND");
// intent.putExtra("com.termux.RUN_COMMAND_PATH",
// "/data/data/com.termux/files/usr/libexec/termux-x11/termux-startx11");
// intent.putExtra("com.termux.RUN_COMMAND_BACKGROUND", true);
// Log.d("LorieService", "sendRunCommand: " + intent);
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// ctx.startForegroundService(intent);
// } else {
// ctx.startService(intent);
// }
}
public static void sendRunCommand(AppCompatActivity act) {
final String ERROR_MESSAGE =
"It is impossible to start without " +
"com.termux.permission.RUN_COMMAND permission. " +
"Sorry.";
if (act.checkSelfPermission("com.termux.permission.RUN_COMMAND") == PackageManager.PERMISSION_GRANTED) {
LorieService.sendRunCommandInternal(act);
} else {
Log.d("MainActivity", "We have no permission to sendRunCommand(). Requesting it.");
ActivityResultLauncher<String> requestPermissionLauncher =
act.registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> {
if (isGranted) {
sendRunCommandInternal(act);
} else {
new AlertDialog.Builder(act)
.setTitle("Insufficient permission")
.setMessage(ERROR_MESSAGE)
.setPositiveButton(android.R.string.yes,
(dialog, which) -> act.finish())
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
}
});
requestPermissionLauncher.launch("com.termux.permission.RUN_COMMAND");
}
LorieService.sendRunCommandInternal(act);
}

2
app/src/main/java/com/termux/x11/MainActivity.java → app/src/main/java/me/sergiotarxz/openmg/x11/MainActivity.java

@ -1,4 +1,4 @@
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.app.Activity;
import android.content.Intent;

6
app/src/main/java/com/termux/x11/TermuxX11StarterReceiver.java → app/src/main/java/me/sergiotarxz/openmg/x11/TermuxX11StarterReceiver.java

@ -1,4 +1,4 @@
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.app.Activity;
import android.content.Intent;
@ -9,7 +9,7 @@ import android.os.RemoteException;
import android.util.Log;
import android.widget.Toast;
import com.termux.x11.common.ITermuxX11Internal;
import me.sergiotarxz.openmg.x11.common.ITermuxX11Internal;
import java.io.FileOutputStream;
import java.io.IOException;
@ -35,7 +35,7 @@ public class TermuxX11StarterReceiver extends Activity {
}
private void handleIntent(Intent intent) {
final String extraName = "com.termux.x11.starter";
final String extraName = "me.sergiotarxz.openmg.x11.starter";
Bundle bundle;
IBinder token;
ITermuxX11Internal svc;

2
app/src/main/java/com/termux/x11/TouchParser.java → app/src/main/java/me/sergiotarxz/openmg/x11/TouchParser.java

@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.termux.x11;
package me.sergiotarxz.openmg.x11;
import android.annotation.SuppressLint;
import android.content.Context;

4
app/src/main/jni/libxkbcommon/Android.mk

@ -37,11 +37,11 @@ LOCAL_SRC_FILES := \
LOCAL_CFLAGS := \
-std=c99 -Wall -Werror -Wno-unused-parameter -Wno-missing-field-initializers -Wimplicit-function-declaration \
-D_GNU_SOURCE \
-DXLOCALEDIR=\"/data/data/com.termux.x11/files/locale\" \
-DXLOCALEDIR=\"/data/data/me.sergiotarxz.openmg.x11/files/locale\" \
-DDEFAULT_XKB_LAYOUT=\"us\" \
-DDEFAULT_XKB_MODEL=\"pc105\" \
-DDEFAULT_XKB_RULES=\"evdev\" \
-DDFLT_XKB_CONFIG_ROOT=\"/data/data/com.termux.x11/files/xkb\"
-DDFLT_XKB_CONFIG_ROOT=\"/data/data/me.sergiotarxz.openmg.x11/files/xkb\"
LOCAL_C_INCLUDES := $(LOCAL_PATH)/xkbcommon $(LOCAL_PATH)/xkbcommon/src $(LOCAL_PATH)/xkbcommon/include
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/xkbcommon/
include $(BUILD_SHARED_LIBRARY)

2
app/src/main/jni/libxkbcommon/xkbcommon/src/compose/config.h

@ -1,6 +1,6 @@
#define _GNU_SOURCE_ 1
#define DFLT_XKB_CONFIG_EXTRA_PATH "/data/data/com.termux/files/home/.termux.wayland/xkb/config"
#define DFLT_XKB_CONFIG_EXTRA_PATH "/data/data/me.sergiotarxz.openmg.x11/files/home/.termux.wayland/xkb/config"
#define DEFAULT_XKB_VARIANT "NULL"

2
app/src/main/jni/libxkbcommon/xkbcommon/src/config.h

@ -1,6 +1,6 @@
#define _GNU_SOURCE_ 1
#define DFLT_XKB_CONFIG_EXTRA_PATH "/data/data/com.termux/files/home/.termux.wayland/xkb/config"
#define DFLT_XKB_CONFIG_EXTRA_PATH "/data/data/me.sergiotarxz.openmg.x11/files/home/.termux.wayland/xkb/config"
#define DEFAULT_XKB_VARIANT "NULL"

2
app/src/main/jni/libxkbcommon/xkbcommon/src/xkbcomp/config.h

@ -1,6 +1,6 @@
#define _GNU_SOURCE_ 1
#define DFLT_XKB_CONFIG_EXTRA_PATH "/data/data/com.termux/files/home/.termux.wayland/xkb/config"
#define DFLT_XKB_CONFIG_EXTRA_PATH "/data/data/me.sergiotarxz.openmg.x11/files/home/.termux.wayland/xkb/config"
#define DEFAULT_XKB_VARIANT "NULL"

6
app/src/main/jni/libxkbcommon/xkbcommon/tools/interactive-wayland.c

@ -607,17 +607,17 @@ registry_global(void *data, struct wl_registry *registry, uint32_t name,
else if (strcmp(interface, "xdg_wm_base") == 0) {
inter->shell = wl_registry_bind(registry, name,
&xdg_wm_base_interface,
MAX(version, 2));
MAX(version, 4));
xdg_wm_base_add_listener(inter->shell, &shell_listener, inter);
}
else if (strcmp(interface, "wl_compositor") == 0) {
inter->compositor = wl_registry_bind(registry, name,
&wl_compositor_interface,
MAX(version, 1));
MAX(version, 4));
}
else if (strcmp(interface, "wl_shm") == 0) {
inter->shm = wl_registry_bind(registry, name, &wl_shm_interface,
MAX(version, 1));
MAX(version, 4));
}
}

4
app/src/main/jni/lorie/backend/android/android-app.cpp

@ -179,7 +179,7 @@ void LorieBackendAndroid::passfd(int fd) {
#define JNI_DECLARE_INNER(package, classname, methodname ) \
Java_ ## package ## _ ## classname ## _ ## methodname
#define JNI_DECLARE(classname, methodname) \
JNI_DECLARE_INNER(com_termux_x11, classname, methodname)
JNI_DECLARE_INNER(me_sergiotarxz_openmg_x11, classname, methodname)
#define WL_POINTER_MOTION 2
@ -427,7 +427,7 @@ void fork(std::function<void()> f) {
}
extern "C" JNIEXPORT void JNICALL
Java_com_termux_x11_LorieService_startLogcatForFd(unused JNIEnv *env, unused jclass clazz, jint fd) {
Java_me_sergiotarxz_openmg_x11_LorieService_startLogcatForFd(unused JNIEnv *env, unused jclass clazz, jint fd) {
killAllLogcats();
LOGI("Starting logcat with output to given fd");

3
app/src/main/jni/lorie/compositor.cpp

@ -39,6 +39,9 @@ void LorieCompositor::start() {
wl_resource_t::global_create<LorieOutput>(display, this);
wl_resource_t::global_create<LorieShell>(display, this);
wl_registry *registry = wl_display_get_registry(this->display);
wl_registry_bind(registry, id, &xdg_wm_base_interface, 1);
backend_init();
wl_display_run(display);

323
app/src/main/jni/lorie/scanner/protocol/wayland.xml

@ -91,7 +91,7 @@
<entry name="invalid_object" value="0"
summary="server couldn't find object"/>
<entry name="invalid_method" value="1"
summary="method doesn't exist on the specified interface"/>
summary="method doesn't exist on the specified interface or malformed request"/>
<entry name="no_memory" value="2"
summary="server is out of memory"/>
<entry name="implementation" value="3"
@ -101,10 +101,10 @@
<event name="delete_id">
<description summary="acknowledge object ID deletion">
This event is used internally by the object ID management
logic. When a client deletes an object, the server will send
this event to acknowledge that it has seen the delete request.
When the client receives this event, it will know that it can
safely reuse the object ID.
logic. When a client deletes an object that it had created,
the server will send this event to acknowledge that it has
seen the delete request. When the client receives this event,
it will know that it can safely reuse the object ID.
</description>
<arg name="id" type="uint" summary="deleted object ID"/>
</event>
@ -179,7 +179,7 @@
the related request is done.
</description>
<event name="done">
<event name="done" type="destructor">
<description summary="done event">
Notify the client when the related request is done.
</description>
@ -187,7 +187,7 @@
</event>
</interface>
<interface name="wl_compositor" version="4">
<interface name="wl_compositor" version="5">
<description summary="the compositor singleton">
A compositor. This object is a singleton global. The
compositor is in charge of combining the contents of multiple
@ -293,10 +293,15 @@
formats are optional and may not be supported by the particular
renderer in use.
The drm format codes match the macros defined in drm_fourcc.h.
The formats actually supported by the compositor will be
reported by the format event.
The drm format codes match the macros defined in drm_fourcc.h, except
argb8888 and xrgb8888. The formats actually supported by the compositor
will be reported by the format event.
For all wl_shm formats and unless specified in another protocol
extension, pre-multiplied alpha is used for pixel values.
</description>
<!-- Note to protocol writers: don't update this list manually, instead
run the automated script that keeps it in sync with drm_fourcc.h. -->
<entry name="argb8888" value="0" summary="32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian"/>
<entry name="xrgb8888" value="1" summary="32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian"/>
<entry name="c8" value="0x20203843" summary="8-bit color index format, [7:0] C"/>
@ -355,6 +360,56 @@
<entry name="yvu422" value="0x36315659" summary="3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes"/>
<entry name="yuv444" value="0x34325559" summary="3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes"/>
<entry name="yvu444" value="0x34325659" summary="3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes"/>
<entry name="r8" value="0x20203852" summary="[7:0] R"/>
<entry name="r16" value="0x20363152" summary="[15:0] R little endian"/>
<entry name="rg88" value="0x38384752" summary="[15:0] R:G 8:8 little endian"/>
<entry name="gr88" value="0x38385247" summary="[15:0] G:R 8:8 little endian"/>
<entry name="rg1616" value="0x32334752" summary="[31:0] R:G 16:16 little endian"/>
<entry name="gr1616" value="0x32335247" summary="[31:0] G:R 16:16 little endian"/>
<entry name="xrgb16161616f" value="0x48345258" summary="[63:0] x:R:G:B 16:16:16:16 little endian"/>
<entry name="xbgr16161616f" value="0x48344258" summary="[63:0] x:B:G:R 16:16:16:16 little endian"/>
<entry name="argb16161616f" value="0x48345241" summary="[63:0] A:R:G:B 16:16:16:16 little endian"/>
<entry name="abgr16161616f" value="0x48344241" summary="[63:0] A:B:G:R 16:16:16:16 little endian"/>
<entry name="xyuv8888" value="0x56555958" summary="[31:0] X:Y:Cb:Cr 8:8:8:8 little endian"/>
<entry name="vuy888" value="0x34325556" summary="[23:0] Cr:Cb:Y 8:8:8 little endian"/>
<entry name="vuy101010" value="0x30335556" summary="Y followed by U then V, 10:10:10. Non-linear modifier only"/>
<entry name="y210" value="0x30313259" summary="[63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels"/>
<entry name="y212" value="0x32313259" summary="[63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels"/>
<entry name="y216" value="0x36313259" summary="[63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels"/>
<entry name="y410" value="0x30313459" summary="[31:0] A:Cr:Y:Cb 2:10:10:10 little endian"/>
<entry name="y412" value="0x32313459" summary="[63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian"/>
<entry name="y416" value="0x36313459" summary="[63:0] A:Cr:Y:Cb 16:16:16:16 little endian"/>
<entry name="xvyu2101010" value="0x30335658" summary="[31:0] X:Cr:Y:Cb 2:10:10:10 little endian"/>
<entry name="xvyu12_16161616" value="0x36335658" summary="[63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian"/>
<entry name="xvyu16161616" value="0x38345658" summary="[63:0] X:Cr:Y:Cb 16:16:16:16 little endian"/>
<entry name="y0l0" value="0x304c3059" summary="[63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian"/>
<entry name="x0l0" value="0x304c3058" summary="[63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian"/>
<entry name="y0l2" value="0x324c3059" summary="[63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian"/>
<entry name="x0l2" value="0x324c3058" summary="[63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian"/>
<entry name="yuv420_8bit" value="0x38305559"/>
<entry name="yuv420_10bit" value="0x30315559"/>
<entry name="xrgb8888_a8" value="0x38415258"/>
<entry name="xbgr8888_a8" value="0x38414258"/>
<entry name="rgbx8888_a8" value="0x38415852"/>
<entry name="bgrx8888_a8" value="0x38415842"/>
<entry name="rgb888_a8" value="0x38413852"/>
<entry name="bgr888_a8" value="0x38413842"/>
<entry name="rgb565_a8" value="0x38413552"/>
<entry name="bgr565_a8" value="0x38413542"/>
<entry name="nv24" value="0x3432564e" summary="non-subsampled Cr:Cb plane"/>
<entry name="nv42" value="0x3234564e" summary="non-subsampled Cb:Cr plane"/>
<entry name="p210" value="0x30313250" summary="2x1 subsampled Cr:Cb plane, 10 bit per channel"/>
<entry name="p010" value="0x30313050" summary="2x2 subsampled Cr:Cb plane 10 bits per channel"/>
<entry name="p012" value="0x32313050" summary="2x2 subsampled Cr:Cb plane 12 bits per channel"/>
<entry name="p016" value="0x36313050" summary="2x2 subsampled Cr:Cb plane 16 bits per channel"/>
<entry name="axbxgxrx106106106106" value="0x30314241" summary="[63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian"/>
<entry name="nv15" value="0x3531564e" summary="2x2 subsampled Cr:Cb plane"/>
<entry name="q410" value="0x30313451"/>
<entry name="q401" value="0x31303451"/>
<entry name="xrgb16161616" value="0x38345258" summary="[63:0] x:R:G:B 16:16:16:16 little endian"/>
<entry name="xbgr16161616" value="0x38344258" summary="[63:0] x:B:G:R 16:16:16:16 little endian"/>
<entry name="argb16161616" value="0x38345241" summary="[63:0] A:R:G:B 16:16:16:16 little endian"/>
<entry name="abgr16161616" value="0x38344241" summary="[63:0] A:B:G:R 16:16:16:16 little endian"/>
</enum>
<request name="create_pool">
@ -383,10 +438,15 @@
<interface name="wl_buffer" version="1">
<description summary="content for a wl_surface">
A buffer provides the content for a wl_surface. Buffers are
created through factory interfaces such as wl_drm, wl_shm or
similar. It has a width and a height and can be attached to a
wl_surface, but the mechanism by which a client provides and
updates the contents is defined by the buffer factory interface.
created through factory interfaces such as wl_shm, wp_linux_buffer_params
(from the linux-dmabuf protocol extension) or similar. It has a width and
a height and can be attached to a wl_surface, but the mechanism by which a
client provides and updates the contents is defined by the buffer factory
interface.
If the buffer uses a format that has an alpha channel, the alpha channel
is assumed to be premultiplied in the color channels unless otherwise
specified.
</description>
<request name="destroy" type="destructor">
@ -509,6 +569,9 @@
this request after a NULL mime type has been set in
wl_data_offer.accept or no action was received through
wl_data_offer.action.
If wl_data_offer.finish request is received for a non drag and drop
operation, the invalid_finish protocol error is raised.
</description>
</request>
@ -525,7 +588,7 @@
This request determines the final result of the drag-and-drop
operation. If the end result is that no action is accepted,
the drag source will receive wl_drag_source.cancelled.
the drag source will receive wl_data_source.cancelled.
The dnd_actions argument must contain only values expressed in the
wl_data_device_manager.dnd_actions enum, and the preferred_action
@ -546,8 +609,10 @@
This request can only be made on drag-and-drop offers, a protocol error
will be raised otherwise.
</description>
<arg name="dnd_actions" type="uint" summary="actions supported by the destination client"/>
<arg name="preferred_action" type="uint" summary="action preferred by the destination client"/>
<arg name="dnd_actions" type="uint" summary="actions supported by the destination client"
enum="wl_data_device_manager.dnd_action"/>
<arg name="preferred_action" type="uint" summary="action preferred by the destination client"
enum="wl_data_device_manager.dnd_action"/>
</request>
<event name="source_actions" since="3">
@ -556,7 +621,8 @@
will be sent right after wl_data_device.enter, or anytime the source
side changes its offered actions through wl_data_source.set_actions.
</description>
<arg name="source_actions" type="uint" summary="actions offered by the data source"/>
<arg name="source_actions" type="uint" summary="actions offered by the data source"
enum="wl_data_device_manager.dnd_action"/>
</event>
<event name="action" since="3">
@ -597,7 +663,8 @@
final wl_data_offer.set_actions and wl_data_offer.accept requests
must happen before the call to wl_data_offer.finish.
</description>
<arg name="dnd_action" type="uint" summary="action selected by the compositor"/>
<arg name="dnd_action" type="uint" summary="action selected by the compositor"
enum="wl_data_device_manager.dnd_action"/>
</event>
</interface>
@ -694,7 +761,8 @@
wl_data_device.start_drag. Attempting to use the source other than
for drag-and-drop will raise a protocol error.
</description>
<arg name="dnd_actions" type="uint" summary="actions supported by the data source"/>
<arg name="dnd_actions" type="uint" summary="actions supported by the data source"
enum="wl_data_device_manager.dnd_action"/>
</request>
<event name="dnd_drop_performed" since="3">
@ -750,7 +818,8 @@
Clients can trigger cursor surface changes from this point, so
they reflect the current action.
</description>
<arg name="dnd_action" type="uint" summary="action selected by the compositor"/>
<arg name="dnd_action" type="uint" summary="action selected by the compositor"
enum="wl_data_device_manager.dnd_action"/>
</event>
</interface>
@ -776,7 +845,8 @@
for the eventual data transfer. If source is NULL, enter, leave
and motion events are sent only to the client that initiated the
drag and the client is expected to handle the data passing
internally.
internally. If source is destroyed, the drag-and-drop session will be
cancelled.
The origin surface is the surface where the drag originates and
the client must have an active implicit grab that matches the
@ -890,9 +960,10 @@
immediately before receiving keyboard focus and when a new
selection is set while the client has keyboard focus. The
data_offer is valid until a new data_offer or NULL is received
or until the client loses keyboard focus. The client must
destroy the previous selection data_offer, if any, upon receiving
this event.
or until the client loses keyboard focus. Switching surface with
keyboard focus within the same client doesn't mean a new selection
will be sent. The client must destroy the previous selection
data_offer, if any, upon receiving this event.
</description>
<arg name="id" type="object" interface="wl_data_offer" allow-null="true"
summary="selection data_offer object"/>
@ -1274,10 +1345,12 @@
</event>
</interface>
<interface name="wl_surface" version="4">
<interface name="wl_surface" version="5">
<description summary="an onscreen surface">
A surface is a rectangular area that is displayed on the screen.
It has a location, size and pixel contents.
A surface is a rectangular area that may be displayed on zero
or more outputs, and shown any number of times at the compositor's
discretion. They can present wl_buffers, receive user input, and
define a local coordinate system.
The size of a surface (and relative positions on it) is described
in surface-local coordinates, which may differ from the buffer
@ -1323,6 +1396,8 @@
</description>
<entry name="invalid_scale" value="0" summary="buffer scale value is invalid"/>
<entry name="invalid_transform" value="1" summary="buffer transform value is invalid"/>
<entry name="invalid_size" value="2" summary="buffer size is invalid"/>
<entry name="invalid_offset" value="3" summary="buffer offset is invalid"/>
</enum>
<request name="destroy" type="destructor">
@ -1337,14 +1412,22 @@
The new size of the surface is calculated based on the buffer
size transformed by the inverse buffer_transform and the
inverse buffer_scale. This means that the supplied buffer
must be an integer multiple of the buffer_scale.
inverse buffer_scale. This means that at commit time the supplied
buffer size must be an integer multiple of the buffer_scale. If
that's not the case, an invalid_size error is sent.
The x and y arguments specify the location of the new pending
buffer's upper left corner, relative to the current buffer's upper
left corner, in surface-local coordinates. In other words, the
x and y, combined with the new surface size define in which
directions the surface's size changes.
directions the surface's size changes. Setting anything other than 0
as x and y arguments is discouraged, and should instead be replaced
with using the separate wl_surface.offset request.
When the bound wl_surface version is 5 or higher, passing any
non-zero x or y is a protocol violation, and will result in an
'invalid_offset' error being raised. To achieve equivalent semantics,
use wl_surface.offset.
Surface contents are double-buffered state, see wl_surface.commit.
@ -1365,10 +1448,19 @@
will not receive a release event, and is not used by the
compositor.
If a pending wl_buffer has been committed to more than one wl_surface,
the delivery of wl_buffer.release events becomes undefined. A well
behaved client should not rely on wl_buffer.release events in this
case. Alternatively, a client could create multiple wl_buffer objects
from the same backing storage or use wp_linux_buffer_release.
Destroying the wl_buffer after wl_buffer.release does not change
the surface contents. However, if the client destroys the
wl_buffer before receiving the wl_buffer.release event, the surface
contents become undefined immediately.
the surface contents. Destroying the wl_buffer before wl_buffer.release
is allowed as long as the underlying buffer storage isn't re-used (this
can happen e.g. on client process termination). However, if the client
destroys the wl_buffer before receiving the wl_buffer.release event and
mutates the underlying buffer storage, the surface contents become
undefined immediately.
If wl_surface.attach is sent with a NULL wl_buffer, the
following wl_surface.commit will remove the surface content.
@ -1545,6 +1637,12 @@
This is emitted whenever a surface's creation, movement, or resizing
results in it no longer having any part of it within the scanout region
of an output.
Clients should not use the number of outputs the surface is on for frame
throttling purposes. The surface might be hidden even if no leave event
has been sent, and the compositor might expect new surface content
updates even if no enter event has been sent. The frame event should be
used instead.
</description>
<arg name="output" type="object" interface="wl_output" summary="output left by the surface"/>
</event>
@ -1660,9 +1758,30 @@
<arg name="width" type="int" summary="width of damage rectangle"/>
<arg name="height" type="int" summary="height of damage rectangle"/>
</request>
<!-- Version 5 additions -->
<request name="offset" since="5">
<description summary="set the surface contents offset">
The x and y arguments specify the location of the new pending
buffer's upper left corner, relative to the current buffer's upper
left corner, in surface-local coordinates. In other words, the
x and y, combined with the new surface size define in which
directions the surface's size changes.
Surface location offset is double-buffered state, see
wl_surface.commit.
This request is semantically equivalent to and the replaces the x and y
arguments in the wl_surface.attach request in wl_surface versions prior
to 5. See wl_surface.attach for details.
</description>
<arg name="x" type="int" summary="surface-local x coordinate"/>
<arg name="y" type="int" summary="surface-local y coordinate"/>
</request>
</interface>
<interface name="wl_seat" version="4">
<interface name="wl_seat" version="7">
<description summary="group of input devices">
A seat is a group of keyboards, pointer and touch devices. This
object is published as a global during start up, or when such a
@ -1680,6 +1799,14 @@
<entry name="touch" value="4" summary="the seat has touch devices"/>
</enum>
<enum name="error">
<description summary="wl_seat error values">
These errors can be emitted in response to wl_seat requests.
</description>
<entry name="missing_capability" value="0"
summary="get_pointer, get_keyboard or get_touch called on seat without the matching capability"/>
</enum>
<event name="capabilities">
<description summary="seat capabilities changed">
This is emitted whenever a seat gains or loses the pointer,
@ -1718,7 +1845,8 @@
This request only takes effect if the seat has the pointer
capability, or has had the pointer capability in the past.
It is a protocol violation to issue this request on a seat that has
never had the pointer capability.
never had the pointer capability. The missing_capability error will
be sent in this case.
</description>
<arg name="id" type="new_id" interface="wl_pointer" summary="seat pointer"/>
</request>
@ -1731,7 +1859,8 @@
This request only takes effect if the seat has the keyboard
capability, or has had the keyboard capability in the past.
It is a protocol violation to issue this request on a seat that has
never had the keyboard capability.
never had the keyboard capability. The missing_capability error will
be sent in this case.
</description>
<arg name="id" type="new_id" interface="wl_keyboard" summary="seat keyboard"/>
</request>
@ -1744,7 +1873,8 @@
This request only takes effect if the seat has the touch
capability, or has had the touch capability in the past.
It is a protocol violation to issue this request on a seat that has
never had the touch capability.
never had the touch capability. The missing_capability error will
be sent in this case.
</description>
<arg name="id" type="new_id" interface="wl_touch" summary="seat touch interface"/>
</request>
@ -1753,16 +1883,29 @@
<event name="name" since="2">
<description summary="unique identifier for this seat">
In a multiseat configuration this can be used by the client to help
identify which physical devices the seat represents. Based on
the seat configuration used by the compositor.
In a multi-seat configuration the seat name can be used by clients to
help identify which physical devices the seat represents.
The seat name is a UTF-8 string with no convention defined for its
contents. Each name is unique among all wl_seat globals. The name is
only guaranteed to be unique for the current compositor instance.
The same seat names are used for all clients. Thus, the name can be
shared across processes to refer to a specific wl_seat global.
The name event is sent after binding to the seat global. This event is
only sent once per seat object, and the name does not change over the
lifetime of the wl_seat global.
Compositors may re-use the same seat name if the wl_seat global is
destroyed and re-created later.
</description>
<arg name="name" type="string" summary="seat identifier"/>
</event>
<!-- Version 5 additions -->
<request name="release" type="destructor" since="4">
<request name="release" type="destructor" since="5">
<description summary="release the seat object">
Using this request a client can tell the server that it is not going to
use the seat object anymore.
@ -1820,6 +1963,10 @@
wl_surface is no longer used as the cursor. When the use as a
cursor ends, the current and pending input regions become
undefined, and the wl_surface is unmapped.
The serial parameter must match the latest wl_pointer.enter
serial number sent to the client. Otherwise the request will be
ignored.
</description>
<arg name="serial" type="uint" summary="serial number of the enter event"/>
<arg name="surface" type="object" interface="wl_surface" allow-null="true"
@ -2114,7 +2261,8 @@
<event name="keymap">
<description summary="keyboard mapping">
This event provides a file descriptor to the client which can be
memory-mapped to provide a keyboard mapping description.
memory-mapped in read-only mode to provide a keyboard mapping
description.
From version 7 onwards, the fd must be mapped with MAP_PRIVATE by
the recipient, as MAP_SHARED may fail.
@ -2128,6 +2276,9 @@
<description summary="enter event">
Notification that this seat's keyboard focus is on a certain
surface.
The compositor must send the wl_keyboard.modifiers event after this
event.
</description>
<arg name="serial" type="uint" summary="serial number of the enter event"/>
<arg name="surface" type="object" interface="wl_surface" summary="surface gaining keyboard focus"/>
@ -2141,6 +2292,9 @@
The leave notification is sent before the enter notification
for the new focus.
After this event client must assume that all keys, including modifiers,
are lifted and also it must stop key repeating if there's some going on.
</description>
<arg name="serial" type="uint" summary="serial number of the leave event"/>
<arg name="surface" type="object" interface="wl_surface" summary="surface that lost keyboard focus"/>
@ -2159,6 +2313,12 @@
A key was pressed or released.
The time argument is a timestamp with millisecond
granularity, with an undefined base.
The key is a platform-specific key code that can be interpreted
by feeding it to the keyboard mapping (see the keymap event).
If this event produces a change in modifiers, then the resulting
wl_keyboard.modifiers event must be sent after this event.
</description>
<arg name="serial" type="uint" summary="serial number of the key event"/>
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
@ -2352,7 +2512,7 @@
</event>
</interface>
<interface name="wl_output" version="3">
<interface name="wl_output" version="4">
<description summary="compositor output region">
An output describes part of the compositor geometry. The
compositor works in the 'compositor coordinate system' and an
@ -2408,12 +2568,15 @@
The physical size can be set to zero if it doesn't make sense for this
output (e.g. for projectors or virtual outputs).
The geometry event will be followed by a done event (starting from
version 2).
Note: wl_output only advertises partial information about the output
position and identification. Some compositors, for instance those not
implementing a desktop-style output layout or those exposing virtual
outputs, might fake this information. Instead of using x and y, clients
should use xdg_output.logical_position. Instead of using make and model,
clients should use xdg_output.name and xdg_output.description.
clients should use name and description.
</description>
<arg name="x" type="int"
summary="x position within the global compositor space"/>
@ -2454,6 +2617,10 @@
current. In other words, the current mode is always the last
mode that was received with the current flag set.
Non-current modes are deprecated. A compositor can decide to only
advertise the current mode and never send other modes. Clients
should not rely on non-current modes.
The size of a mode is given in physical hardware units of
the output device. This is not necessarily the same as
the output size in the global compositor space. For instance,
@ -2462,6 +2629,12 @@
willing to retrieve the output size in the global compositor
space should use xdg_output.logical_size instead.
The vertical refresh rate can be set to zero if it doesn't make
sense for this output (e.g. for virtual outputs).
The mode event will be followed by a done event (starting from
version 2).
Clients should not use the refresh rate to schedule frames. Instead,
they should use the wl_surface.frame event or the presentation-time
protocol.
@ -2508,6 +2681,8 @@
the scale of the output. That way the compositor can
avoid scaling the surface, and the client can supply
a higher detail image.
The scale event will be followed by a done event.
</description>
<arg name="factor" type="int" summary="scaling factor of output"/>
</event>
@ -2520,6 +2695,62 @@
use the output object anymore.
</description>
</request>
<!-- Version 4 additions -->
<event name="name" since="4">
<description summary="name of this output">
Many compositors will assign user-friendly names to their outputs, show
them to the user, allow the user to refer to an output, etc. The client
may wish to know this name as well to offer the user similar behaviors.
The name is a UTF-8 string with no convention defined for its contents.
Each name is unique among all wl_output globals. The name is only
guaranteed to be unique for the compositor instance.
The same output name is used for all clients for a given wl_output
global. Thus, the name can be shared across processes to refer to a
specific wl_output global.
The name is not guaranteed to be persistent across sessions, thus cannot
be used to reliably identify an output in e.g. configuration files.
Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do
not assume that the name is a reflection of an underlying DRM connector,
X11 connection, etc.
The name event is sent after binding the output object. This event is
only sent once per output object, and the name does not change over the
lifetime of the wl_output global.
Compositors may re-use the same output name if the wl_output global is
destroyed and re-created later. Compositors should avoid re-using the
same name if possible.
The name event will be followed by a done event.
</description>
<arg name="name" type="string" summary="output name"/>
</event>
<event name="description" since="4">
<description summary="human-readable description of this output">
Many compositors can produce human-readable descriptions of their
outputs. The client may wish to know this description as well, e.g. for
output selection purposes.
The description is a UTF-8 string with no convention defined for its
contents. The description is not guaranteed to be unique among all
wl_output globals. Examples might include 'Foocorp 11" Display' or
'Virtual X11 output via :1'.
The description event is sent after binding the output object and
whenever the description changes. The description is optional, and may
not be sent at all.
The description event will be followed by a done event.
</description>
<arg name="description" type="string" summary="output description"/>
</event>
</interface>
<interface name="wl_region" version="1">
@ -2643,7 +2874,7 @@
wl_surface state directly. A sub-surface is initially in the
synchronized mode.
Sub-surfaces have also other kind of state, which is managed by
Sub-surfaces also have another kind of state, which is managed by
wl_subsurface requests, as opposed to wl_surface requests. This
state includes the sub-surface position relative to the parent
surface (wl_subsurface.set_position), and the stacking order of

BIN
app/src/main/jni/prebuilt/x86_64/libwayland-server.so

Binary file not shown.

2
app/src/main/res/layout/main_activity.xml

@ -15,7 +15,7 @@
</FrameLayout>
<com.termux.x11.AdditionalKeyboardView
<me.sergiotarxz.openmg.x11.AdditionalKeyboardView
android:id="@+id/additionalKbd"
android:layout_width="match_parent"
android:layout_height="wrap_content"

2
app/src/main/res/xml/preferences.xml

@ -34,7 +34,7 @@
<EditTextPreference
android:title="Custom XDG_RUNTIME_DIR"
android:defaultValue="/data/data/com.termux/files/usr/tmp"
android:defaultValue="/data/data/me.sergiotarxz.openmg.x11/files/usr/tmp"
android:key="CustXDG"
android:summary="Set the XDG runtime directory for wayland sockets"
android:dialogMessage="Changes to this preference will apply on app restart" />

2
build_termux_package

@ -9,7 +9,7 @@ NDKBUILD_DIR=starter/build/intermediates/ndkBuild/debug/obj/local
DATA_DIR=$INTERMEDIATES/data
CONTROL_DIR=$INTERMEDIATES/control
PACKAGE_DIR=$INTERMEDIATES/package
PREFIX=$DATA_DIR/data/data/com.termux/files/usr
PREFIX=$DATA_DIR/data/data/me.sergiotarxz.openmg.x11/files/usr
rm -rf $PACKAGE_PATH $DATA_DIR $CONTROL_DIR $PACKAGE_DIR

2
common/src/main/AndroidManifest.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.termux.x11.common">
package="me.sergiotarxz.openmg.x11.common">
</manifest>

2
common/src/main/aidl/com/termux/x11/common/ITermuxX11Internal.aidl → common/src/main/aidl/me/sergiotarxz/openmg/x11/common/ITermuxX11Internal.aidl

@ -1,4 +1,4 @@
package com.termux.x11.common;
package me.sergiotarxz.openmg.x11.common;
// This interface is used by utility on termux side.
interface ITermuxX11Internal {

2
starter/build.gradle

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.termux.termuxam"
applicationId "me.sergiotarxz.openmg.termuxam"
minSdkVersion 21
// Note: targetSdkVersion affects only tests,
// normally, even though this is packaged as apk,

2
starter/src/main/AndroidManifest.xml

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.termux.x11.starter">
package="me.sergiotarxz.openmg.x11.starter">
<application
android:label="TermuxX11Starter"

2
starter/src/main/java/com/termux/x11/starter/ActivityManager.java → starter/src/main/java/me/sergiotarxz/openmg/x11/starter/ActivityManager.java

@ -1,4 +1,4 @@
package com.termux.x11.starter;
package me.sergiotarxz.openmg.x11.starter;
/**
* \@hide-hidden constants

2
starter/src/main/java/com/termux/x11/starter/CrossVersionReflectedMethod.java → starter/src/main/java/me/sergiotarxz/openmg/x11/starter/CrossVersionReflectedMethod.java

@ -1,4 +1,4 @@
package com.termux.x11.starter;
package me.sergiotarxz.openmg.x11.starter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

2
starter/src/main/java/com/termux/x11/starter/ExecHelper.java → starter/src/main/java/me/sergiotarxz/openmg/x11/starter/ExecHelper.java

@ -1,4 +1,4 @@
package com.termux.x11.starter;
package me.sergiotarxz.openmg.x11.starter;
import android.os.ParcelFileDescriptor;

4
starter/src/main/java/com/termux/x11/starter/IActivityManager.java → starter/src/main/java/me/sergiotarxz/openmg/x11/starter/IActivityManager.java

@ -1,4 +1,4 @@
package com.termux.x11.starter;
package me.sergiotarxz.openmg.x11.starter;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
@ -29,7 +29,7 @@ class IActivityManager {
private CrossVersionReflectedMethod mIntentSenderSendMethod;
IActivityManager() throws Exception {
this("com.termux");
this("me.sergiotarxz.openmg.x11");
}
IActivityManager(String callingAppName) throws Exception {

25
starter/src/main/java/com/termux/x11/starter/Starter.java → starter/src/main/java/me/sergiotarxz/openmg/x11/starter/Starter.java

@ -16,7 +16,7 @@
*/
package com.termux.x11.starter;
package me.sergiotarxz.openmg.x11.starter;