mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 05:10:20 +01:00
Merge 735e44c0a4 into 6175ecd4c4
This commit is contained in:
commit
af3d69f197
2 changed files with 30 additions and 0 deletions
|
|
@ -310,6 +310,12 @@ void CWLSurfaceResource::leave(PHLMONITOR monitor) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!m_current.callbacks.empty()) {
|
||||
if (std::ranges::find(m_pendingLeaveOutputs, monitor) == m_pendingLeaveOutputs.end())
|
||||
m_pendingLeaveOutputs.emplace_back(monitor);
|
||||
return;
|
||||
}
|
||||
|
||||
std::erase(m_enteredOutputs, monitor);
|
||||
|
||||
m_resource->sendLeave(output->getResource().get());
|
||||
|
|
@ -337,6 +343,26 @@ void CWLSurfaceResource::frame(const Time::steady_tp& now) {
|
|||
}
|
||||
|
||||
m_current.callbacks.clear();
|
||||
|
||||
if (!m_pendingLeaveOutputs.empty()) {
|
||||
for (auto const& monitor : m_pendingLeaveOutputs) {
|
||||
if UNLIKELY (std::ranges::find(m_enteredOutputs, monitor) == m_enteredOutputs.end())
|
||||
continue;
|
||||
|
||||
if UNLIKELY (!PROTO::outputs.contains(monitor->m_name))
|
||||
continue;
|
||||
|
||||
auto output = PROTO::outputs.at(monitor->m_name)->outputResourceFrom(m_client);
|
||||
if UNLIKELY (!output)
|
||||
continue;
|
||||
|
||||
std::erase(m_enteredOutputs, monitor);
|
||||
|
||||
m_resource->sendLeave(output->getResource().get());
|
||||
m_events.leave.emit(monitor);
|
||||
}
|
||||
m_pendingLeaveOutputs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void CWLSurfaceResource::resetRole() {
|
||||
|
|
@ -457,6 +483,8 @@ void CWLSurfaceResource::unmap() {
|
|||
|
||||
m_mapped = false;
|
||||
|
||||
m_pendingLeaveOutputs.clear();
|
||||
|
||||
// release the buffers.
|
||||
// this is necessary for XWayland to function correctly,
|
||||
// as it does not unmap via the traditional commit(null buffer) method, but via the X11 protocol.
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ class CWLSurfaceResource {
|
|||
SP<CWlSurface> m_resource;
|
||||
wl_client* m_client = nullptr;
|
||||
|
||||
std::vector<PHLMONITORREF> m_pendingLeaveOutputs;
|
||||
|
||||
void destroy();
|
||||
void releaseBuffers(bool onlyCurrent = true);
|
||||
void dropPendingBuffer();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue