Java全屏在Linux上 – 如何覆盖任务栏?

前端之家收集整理的这篇文章主要介绍了Java全屏在Linux上 – 如何覆盖任务栏?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我读了一些相关的文章,并且Googled了很多..我有一个问题,以“openSUSE 11.4(x86_64)”的全屏模式运行 Java应用程序.我正在使用 Java 1.6.0_26-b03.

我试图运行两个全屏应用程序的例子:

> Oracle网站示例:Display Mode Test.
>从Codealchemists下载的JDarkRoom.jar(简单文本编辑器).

在这两种情况下,我有一个Linux任务栏在应用程序中可见.它必须是系统设置/配置的东西?

问候.

解决方法

你应该能够通过GraphicsDevice.setFullScreenWindow(窗口)去“真正的全屏”.然而,由于在最流行的Java运行时的错误,这可能不适用于在1.6 = Java 6系列中运行某些“破碎”版本的系统.我还没有彻底地测试过,所以可能补丁还没有传播给普通民众.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7057287

背景/理论

好的,所以这里有太多的信息,没有足够的帮助…这里有一点为什么这不工作正确…

There is no Linux Desktop

Linux-based operating systems on PC-type machines,as well as other Unices (with a partial exception for MacOSX),normally use the X Window System (aka X11). Under X,you have an X Server (usually,something kinda like a “video driver”) and clients that connect to it,more often than not,from the same machine (loopback).

The layout and placement of windows is controlled by a special client program,called the Window Manager. It’s responsible for decorating the windows (e.g. drawing title bars or resize handles) and positioning them.

Your program would be an X client. It can request — but not demand — placement on the screen at a certain position,or a certain size. VarIoUs Window Managers are more (or less) prone to giving you what you want.

Except,most desktops play nicely (sometimes)

Now,by far,most Linux desktops use the Gnome Desktop,with a strong second place for the K Desktop,and a few others are in fairly wide use. What’s “nice” is that both of these desktop environments (as well as some others,like XFCE for low-end PC’s) conform to the FreeDesktop.org Window Manager Hints standards.

(Super-over-simplification:) Typically,there will be Panels on one or more edges of the screen. Usually,there’s just one,across the top,but there are many variations. These Panel areas are not considered “part of the screen,” so the Window Manager tells your application,“no,that’s outside of the area in which you’re allowed to play; this screen is not 1920×1080,it’s only 1890×1080.” Of course,that could be totally different arrangement than what you’d anticipated when you wrote your app,and you might be on my netbook with a physical screen of 800×480 pretending to be only 780×480.

For 99% of apps,that’s great. Windows don’t get in the way of the Panels,so you can always reach the Panel for critical controls,like hitting Mute or switching to another program or something.

These “hints” allow you to request that your top-level windows get treated specially. For example,you can request that you get no title bar — or a reduced,“palette” type title bar; you can request to be skipped on the window list or task bar or activities overview or whatever other interface might be used to show the active windows; or,you can request to go really full-screen,and push everything else out of the way,even panels.

The spec is here: 07001

失败:

基本上,窗口管理器的提示Sun / Oracle(或Red Hat,Sun / Oracle或IBM可能会因为可能也是这样做)而被正确地遵循了这个规范,但是我没有看到有人抱怨他们)…

虽然,我确实看到有一些是来自于K桌面环境的窗口管理器(KWin)的错误(特别是),显然这个bug只出现在K中,而不是在Gnome,XFCE和朋友中出现.

变通

除了修补您的Java运行时(和/或您的客户)之外,唯一真正的修复将是使用平台特定的Java库(可能使用反射… eww …获取基础的AWT对象),并自己设置正确的窗口提示.

是的,这很大

原文链接:https://www.f2er.com/java/123541.html

猜你在找的Java相关文章