Mono winforms 应用程序在 Ubuntu 中全屏显示? [英] Mono winforms app fullscreen in Ubuntu?
问题描述
只是想知道是否有一种已知的方法可以让 Mono System.Windows.Forms 应用程序在 Ubuntu/Gnome 上全屏显示.
Just wondering if there's a known way of getting a Mono System.Windows.Forms application to go fullscreen on Ubuntu/Gnome.
单声道是 2.4.2.3Ubuntu 是 9.10
Mono is 2.4.2.3 Ubuntu is 9.10
在 Windows 上执行此操作需要 pinvoke,显然无法在这里工作.
Doing it on Windows requires a pinvoke, clearly not going to work here.
这是我将窗口边框设置为无,窗口位置设置为中心,状态设置为最大化:
This is what I get setting window border to none, window position to centre, and state to maximised:
替代文字 http://dl.dropbox.com/u/116092/misc/permalink/joggler/screenshot01.png
更新.
也试过了:
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
CTRL-F11
文本 = string.Empty;//没有标题
最大化框 = 假;
最小化框 = 假;
控制框 = 假;
FormBorderStyle = 无;
WindowState = 最大化;
Text = string.Empty; // No caption
MaximizeBox = false;
MinimizeBox = false;
ControlBox = false;
FormBorderStyle = None;
WindowState = Maximized;
FormBorderStyle = FormBorderStyle.None;
位置 = 新点 (0, 0);
大小 = Screen.PrimaryScreen.Bounds.Size;
FormBorderStyle = FormBorderStyle.None;
Location = new Point(0, 0);
Size = Screen.PrimaryScreen.Bounds.Size;
所有这些我都会得到相同的结果.
All of which I end up with the same result.
我遇到了一个涉及到 _NET_WM_STATE_FULLSCREEN 的 pinvoke 的线索,但就我所知.任何关于此的指针将不胜感激.
I have come across a lead which involves a pinvoke involving _NET_WM_STATE_FULLSCREEN but that's as far as I've got with it. Any pointers on that would be appreciated.
推荐答案
_NET_WM_STATE_FULLSCREEN 将摆脱边界.GNOME 面板仍会出现.
_NET_WM_STATE_FULLSCREEN will just get rid of the borders. The GNOME panel will still appear.
根据以下帖子,秘诀是摆脱最小/最大尺寸,以便窗口管理器自行调整大小:
According to the following post, the secret is to get rid of the minimum/maximum sizes so that the window manager does the resizing itself:
http://linux.derkeiler.com/Mailing-Lists/GNOME/2010-01/msg00035.html
这里有一些关于原生规范的文档:
Here is some documentation on the native spec:
http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
http://www.x.org/docs/ICCCM/icccm.pdf
要直接与 X 窗口系统对话,您必须调用 XLib.为了发送像 _NET_WM_STATE_FULLSCREEN 这样的东西,你必须有一个指向窗口和显示器的指针.
To talk directly to the X Window System you have to pinvoke into XLib. In order to send something like _NET_WM_STATE_FULLSCREEN you have to have a pointer to the window and also to the display.
我不知道如何找到显示器,但我可以提供指向窗口的指针.在 X 上运行时,属性 Form.Handle
应该是指向 X 窗口的指针.
I am not sure how to find the display but I can help with a pointer to the window. When running on X, the property Form.Handle
should be a pointer to the X window.
这篇关于Mono winforms 应用程序在 Ubuntu 中全屏显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!