如何修复 Java-GUI 程序(swing),使其与 Awesome-wm 一起使用?

发布于 2024-07-16 15:38:36 字数 275 浏览 11 评论 0原文

Java 程序的 swing-UI 不能与 awesome-wm 完美配合。 Awesome 是 UNIX 的窗口管理器,它自动调整程序窗口的大小,而 Swing-UI 无法正确识别这些调整大小。 我不在乎 Awesome 或 Java 是否有罪,我想知道我是否可以以某种方式改变我的 Java 程序,让它们能够与 Awesome 一起工作。 这样我的程序的用户即使使用异国情调的窗口管理器也能获得正确的体验。

The swing-UI of Java-programs doesn't work perfectly together with the awesome-wm. awesome is a window-manager for UNIX, that automatically resizes program-windows, and the Swing-UI doesn't recognize these resizes correctly. I don't care if awesome or Java is guilty, what I wanna know if I can change my Java-programs in a way, that they will work with awesome. So that users of my programs get the correct experience, even when they use exotic window-managers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦幻的味道 2024-07-23 15:38:36

最简单的解决方法 - 获取 wmname fromuckless 并使用它将窗口管理器的名称设置为 LG3D:

wmname LG3D

98%到时候这将解决这个问题。

Easiest workaround - get wmname from suckless and use it to set the name of the window manager to LG3D:

wmname LG3D

98% of the time this will fix the issue.

茶花眉 2024-07-23 15:38:36

来自 Awesome 的手册页:

BUGS
   Of course there´s no bug in awesome. But there may be unexpected behaviours.

   Java applications which use the XToolkit/XAWT backend may draw grey windows only. The XToolkit/XAWT backend breaks ICCCM-compliance
   in recent JDK 1.5 and early JDK 1.6 versions, because it assumes a reparenting window manager. As a workaround you can use JDK 1.4
   (which doesn´t contain the XToolkit/XAWT backend) or you can set the following environment variable (to use the older Motif backend
   instead): AWT_TOOLKIT=MToolkit

From the man page of awesome:

BUGS
   Of course there´s no bug in awesome. But there may be unexpected behaviours.

   Java applications which use the XToolkit/XAWT backend may draw grey windows only. The XToolkit/XAWT backend breaks ICCCM-compliance
   in recent JDK 1.5 and early JDK 1.6 versions, because it assumes a reparenting window manager. As a workaround you can use JDK 1.4
   (which doesn´t contain the XToolkit/XAWT backend) or you can set the following environment variable (to use the older Motif backend
   instead): AWT_TOOLKIT=MToolkit
我做我的改变 2024-07-23 15:38:36

可能发现这与使用 Compiz 和 Java(至少在 Ubuntu 上)遇到的问题类似,但我猜测。

解决此问题的方法(取自此处)是将以下环境变量添加到您的程序:

AWT_TOOLKIT="MToolkit"

You might find that this is a similar problem to that experienced with using Compiz and Java (on Ubuntu at least), but I am guessing.

The fix for this (taken from here) is to add the following environment variable to your program:

AWT_TOOLKIT="MToolkit"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文