-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Add Hostname to Title Bar when X11 Forwarding #825
Comments
Are you using FlatLaf window decorations, enabled with Could you post a screenshot that shows a title bar with a host name? |
Thanks. Is the hostname shown in each window? |
So the last question is: where to get the hostname from? |
On the remote machine, via ssh -X :
That doesn't seem right. I know very little of X but I think what's happening is ssh is faking out the server (remote) system to make it think X is running directly on it even though it's really running on my local (client) machine. I had thought I'd get a different value in the titlebar depending on how I connected, but I tried using the IP instead of the hostname, and the titlebar still shows the hostname, not the IP I expected. So, I think the right value will be one of:
The real trick will be determining that X11 forwarding is happening. I think the DISPLAY variable might tell you that? Normally it says DISPLAY=:1 which I think means no forwarding is happening. But if it's set to 'localhost:' it's likely X11 forwarding is happening? Sorry, I'm not entirely clear on the exact meanings of all these variables. |
What's the value of I think following could work: String display = System.getenv("DISPLAY");
if( !display.startsWith( ":" ) && !display.startsWith( "localhost:" ) ) {
// X11 forwarding
// append System.getenv("HOSTNAME") to title
} |
That seems promising to me. I get the same value for DISPLAY from within the java code using System.getenv("DISPLAY"):
|
Hmm, I'm still confused a little bit... In the meantime, I've found the source code in window manager Mutter, The |
In case it helps, here is my test code as it currently stands:
Just uncomment that one line to see the hostname text go away. Put the Java application on machineA and then from machineB run "ssh -X machineA" and run the Java application over that connection. |
When running via X11 forwarding, the application is run on a remote host but the UI is forwarded to a client machine and displayed there. The standard title bar adds the remote hostname to the titlebar so the user knows which machine the application is actually running on.
Since we switched to FlatLaf, our users miss this information. It would be nice if FlatLaf added the hostname to the title (or failing that, a tooltip of the titlebar) when running via X11 forwarding.
The text was updated successfully, but these errors were encountered: