-
-
Notifications
You must be signed in to change notification settings - Fork 956
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
Wrong window title displayed in GNOME top bar #956
Wrong window title displayed in GNOME top bar #956
Comments
It's due to a missing StartupWMClass key in the desktop file to allow GNOME Shell identify the application and display the right name.
|
@bilelmoussaoui conflicts with cryptomator/cryptomator-linux#10 |
@overheadhunter I should have mentioned that the WMClass I used was the one from the flatpak package. Not sure if it's the correct one |
I'm not sure if it's that simple. The StartupWMClass entry only provides a way to group windows of the same application together. It cannot be used to assign the WM class to an application. Btw, in the current snapshot version the window title says "java" (see screenshot) and the WM class is also "java" which means that |
Calling native functions is within the realm of possibility. 😉 We have already done that for Windows and macOS but it wasn't needed for Linux yet. But of course, if there is another (and much simpler) way, that would definitely be preferred. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I fixed this in my Ubuntu 18.04 PPA install by adding this line at the end of
@overheadhunter what's the conflict with cryptomator/cryptomator-linux#10? I'm not getting multiple icons in the dock with this fix. |
I was referring to the fix suggested by @bilelmoussaoui, who then confirmed he used the class name from the flatpak "prototype". For the latest 1.4.x release |
I submitted a pull request on Cryptomator's AUR to fix this issue there too. |
Hey, the current $ xprop WM_CLASS
WM_CLASS(STRING) = "java", "java" for So currently one has to set Whats also annoying, is, that one can't add the application to the gnome dock, unless the
|
@swiesend If you fixed this for the PPA, do you think it can be fixed for the AppImage (see desktop file) as well? If so, would you mind submitting a PR to cryptomator/cryptomator-linux and explain your findings a bit more? |
I'll check. |
Well I spent a lot of time to find a nice solution for the AppImage, but did not succeed. I think the easiest, but dirties solution is to just change the The idea IDE e.g. stores a Some sites I've been to:
https://wiki.gnome.org/HowDoI/GtkApplication
$ ./launcher-linux.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/objectweb/asm/ClassAdapter
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3244)
at java.base/java.lang.Class.getDeclaredMethod(Class.java:2551)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:454)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassAdapter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 14 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Aborted (core dumped)
http://java-gnome.sourceforge.net/ https://stackoverflow.com/a/50119254/4992066 https://stackoverflow.com/a/39319003/4992066 |
I found the There seem to be two Or one could manipulate the package javafx.application;
public abstract class Application {
public static void launch(Class<? extends Application> appClass, String... args) {
LauncherImpl.launchApplication(appClass, args);
}
...
public static void launch(String... args) {
...
try {
Class theClass = Class.forName(callingClassName, false,
Thread.currentThread().getContextClassLoader());
if (Application.class.isAssignableFrom(theClass)) {
Class<? extends Application> appClass = theClass;
LauncherImpl.launchApplication(appClass, args);
} else {
throw new RuntimeException("Error: " + theClass
+ " is not a subclass of javafx.application.Application");
}
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
... package com.sun.javafx.application;
public class LauncherImpl {
...
private static void launchApplication1(final Class<? extends Application> appClass,
final Class<? extends Preloader> preloaderClass,
final String[] args) throws Exception {
...
PlatformImpl.runAndWait(() -> {
try {
Constructor<? extends Application> c = appClass.getConstructor();
app.set(c.newInstance());
// Set startup parameters
ParametersImpl.registerParameters(app.get(), new ParametersImpl(args));
PlatformImpl.setApplicationName(appClass);
} catch (Throwable t) {
System.err.println("Exception in Application constructor");
constructorError = t;
error = true;
}
}); package com.sun.javafx.application;
public class PlatformImpl {
/**
* Sets the name of the this application based on the Application class.
* This method is called by the launcher, and is not
* called from the FX Application Thread, so we need to do it in a runLater.
* We do not need to wait for the result since it will complete before the
* Application start() method is called regardless.
*
* @param appClass the Application class.
*/
public static void setApplicationName(final Class appClass) {
runLater(() -> com.sun.glass.ui.Application.GetApplication().setName(appClass.getName()));
}
... package com.sun.glass.ui;
public abstract class Application {
private final static String DEFAULT_NAME = "java";
protected String name = DEFAULT_NAME;
...
/**
* Sets the name for the application. The application name may
* be used to identify the application in the user interface or
* as part of the platform specific path used to store application
* data.
*
* The name could be set only once. All subsequent calls are ignored.
*
* This is a hint and may not be used on some platforms.
*
* @param name the new application name
*/
public void setName(String name) {
checkEventThread();
if (name != null && DEFAULT_NAME.equals(this.name)) {
this.name = name;
}
} |
Wow thanks for that intensive research!
Well Cryptomator doesn't use the "traditional" JavaFX launch. Instead it first launches a "normal" headless java process and checks if it should start "hidden". The JavaFX application itself is launched lazily (if at all). If one chooses to have a tray icon, AWT will initialize before JavaFX does. So there is no clear "main" entry point from a window manager's perspective. Maybe by disabling the tray icon you will get different results? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
With #2139 merged, the |
I tested this on a Ubuntu 22.04 VM and it works as expected 🙂 |
Description
With GNOME 3.32.2, the wrong window title is displayed in the top bar when the Cryptomator window is focused.
System Setup
Steps to Reproduce
Expected Behavior
Cryptomator
will be displayed as the window's title.Actual Behavior
org.cryptomator.launcher.Cryptomator$MainApp
is displayed as the window's title.Reproducibility
Always
Additional Information
This bug is occurring on a fresh Manjaro installation with no prior use of Cryptomator.
The text was updated successfully, but these errors were encountered: