mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 16:05:58 +01:00
xdgshell: bump to 6, send suspended states
This commit is contained in:
parent
5c7e23f86b
commit
d5811283d2
5 changed files with 32 additions and 2 deletions
|
@ -193,7 +193,7 @@ void CCompositor::initServer() {
|
|||
|
||||
m_sWLROutputPowerMgr = wlr_output_power_manager_v1_create(m_sWLDisplay);
|
||||
|
||||
m_sWLRXDGShell = wlr_xdg_shell_create(m_sWLDisplay, 5);
|
||||
m_sWLRXDGShell = wlr_xdg_shell_create(m_sWLDisplay, 6);
|
||||
|
||||
m_sWLRCursor = wlr_cursor_create();
|
||||
wlr_cursor_attach_output_layout(m_sWLRCursor, m_sWLROutputLayout);
|
||||
|
@ -2781,3 +2781,12 @@ void CCompositor::setPreferredScaleForSurface(wlr_surface* pSurface, double scal
|
|||
void CCompositor::setPreferredTransformForSurface(wlr_surface* pSurface, wl_output_transform transform) {
|
||||
wlr_surface_set_preferred_buffer_transform(pSurface, transform);
|
||||
}
|
||||
|
||||
void CCompositor::updateSuspendedStates() {
|
||||
for (auto& w : g_pCompositor->m_vWindows) {
|
||||
if (!w->m_bIsMapped)
|
||||
continue;
|
||||
|
||||
w->setSuspended(w->isHidden() || !g_pHyprRenderer->shouldRenderWindow(w.get()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,6 +208,7 @@ class CCompositor {
|
|||
void leaveUnsafeState();
|
||||
void setPreferredScaleForSurface(wlr_surface* pSurface, double scale);
|
||||
void setPreferredTransformForSurface(wlr_surface* pSurface, wl_output_transform transform);
|
||||
void updateSuspendedStates();
|
||||
|
||||
std::string explicitConfigPath;
|
||||
|
||||
|
|
|
@ -511,6 +511,8 @@ void CWindow::setHidden(bool hidden) {
|
|||
if (hidden && g_pCompositor->m_pLastWindow == this) {
|
||||
g_pCompositor->m_pLastWindow = nullptr;
|
||||
}
|
||||
|
||||
setSuspended(hidden);
|
||||
}
|
||||
|
||||
bool CWindow::isHidden() {
|
||||
|
@ -1007,3 +1009,13 @@ bool CWindow::shouldSendFullscreenState() {
|
|||
const auto MODE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID)->m_efFullscreenMode;
|
||||
return m_bFakeFullscreenState || (m_bIsFullscreen && (MODE == FULLSCREEN_FULL));
|
||||
}
|
||||
|
||||
void CWindow::setSuspended(bool suspend) {
|
||||
if (suspend == m_bSuspended)
|
||||
return;
|
||||
|
||||
if (m_bIsX11)
|
||||
return;
|
||||
|
||||
wlr_xdg_toplevel_set_suspended(m_uSurface.xdg->toplevel, suspend);
|
||||
}
|
||||
|
|
|
@ -367,6 +367,7 @@ class CWindow {
|
|||
float rounding();
|
||||
bool canBeTorn();
|
||||
bool shouldSendFullscreenState();
|
||||
void setSuspended(bool suspend);
|
||||
|
||||
int getRealBorderSize();
|
||||
void updateSpecialRenderData();
|
||||
|
@ -392,7 +393,8 @@ class CWindow {
|
|||
|
||||
private:
|
||||
// For hidden windows and stuff
|
||||
bool m_bHidden = false;
|
||||
bool m_bHidden = false;
|
||||
bool m_bSuspended = false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -565,6 +565,8 @@ void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool
|
|||
g_pCompositor->updateFullscreenFadeOnWorkspace(pWorkspace);
|
||||
|
||||
g_pConfigManager->ensureVRR(this);
|
||||
|
||||
g_pCompositor->updateSuspendedStates();
|
||||
}
|
||||
|
||||
void CMonitor::changeWorkspace(const int& id, bool internal) {
|
||||
|
@ -590,6 +592,8 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) {
|
|||
else
|
||||
g_pInputManager->refocus();
|
||||
|
||||
g_pCompositor->updateSuspendedStates();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -631,6 +635,8 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) {
|
|||
g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", pWorkspace->m_szName + "," + szName});
|
||||
|
||||
g_pHyprRenderer->damageMonitor(this);
|
||||
|
||||
g_pCompositor->updateSuspendedStates();
|
||||
}
|
||||
|
||||
void CMonitor::setSpecialWorkspace(const int& id) {
|
||||
|
|
Loading…
Reference in a new issue