Sfiet_Konstantin wrote:rickst29 wrote:Qt 5.x, OTOH, is nearly certain to be built with a Wayland backend exclusively.
Why? ....
I also now a little about Qt 5.x. There are numerous discussions on Qt 5, but it is said that Qt 5 will try to target the widest range of platform. They have a project called "Lighthouse" that make porting Qt easier. AFAIK, Qt 5.x will support both X11 and Wayland.
The only "problem" with Qt 5 is it's dependencies to OpenGL. Because all drawing operations will be done by using OpenGL, I'm quite afraid of free drivers support, or even proprietary drivers.
Qt 5.x will also be source compatible with Qt 4.x program (well, it tries).
I'll cover Wayland first, because a complete answer is... a little complex.
X11 versus Wayland affects both the input side (mice, pens, keyboards, touch, multitouch, etc.) AND the output window (hardware and low-level API). In my tiny, tiny bit of work within Qt, I have been focusing on the input side, and you
could be correct about the terminal screens... although use of X11 would be a mistake on any box where Wayland is already present (for input).
For input, it is felt by the full-time Devs to be
more difficult to "migrate" the X11 interface code from the "X Input Protocol" Version 1, (AKA "XI 1.x") to the version that will be necessary for "the future". (Including "proper" Multitouch, AND multiple pointers sharing the same Screen/Window/Application.) The required version would be "XI 2.1", still undergoing Development, with an unstable API. Qt4, like all it's predecessors, is built against XI 1.x. The number of interfaces is enormous, and Qt keeps stumbling into trouble when (for example) "Pen" devices have "too many buttons".
Or even mice, which has (unfortunately) become an unpleasant specialty of mine. The XI 1.x button mask field is only a single byte, and thus (obviously!) you can't see the full set of pressed/unpressed button states. Even worse, within qt, the entire definition of "possible buttons numbers" is defined by a single byte. (You would have a maximum of only 3 buttons, if Qt didn't separate the 4 wheel motions into a separate API. So, with WHEEL-UP, WHEEL-DOWN, SCROLL-LEFT, and SCROLL-RIGHT excluded, there are 7. Oddly, we define only 5 of them (BUTTON1, BUTTON2, MIDBUTTON, and the ones which
should have been called BUTTONBACK and BUTTONFORWARD, named XBUTTON1 and XBUTTON2.) But for people with a "gamer" mouse like mine, adding just two more doesn't help much -- the "extra" buttons which are easiest to click on my
mouse have even higher numbers, and there are a lot of them.
XI 2.1 (and 2.0, for that matter) provide no less than a 32-bit mask field in the event. For buttons on "mice", X11 probably can't go past #31. But the API is radically different- instead of a gigantic number of function signatures, each utilizing a fixed set of parameters, and most dedicated to a particular KIND of device, there are very few. (Instead of having one set of functions for the "mouse" and another set of functions for the "pen", the type of device, and even the type of event, are parameters within a very small number of function/event signatures. The most clever thing, IMO, is allowing the size of the input/ output parameters to vary: If there ever was a "mouse-like" device with 40, or 70 "button states" which needed to dealt with, be shown, it would use the same API. But the length of the vector for buttons, rather than being fixed at 32 bits, can be built with additional CARD32 elements to contain the rest of the data. In the case of events from X11, they're built on-the-fly, so the Qt-X11 interface would need to be re-written to release them.
Fundamentally, the data comes from the evdev driver. Wayland uses the same driver, but connects the Client Application to the X11 devices more directly. (X11 is fundamentally a REMOTE protocol, even if the Application is running in the same "box" as all of the hardware.) It is far more simple, and may very well be more stable at an earlier date. Within Qt, the X11 input migration is probably
harder! than the Wayland migration.