Why isn't there the Unix API? I mean, as there is the Windows API.I know a lot of things in the Unix world is modular, and those things put together creates a whole system. This sounds good but does create some problems when you try to make a native Unix app.For example, you want to program a nice word processor with a cool name WP. The Windows version of WP will be built by calling the Windows API. You can either code this directly in C, or use any of the various wrapper libraries out there. But still, the program must be constructed by calling winapi, which provides every single functionality that a programmer may need to build a Windows app, from basic system calls to GUI, 3D, multimedia or anything else with more than a decade of backwards compatibility. If it weren't like this, Wine could never exist.Now you want to create a Unix version of WP. The standard C and C++ library and the POSIX API is very stable and well supported in any Unix variants. The problem occurs when you try to do more. So you need to create a window for WP, but how? There is X11, but this is not the only one. People think X11 should be replaced and now are making two incompatible replacements, Wayland and Mir. Even for X11, there is Xlib and xcb. xcb claims they are 'better', and it is true in some ways, but where is the documentation? You eventually choose Xlib to do the task, but the X11 standard by itself only defines very basic features. Anything else you'd expect for a GUI application such as window events or clipboard support needs to be dealt with extensions, by calling XInternAtom. This sentence is merely my personal opinion, but the use of Atoms in X is extremely unintuitive. And another problem is that not every window manager for X support these extensions well. So let's just leave this dirtiness to the developers of GTK+ and Qt, who break backwards compatibility per each new version. Is it even possible to have portable drag-and-drop support in Linux?It really seems to me that the Unix community is killing themselves in the Desktop world. I know that the things I mentioned doesn't even matter to set up a BSD server, but it does matter if you ever try to build a portable native Linux app.What is making up all of this mess? Is there really an effort to clean this up and standardize things for the modern desktop environment of Unix? Why isn't there the Unix API? Will there ever be one?
Why isn't there a Unix API?
x11;desktop;desktop environment;posix;api
It really seems to me that the Unix community is killing themselves in the Desktop world.I think there is a misconception that any form of Unix exists in order to compete in the home PC market.  There are some linux distros which have this focus; the first one was really Ubuntu, but it is worth considering that part of Ubuntu's original vision was to develop a user friendly operating system that could be used in parts of the world where having to pay hundreds of dollars per computer for a Microsoft license was not feasible and could mean the difference between having computers (in schools, government, etc.) and not having them.I have not stayed up to date with how successful that's been, but in any case, it seems to me that it is a very different goal than wanting to out Apple Apple or something.  Apples and oranges, as they say.  Or apples and aardvarks.1  This aardvark is nothing like an apple!  No, it isn't.  Why would you think it is?Now you want to create a Unix version of WP [...] You eventually choose Xlib to do the taskOnly if you are a crazy person who is unlikely to complete a word processor with mass consumption potential.  Software exists in distinct layers that are assembled in stacks.  X is a layer that is used on various platforms as part of the GUI stack.  On those platforms, X lib is used to implement higher level libraries such as Gtk and Qt, both of which have a portable API; they can be used on OSX and Windows, neither of which uses X. On those platforms, a different lower level library/API is used to implement Gtk and Qt.  This means higher level programs, such as end user GUI applications, written for Gtk or Qt, can be used anywhere with relatively minor changes.2Those are the libraries that are used directly to implement GUI applications on POSIX systems, which is why most such applications are usually not that hard to port from one near compliant POSIX system to another.So the problem you are referring to does not actually exist in the way you've presented it.  The Unix community is not killing itself, it's doing exactly what it intends to do.1. To explain better what I mean by this, consider the role of the free market in the evolution of GNU/Linux vs. Windows.  The latter clearly is, by intention, the product of free market forces, but the former case is much more ambiguous.  As good Westerners, we of course then put theory first and say, Well obviously a product that is shaped by the free market is better than one that is not.   But this is not quite true -- what it really means is that one will be prone to sell better.  You seem to be asking why there's not more of an effort to make the product sell better in this sense.  The answer, of course, is that there's less motivation to do so, which raises the question of what there is motivation to do.  The development of GNU/Linux (in particular) has been guided a lot by developers out to please themselves, and not so much other people or a mass market.  Whether or not this produces a better system I guess depends on how close your perspective is to the people who created it.  The history of UNIX does involve more market forces, but it is/was a highly specialized audience.  Put another way: It's a technical OS for technical people, but there is a rabbit hole available for the general public.2. In contrast, if you write something with the Windows API, there is only one place you can use it without some very major changes..