简体   繁体   English

在Kiosk模式下运行GTK#应用程序

[英]Run GTK# Application in Kiosk Mode

I am writing a C#/Mono app (GTK# GUI) for the Raspberry Pi. 我正在为Raspberry Pi编写一个C#/ Mono应用程序(GTK#GUI)。 I want to run this app in kiosk mode (fullscreen, no metacity/ window borders, unable to exit). 我想以kiosk模式运行此应用程序(全屏,没有metacity /窗口边框,无法退出)。 How does this work under Linux/Raspian? 这在Linux / Raspian下如何工作? In Windows using WPF I can simply set the Window borderless and maximize it. 在使用WPF的Windows中,我可以简单地将Window设置为无边界并最大化它。 I havn´t found a similar Property on the GTK-Window. 我没有在GTK-Window上找到类似的属性。

This works on OS-X, but I do not have a Linux box to double-check it right now, but it should be the same: 这适用于OS-X,但我现在没有Linux盒子来仔细检查它,但它应该是相同的:

using System;
using Gtk;

namespace GtkfullscreenNotdecorated
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            Application.Init ();
            MainWindow win = new MainWindow ();
            win.Show ();
            win.Fullscreen ();
            win.Decorated = false;
            Application.Run ();
        }
    }
}

The main thing is win.Fullscreen. 主要是win.Fullscreen。 In full screen, GTK2 window decoration is not visible, but I always add it. 全屏,GTK2窗口装饰不可见,但我总是添加它。 Run it with and without performing the win.Fullscreen() to see how your display manager is turning the decoration off. 使用和不执行win.Fullscreen()运行它以查看显示管理器如何关闭装饰。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM