How to enumerate all top level windows using Wayland display server? - linux

How do I enumerate all top level windows on the desktop (and further fetching its titles and other properties) on Ubuntu 17.10 using the new default display server Wayland?
Before we used X11 / XLib to achieve this, but now with Wayland this does not work reliable any more. Some windows, like gedit and LibreOffice do not show up any more in the window list, and other tools like xwininfo also do not work any more with these windows.
Currently we use the following technologies:
Ubuntu 17.04 with X.org as default display server:
X11-XLib / X_QueryTree
Windows:
Win32-API / EnumerateWindows (there also exists Windows Automation API)
macOS:
NSAccessibility / AXUIElementCreateApplication, AXUIElementCopyAttributeValue, kAXChildrenAttribute
Ubuntu 17.10 with Wayland:
???
I have not found any API documentation about Wayland and accessibility or UI automation so far.
Can anybody help? A future-proof solution/technology how to access desktop windows on Linux/Ubuntu would be nice.
Regards.

Actually, I think you don't. Wayland is designed in the way that clients don't know about each other. There may be a special API in that specific Wayland composer you are using - but its not part of the protocol. (E.g. GNOME's composer has a DBus API to capture screens)

Related

How to add Bi-Directional text support with iAccess in linux

I have a problem configuring bi-directional text support with Linux.
On the iAccess ODBC driver for windows there is a GUI app called cwbprops.exe and it has a button that sorts it, but I don't know what would be the equivalent action in Linux and can't find anything online.
I am running on an ubuntu docker container.
Thanks!

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 )

Effiecient Windows to Linux desktop sharing solution that support multiple screens

I am looking for an efficient Windows to Linux desktop sharing software that support multiple screen.
As of now my team develops (mustly Scala) code on our local windows machines (laptops).
For various reasons the data we are working on can't usually be copied to our local machines.
Currently we quite frequently need to exports our code/jars to a different environment that is also connected to an Hadoop cluster containing the data.
We are looking for a desktop sharing solution that will enable us to develop and execute code on remote, strong, stable Linux machines, that are connected via broadband connection to our data clusters.
Its crucial for us that the solution above will be able to run remote GUI based developing tools such as IntelliJ on the Linux machines and display them on our local Windows machine multiple screens smoothly.
Any recommendation?
Thanks in advance,
Mishael
One of the options is to use Cygwin - this will allow you to run UI applications from a remote server on your Windows environment
In order to that you should do the following:
A. On Windows side:
Download and install Cygwin/X from : http://x.cygwin.com/
In the Cygwin/X installer make sure the following packages are chosen:
xorg-server (required, the Cygwin/X X Server)
xinit (required, scripts for starting the X server: xinit, startx,
startwin)
X-start-menu-icons (optional, adds icons for X Clients to the Start menu)
xorg-docs (optional, man pages)
font-bh-ttf
font-bitstream-vera-ttf
Setup X Launcher
Create a new shortcut on your desktop which points to the following (assume your cygwin was installed in c:\software):
C:\software\cygwin\bin\run.exe C:\software\cygwin\bin\XWin.exe -multiwindow -clipboard -ac
Double click the shortcut you just created :) this will start small icon on the left side of windows taskbar.
B. On Linux side
login to your remote server for the same windows machine (use any terminal - e.g Putty)
set the DISPLAY parameter your server:
export DISPLAY=<windows-host-name>:0.0
now you can run any application that requires GUI and it will open up on your windows machine
:)

Xserver on Windows7

I have been using X11 with windows Maker provided with cygwin package for multi windows in windows Xp. Currently I am moving to windows 7 but unable to install cygwin.
Is there any other multi windowing system like windows maker for cygwin on windows ?
Thanks for your help in advance.
~ JJA
I really like to use MobaXterm as nice ssh client, but more importantly as very lightweight and fast X server for Windows.
Typical usage on Windows: start MobaXterm, then from its console ssh user#linux-box. Now, you can simply execute any GUI program on your Linux box, like gedit, eclipse, etc., and it simply works! This is because MobaXterm automatically supports forwarding of you graphical DISPLAY from Linux to Windows.
This method for remote access works much faster than VNC. Performance is actually similar to Remote Desktop, if not even faster.

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