Closed joakimono closed 3 months ago
Regarding loosing mouse motion events: It is lost if the user clicks on the window title line (or moves the window) and then clicks somewhere inside the window.
With Wayland, if fullscreen is selected, but video mode is not selected to be the native resolution of the monitor, there will be alpha channel
artifacts: e.g. windows below overlay elements will be partly visible. All open GL renderers are affected.
I think this is in a pretty good shape for merging now. The comment spam is mostly a checklist for myself as it might take me a few weeks until I can fix this up. Of course you can do the remaining fixes yourself too :)
other things to watch out:
TestContext
fails with a segmentation fault at RenderSystem::_createRenderWindow "OGRE VTest Context"
. It should be resolved before merging.
ApplicationContextQt is still not functional. An error similar to: https://bugreports.qt.io/browse/QTBUG-123866 But it may be some missing configuration in our end. I want to try a newer version of Qt also.
ApplicationContextQt is still not functional. An error similar to: https://bugreports.qt.io/browse/QTBUG-123866 But it may be some missing configuration in our end. I want to try a newer version of Qt also.
it would be totally fine by me if Wayland support would be only available with Qt >= 6.5
ApplicationContextQt is still not functional. An error similar to: https://bugreports.qt.io/browse/QTBUG-123866 But it may be some missing configuration in our end. I want to try a newer version of Qt also.
it would be totally fine by me if Wayland support would be only available with Qt >= 6.5
Ok. I will investigate further to see if a newer Qt version is beneficial
TestContext
fails with a segmentation fault atRenderSystem::_createRenderWindow "OGRE VTest Context"
. It should be resolved before merging.
I guess the problem is that it does not pass any miscParams: https://github.com/OGRECave/ogre/blob/70d7c82530add72e1fe88e976a6c854352b1fce5/Tests/VisualTests/Context/src/TestContext.cpp#L126
which is a nice test case actually. We should assert instead of segfaulting in this case as on Vulkan: https://github.com/OGRECave/ogre/blob/70d7c82530add72e1fe88e976a6c854352b1fce5/RenderSystems/Vulkan/src/OgreVulkanWindow.cpp#L444
but yeah.. for merging we should either revert the CI to X11 or fix that
I think maintaining CI with X11 could be advantageous since X11 will likely stay prevalent for a few more years. For now, we could modify the "custombuild" target to just compile-test Wayland.
Ok. I will investigate further to see if a newer Qt version is beneficial
Some of the interface is nicer for Qt 6.5+, but there will still be a need for including a private header, even at Qt 6.7. Specifically the wl_surface
is not publically exposed in the new native interface.
ref: https://planet.kde.org/david-redondo-2022-12-09-wayland-native-interface-in-qt-6-5/
Since an implementation need to use QtGui::Private and deal with version-specific includes anyways, I do not see the point of restricting Ogre with Wayland to 6.5+ (unless there are other features unknown to me). Qt 6 also requires c++17.
tested this locally on Ubuntu 22.04 and added some final fixes. I would merge this next, if it is done from your side.
Out of curiosity as I did not test: does Wayland on Qt work in the current state?
Out of curiosity as I did not test: does Wayland on Qt work in the current state?
No it does not. I suspect there is something missing regarding handling of the wl_surface but I do not know what. Maybe somehow initalise xdg_surface or indicate that it is a parent window. But these are guesses. I don't have time to look more into this for the time being.
No it does not.
I just tested it on Ubuntu 22.04 & Qt 6.2.4 and I get an undecorated window with the wrong resolution. However input is already working. So likely not much is missing.
This PR fixes issue #2432
Implement support for Wayland with EGL in GLSupport. The functionality is enabled at compile type by cmake option
OGRE_GLSUPPORT_USE_WAYLAND
, provided that EGL headers are found. Note that when Wayland is enabled, X11 is unavailable. Some new packages will need to be installed to compile it (tested on Debian 12):libwayland-dev libwayland-egl wayland-protocols pkg-config
For Qt (in addition to default Core and Gui): At least alsoqtwayland5
andqttools5-private-dev
. Tested with Qt 5.15.8.Once compiled and installed, the feature can be tested with the sample browser. It is important to explicitly select wayland when starting the application as follows:
SDL_VIDEODRIVER=wayland ./SampleBrowser
Likewise when using ApplicationContextQt:
./MyOgreQt -platform wayland
orQT_QPA_PLATFORM=wayland ./MyOgreQt
. Note: Ogre Qt and Wayland does not work yet.This new feature has been tested on Debian 12 on WSL2. There are several things that should be tested and fixed before merging.
bgfx
to be able to create egl surface external to SDL (see link to issue inApplicationContextSDL.cpp
below).