Does Qt require a preinstalled window manager on Linux? - linux

I'm working on a GUI application with Qt on Linux. The operating system only provides the X Server and the prerequisites to run a Qt application. There is no desktop environment like GNOME, KDE, etc. installed yet. There's no window manager neither.
So my question is: does Qt require a preinstalled window manager (like KWin, Compiz, Metacity, etc.) or is it possible to write a Qt application that communicates with the X Server directly? I'm aware of the fact that the latter one possibly drives me crazy due to the effort I'd have. However, due to limitation of resources it could be an option.
Thanks in advance for your help!

No, Qt doesn't require a window manager when running under X11. You will have to manage your own windows, though! That means that you'll have to manage the Z order of windows, dragging windows on the screen, minimization/maximization if you need such, etc.

Related

How to create a Bootable GTK Application?

Hi i have an application written in GTK and i would like to make it into an bootable ISO file.
I have tried many options but have failed and being sent in many directions using cmake and make by following several tutorials which did not work.
Does anybody know how to create an bootable ISO file for / from an GTK based application on linux / ubuntu?
I am currently using ubuntu to develop the bootloading application yet i would prefer the GTK application to startup when the computer starts up, and have no operating system running if possible?
GTK requires an operating system kernel (a Linux kernel...) to be running, and some display server, e.g. Xorg.
So you need to actually make your custom Linux distribution.
I would prefer the GTK application to startup when the computer starts up, and have no operating system running
This is not possible
But you could study the source code of source based Linux distributions like Gentoo and work for several months to make your own Linux distribution.
You probably would need help and address many issues you did not even thought of (e.g. AZERTY keyboard layout, computers with only USB disks, laptops with only Wifi network connections, etc...)
Notice that Debian & Ubuntu can be configured to boot some (open source) GTK based installation procedure. I guess you could study in details their implementation (since it is open source)
It's not possible to boot a GTK application without operating system, as Basile Starynkevitch said.
However, you can use Linux to display only your GTK distribution, without any additional programs and I think it can be done easier, than Starynkevitch's method.
You can try to use the tool Systemback or similar to create a bootable live Linux distribution. Systemback is not maintained anymore but there is a github fork made by BluewhaleRobot that appears to be more up-to-date.
You can install a light Linux distribution, for example Xubuntu, and remove all unnecessary packages and programs. You can set the wallpaper, remove or leave the taskbar/menu start etc. Then, install your GTK application, add it to autorun and use Systemback's "Live system create" function.
The ISO image should be created and your program should be already installed in it with autorun.
It's not a perfect and stable solution, however, it seems to be the easiest way to achieve what you want.

how linux shows its desktop on screen at kernel-level

