You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Touch screen works in my desktop. I can open apps and navigate folders by my fingers through my touch screen device in front of my monitor. It means H/W and OS recognize the touch screen device and work. However, my very simple libgdx3 app does not get any inputs. The app I created is receiving mouse events perfectly, so I believe the issue is not with the app itself.
package kr.co.rexlab.test01.lwjgl3;
import org.lwjgl.system.macosx.LibC;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
public class StartupHelper {
private static final String JVM_RESTARTED_ARG = "jvmIsRestarted";
private StartupHelper() {
throw new UnsupportedOperationException();
}
public static boolean startNewJvmIfRequired(boolean redirectOutput) {
String osName = System.getProperty("os.name").toLowerCase();
if (!osName.contains("mac")) {
if (osName.contains("windows")) {
System.setProperty("java.io.tmpdir", System.getenv("ProgramData") + "/libGDX-temp");
}
return false;
}
if (!System.getProperty("org.graalvm.nativeimage.imagecode", "").isEmpty()) {
return false;
}
long pid = LibC.getpid();
if ("1".equals(System.getenv("JAVA_STARTED_ON_FIRST_THREAD_" + pid))) {
return false;
}
if ("true".equals(System.getProperty(JVM_RESTARTED_ARG))) {
System.err.println(
"There was a problem evaluating whether the JVM was started with the -XstartOnFirstThread argument.");
return false;
}
ArrayList<String> jvmArgs = new ArrayList<>();
String separator = System.getProperty("file.separator");
String javaExecPath = System.getProperty("java.home") + separator + "bin" + separator + "java";
if (!(new File(javaExecPath)).exists()) {
System.err.println(
"A Java installation could not be found. If you are distributing this app with a bundled JRE, be sure to set the -XstartOnFirstThread argument manually!");
return false;
}
jvmArgs.add(javaExecPath);
jvmArgs.add("-XstartOnFirstThread");
jvmArgs.add("-D" + JVM_RESTARTED_ARG + "=true");
jvmArgs.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments());
jvmArgs.add("-cp");
jvmArgs.add(System.getProperty("java.class.path"));
String mainClass = System.getenv("JAVA_MAIN_CLASS_" + pid);
if (mainClass == null) {
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
if (trace.length > 0) {
mainClass = trace[trace.length - 1].getClassName();
} else {
System.err.println("The main class could not be determined.");
return false;
}
}
jvmArgs.add(mainClass);
try {
if (!redirectOutput) {
ProcessBuilder processBuilder = new ProcessBuilder(jvmArgs);
processBuilder.start();
} else {
Process process = (new ProcessBuilder(jvmArgs))
.redirectErrorStream(true).start();
BufferedReader processOutput = new BufferedReader(
new InputStreamReader(process.getInputStream()));
String line;
while ((line = processOutput.readLine()) != null) {
System.out.println(line);
}
process.waitFor();
}
} catch (Exception e) {
System.err.println("There was a problem restarting the JVM");
e.printStackTrace();
}
return true;
}
public static boolean startNewJvmIfRequired() {
return startNewJvmIfRequired(true);
}
}
openjdk version : 17.0.2
Linux lex-test2404-string 6.8.0-48-generic #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ubuntu 24.04
Stacktrace
Please select the affected platforms
[V] Linux
More information
I created very simple Java app to verify my openjdk is problem. A source is following.
import java.awt.*;
public class Main {
public static void main(String[] args) {
Frame f = new Frame("login");
f.setSize(300,200);
Button b = new Button("ok");
b.setSize(100,50);
f.add(b);
f.setVisible(true);
}
}
The button in the source is response to touch down of my fingers. And, my libgdx app is response to touch down when I switched from Wayland to X11. Therefore I conclude libgdx input receiving component can not receive touch screen input event in Wayland in Ubuntu 24.04.
The text was updated successfully, but these errors were encountered:
Issue details
Touch screen works in my desktop. I can open apps and navigate folders by my fingers through my touch screen device in front of my monitor. It means H/W and OS recognize the touch screen device and work. However, my very simple libgdx3 app does not get any inputs. The app I created is receiving mouse events perfectly, so I believe the issue is not with the app itself.
Reproduction steps/code
--------------------------------- Main.kt -----------------------------
-------------------------------- Lwjgl3Launcher -----------------------------------
-------------------------- StartupHelper ---------------------------------
Version of libGDX and/or relevant dependencies
org.gradle.daemon=false
org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8
org.gradle.configureondemand=false
kotlinVersion=2.0.21
graalHelperVersion=2.0.1
enableGraalNative=false
gdxVersion=1.13.0
projectVersion=1.0.0
org.gradle.java.home=/home/lex/openjdk/java
openjdk version : 17.0.2
Linux lex-test2404-string 6.8.0-48-generic #48-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 14:04:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ubuntu 24.04
Stacktrace
Please select the affected platforms
More information
I created very simple Java app to verify my openjdk is problem. A source is following.
The button in the source is response to touch down of my fingers. And, my libgdx app is response to touch down when I switched from Wayland to X11. Therefore I conclude libgdx input receiving component can not receive touch screen input event in Wayland in Ubuntu 24.04.
The text was updated successfully, but these errors were encountered: