diff options
| author | Vaxry <vaxry@vaxry.net> | 2023-10-20 20:15:41 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2023-10-20 20:15:57 +0100 |
| commit | 7f35f33b4ca16509e127976772db6abd9abf100b (patch) | |
| tree | 557326d4214617c3459d983001d969fbe6510448 /src/Window.cpp | |
| parent | bab2f6a664a67dfd0c2f442dbc0134ef7c6e07e2 (diff) | |
surface/wayland: conform to small surface requirements
do not stretch small surfaces, instead center them if they fit.
Diffstat (limited to 'src/Window.cpp')
| -rw-r--r-- | src/Window.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index 6a83c7fa..af5015d4 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -424,6 +424,7 @@ void CWindow::onUnmap() { void CWindow::onMap() { m_pWLSurface.assign(g_pXWaylandManager->getWindowSurface(this)); + m_pWLSurface.m_pOwner = this; // JIC, reset the callbacks. If any are set, we'll make sure they are cleared so we don't accidentally unset them. (In case a window got remapped) m_vRealPosition.resetAllCallbacks(); @@ -453,6 +454,8 @@ void CWindow::onMap() { hyprListener_unmapWindow.initCallback(m_bIsX11 ? &m_uSurface.xwayland->surface->events.unmap : &m_uSurface.xdg->surface->events.unmap, &Events::listener_unmapWindow, this, "CWindow"); + + m_vReportedSize = m_vPendingReportedSize; } void CWindow::onBorderAngleAnimEnd(void* ptr) { @@ -882,6 +885,9 @@ bool CWindow::opaque() { const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID); + if (m_pWLSurface.small() && !m_pWLSurface.m_bFillIgnoreSmall) + return false; + if (PWORKSPACE->m_fAlpha.fl() != 1.f) return false; |
