eglfs - multiple windows - linux

Working on a embedded linux device with touch screen. Compiled Qt with eglfs support and using tslib for the touch screen. All good up until here. Now, I need to add a virtual keyboard. I've this keyboard as platforminputcontextplugin which works very well on my development linux machine. How can this be done on the embedded device? eglfs is forcing the top window (main window) to full screen and the keyboard is struck behind this window.
What are the options available to me? we need eglfs as it supports OpenGL ES which in turn used by Qt Quick (QML).

Related

Are virtual keyboards supported for every supported platform?

I was wondering what the current cross platform solution for a virtual Keyboard in the new MRTK v2 RC1 is? The old MRTK had the Unity built keyboard. The current keyboard examples only mentions the TouchScreenKeyboard class and I guess that's primarily for HL2. It definitely does not work when running Unity with the attached Mixed Reality Portal.
https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/mrtk_release/Documentation/README_SystemKeyboard.md
You are correct -- MRTK RC1 does not include a built-in keyboard, but instead invokes Unity's TouchScreenKeyboard, which currently supports iOS, Android, and Windows UWP.
In Windows UWP, this will bring up the system keyboard on HoloLens 2 as well as in Windows Mixed Reality, when the project is compiled. For testing in editor, you will not see a system keyboard show up. For HoloLens 1, I have not yet tested whether TouchScreenKeyboard.Show brings up the system keyboard.

Switch application fullscreen mode programmatically on Linux Mate / Ubuntu

I have an application that runs on a Raspberry Pi with Linux Mate and a touch screen. The normal users control the application via touch screen and should usually only see my application. I have defined a keyboard shortcut in Mate that allows me to toggle the fullscreen mode which can be used when I am remotely connected to the PI and have a keyboard.
From time to time it is, however, necessary for the normal user to access the desktop. Since the Raspberry Pi has no keyboard connected, the (local) user can't use the keyboard shortcut.
For this reason I would like to add a button to my application that would allow the user to toggle fullscreen mode.
As far as I understand this is a function of the Gnome 2 desktop (which Linux Mate uses). I have no idea how to access this from my program and can't find any information on it.
My application is written in .NET Core with Avalonia UI but the function would not necessarily have to be integrated in my application. I could as well call an external script or utility program.
Any idea how to accomplish this?
A friend gave me the tip to check out the wmctrl program. The sources of this program led me to the XLib or XCB library and setting the window to _NET_WM_STATE_FULLSCREEN.
I guess this could be done in .NET by P/Invoking the native lib. Then again it seems much easier to write a shell script that determines the windows ID and calls the wmctrl utility and call that script from the .net application.

Set foreground window for Windows program running under Wine

I'm looking for a way to programmatically manipulate a windows program running on Linux under Wine.
Is there something similar on Linux to the Windows SetWindowForeground win32 command?
A function that sets a window by name to the foreground, that will work with a Windows program running under Wine on Linux?
Doe's wine use X11? If so I may be able to utilize this answer, will experiment and circle back
In Linux application windows (including your wine apps window) are managed by your desktop environment's Window Manager (WM). The Window Manager controls how windows are placed and the controls which operate on the windows (resizing, minimize, maxize etc).
Unfortunately there is no standardised Window Manager the major desktop environments (GNOME, KDE etc) have developed their own Window Managers and some people run stand alone WMs like IceWM or more exotic tiling WMs etc.
KDE's WM is called KWin, Gnome's is Mutter, Unity uses Compiz (I think - haven't used Ubuntu for a long time).
When the WM is running in an X sesion it probably uses X11 API internally to raise and lower windows.
However most modern WMs will prevent userpace X calls from popping up windows (because of security concerns etc) You will need to use the WM's wrapper functions. I think Wayland (whenever it is finally available) will have a proper secure API so this shouldn't be an issue.
The short answer to your question is any program you write will likely need to be Windows Manager specific and you should consult the documentation for your WM.
Long Answer - there is a freedesktop.org standard called Extended Windows Manager Hints I'm not sure how good conformance to the spec is among differing WMs (major ones like Gnome and kDE should be good). The property you are interested in is Window State (NET_WM_STATE)
See: http://standards.freedesktop.org/wm-spec/wm-spec-1.3.html
I hope that helps - my knowledge of WMs is probably outdated but should steer you in the right direction - I haven't really played around with WMs since GLX first came out and Compositing (wobbly windows and all that jazz) was in vogue.
You can use X11 window manager xdotool or X window manager wmctrl.
Consider the following scenario. A MS windows application titled WordWeb Installer running in wine on Ubuntu on workspace 2. Current workspace : 1. To switch to workspace 2 and focus the wine app execute
wmctrl -R wordweb or
xdotool windowactivate $( xdotool search --name wordweb )

Debugging GLFW display settings

In my project, I would like to use GLFW for the window supporting. It works fine on my laptop and office PC, but my home desktop does not let me open a window (All of them Ubuntu 12.04). I tried with GLUT also, which at least gives me an error message, but all I was able to find out was that the settings of the window were not supported by the X-Server (something with glXChooseFBConfig).
However, I was able to open a window using SDL. Now I'm very curious as to why SDL can open an OpenGL window, but GLUT and GLFW can't. How can I debug these graphics settings in a Haskell program? Is that even possible to figure out or do I have to simply accept it?
I have a bunch of game on this desktop and never had any trouble with OpenGL. What is different here?

How to use OpenGL without a window manager in Linux?

I've just finished the LFS book and my Linux system is working right now. I want to use OpenGL to display graphics on the screen, while the only installed package right now are those described on http://www.linuxfromscratch.org/lfs/view/stable/chapter03/packages.html.
I don't want to install something like Gnome, KDE or X.org. Instead, I want to use OpenGL directly from my software. Is this possible, and how can I do this? Or is it just as easy (I don't think so :'p) as writing an OpenGL application which runs full screen?
You don't have to install Gnome or KDE. These are used to managed windows, and you can launch graphical applications without having a window manager.
Therefore, you'll have to install a X server. The X server is responsible of drawing things on your screen. Without X server, you can't launch graphical applications.
Once X has been installed, launch it, export your DISPLAY environment variable, and the rest is like writing an OpenGL application which runs full screen :-)
You can use Pygame as well to create custom launch UI. Also try looking at Wayland compositor as it has replaced XServer in verisons like Fedora and Ubuntu.
kmscube DRM example
https://github.com/robclark/kmscube
This is possibly the most popular demo available, it uses OpenGL and EGL.
Unfortunately, the Ubuntu 18.04 package with NVIDIA proprietary drivers it does not work for me after going into Ctrl + Alt + F3:
drmModeGetResources failed: Invalid argument
failed to initialize legacy DRM
bug report: https://github.com/robclark/kmscube/issues/12
But I did get it working on emulator.
It takes over the entire display, and shows a colorful spinning cube.

Resources