core/window: move input mask handling + commit scheduling to polish

This commit is contained in:
outfoxxed 2025-01-20 00:51:56 -08:00
parent d6b58521e9
commit 6464ead0f1
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 76 additions and 32 deletions

View file

@ -62,7 +62,7 @@ void HyprlandWindow::setOpacity(qreal opacity) {
if (this->surface) {
this->surface->setOpacity(opacity);
qs::wayland::util::scheduleCommit(this->mWaylandWindow);
qs::wayland::util::scheduleCommit(this->proxyWindow);
}
emit this->opacityChanged();
@ -127,7 +127,7 @@ void HyprlandWindow::onWaylandSurfaceCreated() {
if (this->mOpacity != 1.0) {
this->surface->setOpacity(this->mOpacity);
qs::wayland::util::scheduleCommit(this->mWaylandWindow);
qs::wayland::util::scheduleCommit(this->proxyWindow);
}
}

View file

@ -1,17 +1,9 @@
#include "util.hpp"
#include <private/qwaylandwindow_p.h>
#include <qpa/qwindowsysteminterface.h>
#include "../window/proxywindow.hpp"
namespace qs::wayland::util {
void scheduleCommit(QtWaylandClient::QWaylandWindow* window) {
// This seems to be one of the less offensive ways to force Qt to send a wl_surface.commit on its own terms.
// Ideally we would trigger the commit more directly.
QWindowSystemInterface::handleExposeEvent(
window->window(),
QRect(QPoint(), window->geometry().size())
);
}
void scheduleCommit(ProxyWindowBase* window) { window->schedulePolish(); }
} // namespace qs::wayland::util

View file

@ -1,9 +1,9 @@
#pragma once
#include <private/qwaylandwindow_p.h>
#include "../window/proxywindow.hpp"
namespace qs::wayland::util {
void scheduleCommit(QtWaylandClient::QWaylandWindow* window);
void scheduleCommit(ProxyWindowBase* window);
}