mirror of
https://github.com/theCheeseboard/libtdesktopenvironment.git
synced 2025-01-22 10:22:02 -05:00
Allow popups with no parent
This commit is contained in:
parent
9a8af57914
commit
fc2eae6f46
1 changed files with 7 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <private/qwaylanddisplay_p.h>
|
||||
#include <private/qwaylandshellintegrationfactory_p.h>
|
||||
#include <private/qwaylandwindow_p.h>
|
||||
#include <tlogger.h>
|
||||
|
||||
WaylandLayerShellIntegration::WaylandLayerShellIntegration() :
|
||||
QtWaylandClient::QWaylandShellIntegration() {
|
||||
|
@ -48,8 +49,13 @@ QtWaylandClient::QWaylandShellSurface* WaylandLayerShellIntegration::createShell
|
|||
return new LayerShellSurface(layershellShell, window);
|
||||
}
|
||||
|
||||
auto parent = window->transientParent();
|
||||
if (!parent) {
|
||||
tWarn("WaylandLayerShellIntegration") << "Found a popup window with no parent. Creating as layer-shell window.";
|
||||
return new LayerShellSurface(layershellShell, window);
|
||||
}
|
||||
auto shellSurface = xdgShellIntegration->createShellSurface(window);
|
||||
auto layerShell = LayerShellWindow::forWindow(window->transientParent()->window());
|
||||
auto layerShell = LayerShellWindow::forWindow(parent->window());
|
||||
layerShell->getPopup(shellSurface->surfaceRole());
|
||||
return shellSurface;
|
||||
}
|
||||
|
@ -57,5 +63,4 @@ QtWaylandClient::QWaylandShellSurface* WaylandLayerShellIntegration::createShell
|
|||
bool WaylandLayerShellIntegration::shouldBeLayerShell(QtWaylandClient::QWaylandWindow* window) {
|
||||
auto windowType = window->window()->type();
|
||||
return !(windowType == Qt::Popup || windowType == Qt::ToolTip);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue