Mono and full screen


8 posts
by ProjectMayu » Sun Jul 01, 2012 11:38 am
Does anyone know how to make a mono winforms app full screen, currently the task bar is still visible
Posts: 17
Joined: Sun Jul 01, 2012 8:58 am
by ProjectMayu » Wed Jul 04, 2012 10:50 am
Seems the only thing I have found is how to make my mono app, the only app, useful if you are making a kiosk, but not useful if you are making an app such as a media player type app.

If enough people ask, i will put up a how to setup a kiosk type mono app, kind of short of spare time right now.
Posts: 17
Joined: Sun Jul 01, 2012 8:58 am
by pauldy » Sat Jul 07, 2012 5:14 am
It isn't to hard just run x11 without a windows manager and have your winform full screen. This is how I prototyped the feedback daemon for my app and it works very well.

Backup the /etc/X11/xinit/xinitrc

Then replace it with the following

setterm -blank 0
xset s off
xset -dpms
mono /home/pi/PathToYourApp.exe

Now at the bottom of your rc.local add the following just before the exit 0
/bin/bash startx &

This is the easiest way to get it up and going without having to understand a bunch of stuff about linux most people don't care about anyway. The xinitrc gets read when you run startx and starts the items in order. You can add the unclutter app using apt-get install unclutter and include the following line before your mono app line

unclutter -idle 0 -root &

The only important thing to remember is when your app returns control back tot he shell then xwindows will exit. The final line in the list cannot fork off so if you need to start multiple apps for whatever reason make sure the final app doesn't fork off with the &.
Posts: 20
Joined: Tue Jun 12, 2012 3:34 pm
by ProjectMayu » Sat Jul 07, 2012 11:58 am
I am sure others will find that partly useful, as the complete how to is more complex than that, for one you have to install xset, mono and visual basic first, and set the OS to auto login, I never knew about unclutter, usually just set the cursor to a blank one, thanks for that tip.

Some tips, for people that try this.
you can still get to the command line, if you press ctrl+c when starting up, at the point it says "type startx"
to use a vb.net app install mono on windows and copy the Microsoft.VisualBasic.dll from windows to linux, placed next to your app, mono-complete does not include visual basic, go figure not so complete.
don't use any mono less than 2.10, it's just a pain in the compatibility.

I still have not found a way to make a full screen windowed app, that covers the task bar the same way it does on windows, you would think it would work the same as it does on windows, should submit it as a bug to the mono team.
Posts: 17
Joined: Sun Jul 01, 2012 8:58 am
by pauldy » Sun Jul 08, 2012 2:20 am
If you need a windows manager then the issue your likely running into is that there isn't a defined way to message other windows that you want to be on top. So task bars and such watch to see if someone comes on top of them then they jump to the front. So you will need to tell the panel to let other applications go in front of it. Might be able to tell you if you know what window manager your running.
Posts: 20
Joined: Tue Jun 12, 2012 3:34 pm
by ProjectMayu » Mon Jul 09, 2012 2:45 pm
The default window manager that comes with Debian Beta
Posts: 17
Joined: Sun Jul 01, 2012 8:58 am
by pauldy » Thu Jul 12, 2012 4:38 pm
I just tried you can right click the task bar and select properties and allow other windows to come in front of the taskbar. Then I used a form onload event to set the max and ontop properties. There may be a config setting in lxde but I'm not super familiar with it yet.
Posts: 20
Joined: Tue Jun 12, 2012 3:34 pm
by ProjectMayu » Tue Jul 17, 2012 2:50 pm
unless i can do it from code, then its of no use to me, i make user friendly apps. Thanks for the tip though.

i have found that when running as the only app, no window manager, my 1920x1080 app it is not covering the entire screen.
I made a line around the edge of my test app.
The right side is off the screen
And the bottom cuts off short of the bottom, and if you move the mouse down the bottom it turns into an X

No amount of config.txt is able to fix the problem

screen is set to 1080p 60Hz
There is a noticeable screen brightness drop compared to windows on the same monitor
The original default screen was 1080i 60Hz and flickered
Posts: 17
Joined: Sun Jul 01, 2012 8:58 am