mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-09 23:45:58 +01:00
format
This commit is contained in:
parent
1d3023cf24
commit
8b21a37059
21 changed files with 99 additions and 94 deletions
|
@ -693,8 +693,7 @@ PHLWINDOW CCompositor::vectorToWindowUnified(const Vector2D& pos, uint8_t proper
|
||||||
for (auto& w : m_vWindows | std::views::reverse) {
|
for (auto& w : m_vWindows | std::views::reverse) {
|
||||||
const auto BB = w->getWindowBoxUnified(properties);
|
const auto BB = w->getWindowBoxUnified(properties);
|
||||||
CBox box = {BB.x - BORDER_GRAB_AREA, BB.y - BORDER_GRAB_AREA, BB.width + 2 * BORDER_GRAB_AREA, BB.height + 2 * BORDER_GRAB_AREA};
|
CBox box = {BB.x - BORDER_GRAB_AREA, BB.y - BORDER_GRAB_AREA, BB.width + 2 * BORDER_GRAB_AREA, BB.height + 2 * BORDER_GRAB_AREA};
|
||||||
if (w->m_bIsFloating && w->m_bIsMapped && !w->isHidden() && !w->m_bX11ShouldntFocus && w->m_bPinned && !w->m_sAdditionalConfigData.noFocus &&
|
if (w->m_bIsFloating && w->m_bIsMapped && !w->isHidden() && !w->m_bX11ShouldntFocus && w->m_bPinned && !w->m_sAdditionalConfigData.noFocus && w != pIgnoreWindow) {
|
||||||
w != pIgnoreWindow) {
|
|
||||||
if (box.containsPoint({m_sWLRCursor->x, m_sWLRCursor->y}))
|
if (box.containsPoint({m_sWLRCursor->x, m_sWLRCursor->y}))
|
||||||
return w;
|
return w;
|
||||||
|
|
||||||
|
@ -934,7 +933,7 @@ void CCompositor::focusWindow(PHLWINDOW pWindow, wlr_surface* pSurface) {
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","});
|
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","});
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
|
g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
|
||||||
|
|
||||||
EMIT_HOOK_EVENT("activeWindow", (PHLWINDOW)nullptr);
|
EMIT_HOOK_EVENT("activeWindow", (PHLWINDOW) nullptr);
|
||||||
|
|
||||||
g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(nullptr);
|
g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(nullptr);
|
||||||
|
|
||||||
|
@ -1839,8 +1838,8 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) {
|
||||||
setBorderColor(pWindow->m_sSpecialRenderData.activeBorderColor.toUnderlying().m_vColors.empty() ? *ACTIVECOLOR :
|
setBorderColor(pWindow->m_sSpecialRenderData.activeBorderColor.toUnderlying().m_vColors.empty() ? *ACTIVECOLOR :
|
||||||
pWindow->m_sSpecialRenderData.activeBorderColor.toUnderlying());
|
pWindow->m_sSpecialRenderData.activeBorderColor.toUnderlying());
|
||||||
} else {
|
} else {
|
||||||
const auto* const INACTIVECOLOR =
|
const auto* const INACTIVECOLOR = !pWindow->m_sGroupData.pNextWindow.lock() ? (!pWindow->m_sGroupData.deny ? INACTIVECOL : NOGROUPINACTIVECOL) :
|
||||||
!pWindow->m_sGroupData.pNextWindow.lock() ? (!pWindow->m_sGroupData.deny ? INACTIVECOL : NOGROUPINACTIVECOL) : (GROUPLOCKED ? GROUPINACTIVELOCKEDCOL : GROUPINACTIVECOL);
|
(GROUPLOCKED ? GROUPINACTIVELOCKEDCOL : GROUPINACTIVECOL);
|
||||||
setBorderColor(pWindow->m_sSpecialRenderData.inactiveBorderColor.toUnderlying().m_vColors.empty() ? *INACTIVECOLOR :
|
setBorderColor(pWindow->m_sSpecialRenderData.inactiveBorderColor.toUnderlying().m_vColors.empty() ? *INACTIVECOLOR :
|
||||||
pWindow->m_sSpecialRenderData.inactiveBorderColor.toUnderlying());
|
pWindow->m_sSpecialRenderData.inactiveBorderColor.toUnderlying());
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,8 @@ void Events::listener_destroyDrag(void* owner, void* data) {
|
||||||
g_pInputManager->m_sDrag.dragIcon = nullptr;
|
g_pInputManager->m_sDrag.dragIcon = nullptr;
|
||||||
g_pInputManager->m_sDrag.hyprListener_destroy.removeCallback();
|
g_pInputManager->m_sDrag.hyprListener_destroy.removeCallback();
|
||||||
|
|
||||||
g_pCompositor->focusWindow(g_pCompositor->m_pLastWindow.lock(), g_pCompositor->m_pLastWindow.lock() ? g_pXWaylandManager->getWindowSurface(g_pCompositor->m_pLastWindow.lock()) : nullptr);
|
g_pCompositor->focusWindow(g_pCompositor->m_pLastWindow.lock(),
|
||||||
|
g_pCompositor->m_pLastWindow.lock() ? g_pXWaylandManager->getWindowSurface(g_pCompositor->m_pLastWindow.lock()) : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::listener_mapDragIcon(void* owner, void* data) {
|
void Events::listener_mapDragIcon(void* owner, void* data) {
|
||||||
|
|
|
@ -505,14 +505,16 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
PWINDOW->hyprListener_requestMinimize.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_minimize, &Events::listener_requestMinimize, PWINDOW.get(),
|
PWINDOW->hyprListener_requestMinimize.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_minimize, &Events::listener_requestMinimize, PWINDOW.get(),
|
||||||
"XDG Window Late");
|
"XDG Window Late");
|
||||||
PWINDOW->hyprListener_requestMove.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_move, &Events::listener_requestMove, PWINDOW.get(), "XDG Window Late");
|
PWINDOW->hyprListener_requestMove.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_move, &Events::listener_requestMove, PWINDOW.get(), "XDG Window Late");
|
||||||
PWINDOW->hyprListener_requestResize.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_resize, &Events::listener_requestResize, PWINDOW.get(), "XDG Window Late");
|
PWINDOW->hyprListener_requestResize.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_resize, &Events::listener_requestResize, PWINDOW.get(),
|
||||||
|
"XDG Window Late");
|
||||||
PWINDOW->hyprListener_fullscreenWindow.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_fullscreen, &Events::listener_fullscreenWindow, PWINDOW.get(),
|
PWINDOW->hyprListener_fullscreenWindow.initCallback(&PWINDOW->m_uSurface.xdg->toplevel->events.request_fullscreen, &Events::listener_fullscreenWindow, PWINDOW.get(),
|
||||||
"XDG Window Late");
|
"XDG Window Late");
|
||||||
PWINDOW->hyprListener_ackConfigure.initCallback(&PWINDOW->m_uSurface.xdg->events.ack_configure, &Events::listener_ackConfigure, PWINDOW.get(), "XDG Window Late");
|
PWINDOW->hyprListener_ackConfigure.initCallback(&PWINDOW->m_uSurface.xdg->events.ack_configure, &Events::listener_ackConfigure, PWINDOW.get(), "XDG Window Late");
|
||||||
} else {
|
} else {
|
||||||
PWINDOW->hyprListener_fullscreenWindow.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_fullscreen, &Events::listener_fullscreenWindow, PWINDOW.get(),
|
PWINDOW->hyprListener_fullscreenWindow.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_fullscreen, &Events::listener_fullscreenWindow, PWINDOW.get(),
|
||||||
"XWayland Window Late");
|
"XWayland Window Late");
|
||||||
PWINDOW->hyprListener_activateX11.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_activate, &Events::listener_activateX11, PWINDOW.get(), "XWayland Window Late");
|
PWINDOW->hyprListener_activateX11.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_activate, &Events::listener_activateX11, PWINDOW.get(),
|
||||||
|
"XWayland Window Late");
|
||||||
PWINDOW->hyprListener_setTitleWindow.initCallback(&PWINDOW->m_uSurface.xwayland->events.set_title, &Events::listener_setTitleWindow, PWINDOW.get(), "XWayland Window Late");
|
PWINDOW->hyprListener_setTitleWindow.initCallback(&PWINDOW->m_uSurface.xwayland->events.set_title, &Events::listener_setTitleWindow, PWINDOW.get(), "XWayland Window Late");
|
||||||
PWINDOW->hyprListener_requestMinimize.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_minimize, &Events::listener_requestMinimize, PWINDOW.get(),
|
PWINDOW->hyprListener_requestMinimize.initCallback(&PWINDOW->m_uSurface.xwayland->events.request_minimize, &Events::listener_requestMinimize, PWINDOW.get(),
|
||||||
"Xwayland Window Late");
|
"Xwayland Window Late");
|
||||||
|
@ -763,7 +765,7 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
if (PWINDOW == g_pCompositor->m_pLastWindow.lock() || !g_pCompositor->m_pLastWindow.lock()) {
|
if (PWINDOW == g_pCompositor->m_pLastWindow.lock() || !g_pCompositor->m_pLastWindow.lock()) {
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","});
|
g_pEventManager->postEvent(SHyprIPCEvent{"activewindow", ","});
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
|
g_pEventManager->postEvent(SHyprIPCEvent{"activewindowv2", ","});
|
||||||
EMIT_HOOK_EVENT("activeWindow", (PHLWINDOW)nullptr);
|
EMIT_HOOK_EVENT("activeWindow", (PHLWINDOW) nullptr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Debug::log(LOG, "Unmapped was not focused, ignoring a refocus.");
|
Debug::log(LOG, "Unmapped was not focused, ignoring a refocus.");
|
||||||
|
|
|
@ -419,7 +419,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
|
|
||||||
if (FOLLOWMOUSE != 1 && !refocus) {
|
if (FOLLOWMOUSE != 1 && !refocus) {
|
||||||
if (pFoundWindow != g_pCompositor->m_pLastWindow.lock() && g_pCompositor->m_pLastWindow.lock() &&
|
if (pFoundWindow != g_pCompositor->m_pLastWindow.lock() && g_pCompositor->m_pLastWindow.lock() &&
|
||||||
((pFoundWindow->m_bIsFloating && *PFLOATBEHAVIOR == 2) || (g_pCompositor->m_pLastWindow.lock()->m_bIsFloating != pFoundWindow->m_bIsFloating && *PFLOATBEHAVIOR != 0))) {
|
((pFoundWindow->m_bIsFloating && *PFLOATBEHAVIOR == 2) ||
|
||||||
|
(g_pCompositor->m_pLastWindow.lock()->m_bIsFloating != pFoundWindow->m_bIsFloating && *PFLOATBEHAVIOR != 0))) {
|
||||||
// enter if change floating style
|
// enter if change floating style
|
||||||
if (FOLLOWMOUSE != 3 && allowKeyboardRefocus)
|
if (FOLLOWMOUSE != 3 && allowKeyboardRefocus)
|
||||||
g_pCompositor->focusWindow(pFoundWindow, foundSurface);
|
g_pCompositor->focusWindow(pFoundWindow, foundSurface);
|
||||||
|
|
|
@ -66,7 +66,8 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) {
|
||||||
|
|
||||||
if (m_sTouchData.touchFocusWindow.lock()) {
|
if (m_sTouchData.touchFocusWindow.lock()) {
|
||||||
if (m_sTouchData.touchFocusWindow.lock()->m_bIsX11) {
|
if (m_sTouchData.touchFocusWindow.lock()->m_bIsX11) {
|
||||||
local = (g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchFocusWindow.lock()->m_vRealPosition.goal()) * m_sTouchData.touchFocusWindow.lock()->m_fX11SurfaceScaledBy;
|
local = (g_pInputManager->getMouseCoordsInternal() - m_sTouchData.touchFocusWindow.lock()->m_vRealPosition.goal()) *
|
||||||
|
m_sTouchData.touchFocusWindow.lock()->m_fX11SurfaceScaledBy;
|
||||||
m_sTouchData.touchSurfaceOrigin = m_sTouchData.touchFocusWindow.lock()->m_vRealPosition.goal();
|
m_sTouchData.touchSurfaceOrigin = m_sTouchData.touchFocusWindow.lock()->m_vRealPosition.goal();
|
||||||
} else {
|
} else {
|
||||||
g_pCompositor->vectorWindowToSurface(g_pInputManager->getMouseCoordsInternal(), m_sTouchData.touchFocusWindow.lock(), local);
|
g_pCompositor->vectorWindowToSurface(g_pInputManager->getMouseCoordsInternal(), m_sTouchData.touchFocusWindow.lock(), local);
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
|
|
||||||
CTearingControlProtocol::CTearingControlProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
|
CTearingControlProtocol::CTearingControlProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
|
||||||
static auto P = g_pHookSystem->hookDynamic("destroyWindow", [this](void* self, SCallbackInfo& info, std::any param) { this->onWindowDestroy(std::any_cast<PHLWINDOW>(param)); });
|
static auto P =
|
||||||
|
g_pHookSystem->hookDynamic("destroyWindow", [this](void* self, SCallbackInfo& info, std::any param) { this->onWindowDestroy(std::any_cast<PHLWINDOW>(param)); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTearingControlProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
|
void CTearingControlProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
|
||||||
|
|
|
@ -1828,7 +1828,6 @@ void CHyprOpenGLImpl::renderSnapshot(PHLWINDOW pWindow) {
|
||||||
|
|
||||||
PHLWINDOWREF ref{pWindow};
|
PHLWINDOWREF ref{pWindow};
|
||||||
|
|
||||||
|
|
||||||
if (!m_mWindowFramebuffers.contains(ref))
|
if (!m_mWindowFramebuffers.contains(ref))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,8 @@ void CHyprBorderDecoration::draw(CMonitor* pMonitor, float a) {
|
||||||
if (m_bAssignedGeometry.width < m_seExtents.topLeft.x + 1 || m_bAssignedGeometry.height < m_seExtents.topLeft.y + 1)
|
if (m_bAssignedGeometry.width < m_seExtents.topLeft.x + 1 || m_bAssignedGeometry.height < m_seExtents.topLeft.y + 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CBox windowBox = assignedBoxGlobal().translate(-pMonitor->vecPosition + m_pWindow.lock()->m_vFloatingOffset).expand(-m_pWindow.lock()->getRealBorderSize()).scale(pMonitor->scale).round();
|
CBox windowBox =
|
||||||
|
assignedBoxGlobal().translate(-pMonitor->vecPosition + m_pWindow.lock()->m_vFloatingOffset).expand(-m_pWindow.lock()->getRealBorderSize()).scale(pMonitor->scale).round();
|
||||||
|
|
||||||
if (windowBox.width < 1 || windowBox.height < 1)
|
if (windowBox.width < 1 || windowBox.height < 1)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -125,8 +125,8 @@ void CDecorationPositioner::onWindowUpdate(PHLWINDOW pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WINDOWDATA->lastWindowSize == pWindow->m_vRealSize.value() /* position not changed */
|
if (WINDOWDATA->lastWindowSize == pWindow->m_vRealSize.value() /* position not changed */
|
||||||
&&
|
&& std::all_of(m_vWindowPositioningDatas.begin(), m_vWindowPositioningDatas.end(),
|
||||||
std::all_of(m_vWindowPositioningDatas.begin(), m_vWindowPositioningDatas.end(), [pWindow](const auto& data) { return pWindow != data->pWindow.lock() || !data->needsReposition; })
|
[pWindow](const auto& data) { return pWindow != data->pWindow.lock() || !data->needsReposition; })
|
||||||
/* all window datas are either not for this window or don't need a reposition */
|
/* all window datas are either not for this window or don't need a reposition */
|
||||||
&& !WINDOWDATA->needsRecalc /* window doesn't need recalc */
|
&& !WINDOWDATA->needsRecalc /* window doesn't need recalc */
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue