Linux全屏幕Java - 如何覆盖任务栏? [英] Java in full screen on Linux - how to cover task bar?

查看:160
本文介绍了Linux全屏幕Java - 如何覆盖任务栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在openSUSE 11.4(x86_64)上以全屏模式运行Java应用程序时遇到问题。我正在使用Java 1.6.0_26-b03。

I have a problem to run Java application in full screen mode on "openSUSE 11.4 (x86_64)". I am using Java 1.6.0_26-b03.

我尝试运行两个全屏应用程序示例:

I have try to run two examples of full screen application:


  1. 来自Oracle站点的示例:显示模式测试

  2. 下载了JDarkRoom.jar(简单文本编辑器)来自 Codealchemists

  1. Example from Oracle site: Display Mode Test.
  2. JDarkRoom.jar (simple text editor) downloaded from Codealchemists.

在这两种情况下,我都可以在应用程序上看到一个Linux任务栏。它必须是系统设置/配置的东西?

In both cases I have a Linux Task bar visible over the application. It must be something with system settings/configuration?

推荐答案

能够真的去全屏与 GraphicsDevice.setFullScreenWindow(窗口)。但是,由于最流行的Java运行时中的错误,这可能无法在1.6 = Java 6系列中运行某些损坏版本的系统上运行。我没有彻底测试过,所以可能是补丁还没有传播给普通民众。

You should be able to go "really full screen" with GraphicsDevice.setFullScreenWindow (window). However, due to bugs in the most popular Java runtimes, this may not work on systems running certain "broken" versions in the 1.6 = Java 6 series. I haven't tested this thoroughly, so it may be that the patch hasn't propagated out to the general populace, yet.

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

背景/理论

好的,所以这里有太多的信息,而且没有足够的帮助...这里有一些为什么这不能正常工作......

OK, so here goes for too much information, and not enough help… Here's a bit of why this didn't work right…


没有Linux桌面

PC型机器上的基于Linux的操作系统,以及其他Unices(MacOSX的部分例外),通常使用X Window系统(又名X11​​)。在X下,你有一个X服务器(通常,有点像视频驱动程序)和客户端连接到它,通常是从同一台机器(环回)。

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.

您的程序将是X客户端。它可以请求 - 但不能需求 - 在屏幕上的某个位置或特定大小的位置。各种窗口管理员更多(或更少)倾向于为您提供您想要的东西。

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.

除了,大多数桌面都能很好地播放

现在,到目前为止,大多数Linux桌面都使用Gnome桌面,K桌面排名第二,其他一些桌面公平广泛使用。什么是好的是这两个桌面环境(以及其他一些桌面环境,如低端PC的XFCE)符合 FreeDesktop.org窗口管理器提示标准。

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.

(超简化:)通常,屏幕的一个或多个边缘上会有面板。通常,顶部只有一个,但有许多变体。这些面板区域不被视为屏幕的一部分,因此窗口管理器告诉您的应用程序,不,这不在您允许玩的区域之外;这个屏幕不是1920×1080,它只有1890×1080。当然,这可能与您编写应用程序时的预期完全不同,而且您可能在我的上网本上使用800×的物理屏幕480假装只有780×480。

(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.

99%的应用程序,这很棒。 Windows不会妨碍面板,因此您可以随时访问Panel以获取关键控件,例如点击静音或切换到其他程序等。

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.

规范在这里: http://standards.freedesktop.org/wm-spec/wm- spec-latest.html

并且失败:

基本上,Sun / Oracle(或者Red Hat,他们复制了Sun / Oracle,或者可能是IBM,因为他们可能做了同样的事情,但我没有正确遵循窗口管理器提示规范)没有人抱怨他们)...

Basically, the window manager hints specification wasn't being followed correctly by Sun/Oracle (or Red Hat, who copied off Sun/Oracle, or probably IBM, because they probably did the same, but I don't see anybody complaining about them)…

尽管如此,我确实看到一些关于K Desktop Environment的窗口管理器是否存在错误(特别是)的问题(KWin),因为显然这个bug只出现在K中,而不是在Gnome,XFCE和朋友中。

Although, I do see some griping back and forth about whether it's a bug (specifically) with the K Desktop Environment's window manager (KWin), as apparently this bug only shows up in K, and not in Gnome, XFCE, and friends.

解决方法

除了修补Java运行时(和/或你的客户),唯一真正的解决方法是使用特定于平台的Java库(也许使用反射......来获取底层的AWT对象......)并自己设置正确的窗口提示。

Aside from patching your Java runtimes (and/or your customers'), the only real fix would be to use the platform-specific Java libraries (perhaps grab the underlying AWT objects using reflection… eww…) and set the proper window hints, yourself.

是的,这是毛重......

Yes, that's gross…

这篇关于Linux全屏幕Java - 如何覆盖任务栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