I have some question about linux desktop environment.
How linux shows its desktop environment on a screen. I mean where and how its GUI frames generates and send to lcd driver? is it at kernel level? does it have any relation to frame buffer (such fb0)?
Is it possible to access the Desktop GUI of linux and write it on frame buffer to show the window environment of linux?
I have searched a lot but did not find my main answer that how linux Desktop Environment is created and shown by monitor that have been known by drivers on linux.
thank you for your attention.
In Linux there's no internal desktop or anything like that. desktop environments are just regular applications just like other applications. almost all desktop environments at their lowest level interact with another GUI library (e.g Qt, GTK, ...). then all these GUI libraries interact with lower-level software called windowing system or display server or window server.
In Unix systems most used window system is X window system ( simply called as X or X11). almost any GUI library which supports Linux, it works with X.
Wayland is another windowing system which is growing and is supposed to be a good replacement for X, because X window system is too old and have many issues. but X is used almost everywhere in Linux and other Unix based operating systems.
So if you really want to know what's going on down there, you should know linux graphics stack. as i said desktop environments are just high level applications. from windowing system (like X) to lower-level libraries and modules (KMS, DRM, ...), are what you really looking for.
KMS (kernel mode setting) works with display controller and DRM (direct rendering manager) works with graphics card and GPU. (however it's really not as simple as i explained)

Looking for a super tiny linux distro that's sole purpose is running an AIR application?

I'm looking for a really really small linux distribution or process of making my own that's sole purpose is to get an air application to launch full screen and stay there; Essentially I'm building a home kitchen computer that runs entirely as an AIR app.
I have looked into using windows xp; and windows xp embedded but they pose so many issues I figured I'd try modern linux.
I have also seen TinyCore Linux which looks interestingly small but not sure what issues that poses in regards to running AIR and "hardware" accelerated display. I've also thought about stripping down an Ubuntu installation but I'm sure somebody must have done this already; google is just failing me right now...
I'm also interested in running an "embedded" version of say android and running the air app on some arm-based hardware again; with just the AIR runtimes only - although this is less preferred as it's more complex.
I'm also hooking this up to a touch screen monitor (not yet arrived) so I'll need to hunt down or write some drivers for translating the touch events into something AIR can understand... (this was my main intention for using windows in that all the drivers will just work).
What I'm after
Minified Linux kernel with JUST the drivers for the box I need
X Display with accelerated graphics support (Doesn't have to be X if AIR can run on a frame buffer?)
Running a Full screen AIR application (simple enough)
Ability to write back to the filesystem (enough support for AIR)
SSH Access for remote control
Samba for updating the filesystem (easier to maintain the system)
Touch screen support (3M Ex III I think...)
Audio support
Don't need
Don't need any window manager or any other GUI tools unless required by AIR
Don't need any toolbars or file managers or anything; The AIR app is the "OS"
Don't need any package managers or repos
Don't need multi user or logging in; everything can just run as an unprivileged account
Don't need to
I don't mind hand crafting the filesystem and configs if that makes it easier; I'm mainly looking for a "filesystem" that is as tiny as possible that I can just plop my AIR app into and write some scripts to get it to start when the X server starts
Thanks,
Chris
Try an embedded Linux build system such as Buildroot. It can build an entire system from source, and be very lightweight. The basic system is less than 1 MB in size.
Ended up going with Tiny Core. Very tiny and quick to boot up. You can also write extensions for it and you don't have a persistent drive which allows you to just switch the thing off without worry that it's going to break something -- exactly what you need in a kitchen :-D.
My current plan is to:
Just set up a working version using Ubuntu as this is mostly supported by Adobe
Slowly strip it back and try and get as little things to start as possible on boot
Try building my own distro/package from source and selecting only the packages I need
Compile my own kernel with nearly everything turned off and just leave on the things I need

Can you Run Xcode in Linux?

Can you run Xcode in Linux? Mac OS X was based on BSD Unix, so is it possible?
From what I have heard, there is a MonoDevelop plugin that has an iPhone simulator.
The low-level toolchain for Xcode (the gcc compiler family, the gdb debugger, etc.) is all open source and common to Unix and Linux platforms. But the IDE--the editor, project management, indexing, navigation, build system, graphical debugger, visual data modeling, SCM system, refactoring, project snapshots, etc.--is a Mac OS X Cocoa application, and is not portable.
Nobody suggested Vagrant yet, so here it is, Vagrant box for OSX
vagrant init AndrewDryga/vagrant-box-osx --box-version 0.2.1
vagrant up
# editor's notes:
# - this requires virtualbox
# - version 0.3.1 (2016) is down now, so version 0.2.1 (2015)
# - there are notes for building an image one's self at the site
and you have a MACOS virtual machine. But according to Apple's EULA, you still need to run it on MacOS hardware :D But anywhere, here's one to all of you geeks who wiped MacOS and installed Ubuntu :D
Unfortunately, you can't run the editors from inside using SSH X-forwarding option.
I really wanted to comment, not answer. But just to be precise, OSX is not based on BSD, it is an evolution of NeXTStep. The NeXTStep OS utilizes the Mach kernel developed by CMU. It was originally designed as a MicroKernel, but due to performance constraints, they eventually decided they needed to include the Unix portion of the API into the kernel itself and so a BSD-compatible "server" (originally intended to process requests for BSD-compatible kernel messages) was moved into the kernel, making it a Monolithic kernel. It may be BSD compatible in the programming API, but it is NOT BSD.
The rest of the OS involved ObjectiveC (under arrangements between Stepstone and Richard Stallman of GNU/GCC) with a GUI based on a technology called "Display Postscript" ... sort of like an X Server, but with postscript commands. OS X changed Display Postscript to Display PDF, and increased the general hardware requirements 1000 fold (NeXT could run in 8-16MB, now you need GB).
Due to the close marriage of GCC and Objective C and NeXT, your best bet at running XCode natively under Linux would be to do a port (if you can get ahold of the source - good luck) utilizing the GNUStep libraries. Originally designed for NextStep and then OpenStep compatibility, I've heard they are now more-or-less Cocoa compatible, but I've not played with any of it in almost 2 decades. Of course that only gets you as far as ObjC, not Swift, and I don't know if Apple is going to OpenSource it.
You can run Xcode on Linux NATIVELY using Darling:
Darling is a translation layer that lets you run macOS software on Linux
Once installed you can install Xcode via command-line developer tool following this link.
If you run VMware Player or Workstation (or maybe VirtualBox, I'm not sure if it supports Mac OS X, but may), and then Mac OS X Server (Client can't legally be virtualized). Of course, in this case you are running XCode on OS X, but your host machine could be linux.
If you cannot shell out thousands of dollars for a decent Mac then there is an option to run OSX and XCode in the cloud:
http://www.macincloud.com/
I think you need MonoTouch (not free!) for that plugin.
And no, there is no way to run Xcode on Linux.
Sorry for all the bad news. :)
Nope, you've heard of MonoTouch which is a .NET/mono environment for iPhone development. But you still need a Mac and the official iPhone SDK. And the emulator is the official apple one, this acts as a separate IDE and allows you to not have to code in Objective C, rather you code in c#
It's an interesting project to say the least....
EDIT: apparently, you can distribute on the app store now, early on that was a no go....
The easiest option to do that is running a VM with a OSX copy.
It was weird that no one suggested KVM.
It is gonna provide you almost native performance and it is built-in Linux.
Go and check it out.
you will feel like u are using mac only and then install Xcode there
u may even choose to directly boot into the OSX GUI instead of Linux one on startup
If you really want to use Xcode on linux you could get Virtual Box and install Hackintosh on a VM.
Edit: Virtual Box Guest Additions is not supported with MacOS Movaje. You will want to use VMware
https://www.vmware.com/
https://hackintosh.com/
If you want XCode on another OS, I suggest cloud computing. That way your app is being developed on a Mac and can be submitted to the App Store.
Use quiling framework
For more info check at https://github.com/qilingframework/qiling
I think it is the best
Maybe you can use Virtual Machine and Qiling framework.
If you are planning to use a Mac VM on Linux, check out Docker-OSX. It provides a simple approach to use pre-built Mac VMs with Docker.
To know more about the legality of running Apple software on non-Apple hardware, read this article: Is Hackintosh, OSX-KVM, or Docker-OSX legal?
OSX is based on BSD, not Linux. You cannot run Xcode on a Linux machine.

Self contained GTK application when there is no X windows environment

I am using a very stripped down version of Linux, I want to create a self contained GTK application on a system that has no X window environment installed.
I want to use GTK GUI classes and widgets and not create a server version where GUI is disabled.
The only thing you can expect is a working glibc.
From what I understand it would involve the following:
Statically link GTK lib with X libraries.Statically link my application with the above mentioned library.
Is there anything to watch out for, Can a (somewhat) newbie get it done. I used google, but (some usable) information flew over my head.
GTK and X are independent programs. You would typically need to install both for the program to work. Alternatively, you can use the Linux framebuffer by switching out GTK for GTKfb. You will need to compile GTKfb and its dependencies statically if you don't want to distribute the libraries. Carefully read the LGPL if you do this. Red Hat has a paper on building small applications with GTKfb: http://www.redhat.com/f/pdf/gtkfb.pdf.
X libraries are X11 client libraries that are used to connect to X11 server. Your device does not run such server, and X11 client libraries won't be of any help. On embedded devices, the good option is probably to use direct access to framebuffer (e.g., gtk-directfb, gtk-fb)
You should be able to do this; however most of the X / Gtk libraries are normally compiled dynamically, and while they should compile statically you may encounter some bit-rot.
Have you considered simply bundling all the required shared libraries with your application? You could launch your application via a shell script wrapper which sets up the library search path to point to the directory with your shared libraries in.
This is similar to the method that firefox uses on Linux for it's plugin path.
You could use X Virtual Framebuffer. On Debian, it's the xvfb package. The following is from the package description:
Xvfb provides an X server that can
run on machines with no display
hardware and no physical input
devices. It emulates a dumb
framebuffer using virtual memory. The
primary use of this server was
intended to be server testing, but
other novel uses for it have been
found, including testing clients
against unusual depths and screen
configurations, doing batch processing
with Xvfb as a background rendering
engine, load testing, as an aid to
porting the X server to a new
platform, and providing an unobtrusive
way to run applications that don't
really need an X server but insist on
having one anyway.
This package also contains a
convenience script called xvfb-run
which simplifies the automated
execution of X clients in a virtual
server environment. This convenience
script requires the use of the xauth
program.
More information about X.Org can be
found at:
http://www.X.org
http://xorg.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
This package is built from the X.org
xserver module.

Resources