EGLFS: Don't raise the main window when docking

EGLFS doesn't honour that the floating windows should be
on top and will make the floating windows go behind.

It's also unneeded to raise it on eglfs, since it's fullscreen.

(cherry-picked from commit d06c6e8f11)
This commit is contained in:
Sergio Martins
2022-06-19 14:37:52 +01:00
parent 4fa43c7ba1
commit 729624ab04
5 changed files with 24 additions and 2 deletions

View File

@@ -107,6 +107,8 @@ public:
bool containsView(Controller *) const;
bool containsView(View *) const;
/// @brief Returns whether this window is fullscreen currently
virtual bool isFullScreen() const = 0;
/// @brief Returns whether this window can't be shrinked to a size that would violate the layout's min size
/// This is true for QtWidgets where the layout constraings propagate up to the window

View File

@@ -30,6 +30,8 @@
#include "controllers/indicators/NullIndicators.h"
#include "controllers/indicators/SegmentedIndicators.h"
#include "Window.h"
#include <algorithm>
using namespace KDDockWidgets;
@@ -356,8 +358,14 @@ bool DropArea::drop(WindowBeingDragged *draggedWindow, Controllers::Frame *accep
}
if (result) {
// Window receiving the drop gets raised:
view()->raiseAndActivate();
// Window receiving the drop gets raised
// Window receiving the drop gets raised.
// Exception: Under EGLFS we don't raise the fullscreen main window, as then all floating windows would
// go behind. It's also unneeded to raise, as it's fullscreen.
const bool isEGLFSRootWindow = isEGLFS() && (view()->window()->isFullScreen() || window()->isMaximized());
if (!isEGLFSRootWindow)
view()->raiseAndActivate();
if (needToFocusNewlyDroppedWidgets) {
// Let's also focus the newly dropped dock widget

View File

@@ -46,6 +46,11 @@ inline bool isXCB()
return qGuiApp->platformName() == QLatin1String("xcb");
}
inline bool isEGLFS()
{
return qApp->platformName() == QLatin1String("eglfs");
}
inline bool isLeftButtonPressed()
{
return qGuiApp->mouseButtons() & Qt::LeftButton;

View File

@@ -162,3 +162,8 @@ void Window_qt::setVisible(bool is)
{
m_window->setVisible(is);
}
bool Window_qt::isFullScreen() const
{
return m_window->windowStates() & Qt::WindowFullScreen;
}

View File

@@ -54,6 +54,8 @@ public:
QPoint fromNativePixels(QPoint) const override;
void startSystemMove() override;
bool isFullScreen() const override;
protected:
QPointer<QWindow> m_window;