Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Jun 10, 2024
1 parent 0f92514 commit cd1007c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 37 deletions.
14 changes: 7 additions & 7 deletions src/desktop/LayerSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "../protocols/LayerShell.hpp"
#include "../protocols/core/Compositor.hpp"
#include "../managers/SeatManager.hpp"
#include "managers/input/InputManager.hpp"

PHLLS CLayerSurface::create(SP<CLayerShellResource> resource) {
PHLLS pLS = SP<CLayerSurface>(new CLayerSurface(resource));
Expand Down Expand Up @@ -211,7 +210,8 @@ void CLayerSurface::onUnmap() {
return;

// refocus if needed
if (WASLASTFOCUS) g_pInputManager->refocusLastWindow(PMONITOR);
if (WASLASTFOCUS)
g_pInputManager->refocusLastWindow(PMONITOR);

CBox geomFixed = {geometry.x + PMONITOR->vecPosition.x, geometry.y + PMONITOR->vecPosition.y, geometry.width, geometry.height};
g_pHyprRenderer->damageBox(&geomFixed);
Expand Down Expand Up @@ -296,11 +296,11 @@ void CLayerSurface::onCommit() {
else if (WASEXCLUSIVE && !ISEXCLUSIVE)
std::erase_if(g_pInputManager->m_dExclusiveLSes, [this](const auto& other) { return !other.lock() || other.lock() == self.lock(); });

// if the surface was focused and interactive but now isn't, refocus
if (WASLASTFOCUS && !layerSurface->current.interactivity) {
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
} else if (!WASLASTFOCUS && (ISEXCLUSIVE || (layerSurface->current.interactivity && (g_pSeatManager->mouse.expired() || !g_pInputManager->isConstrained())))) {
// if not focused last and exclusive or accepting input + unconstrained
// if the surface was focused and interactive but now isn't, refocus
if (WASLASTFOCUS && !layerSurface->current.interactivity) {
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
} else if (!WASLASTFOCUS && (ISEXCLUSIVE || (layerSurface->current.interactivity && (g_pSeatManager->mouse.expired() || !g_pInputManager->isConstrained())))) {
// if not focused last and exclusive or accepting input + unconstrained
g_pSeatManager->setGrab(nullptr);
g_pInputManager->releaseAllMouseButtons();
g_pCompositor->focusSurface(surface->resource());
Expand Down
50 changes: 25 additions & 25 deletions src/desktop/LayerSurface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,40 @@ class CLayerSurface {
wl_list link;

// the header providing the enum type cannot be imported here
int interactivity = 0;
int interactivity = 0;

SP<CWLSurface> surface;
SP<CWLSurface> surface;

bool mapped = false;
uint32_t layer = 0;
bool mapped = false;
uint32_t layer = 0;

int monitorID = -1;
int monitorID = -1;

bool fadingOut = false;
bool readyToDelete = false;
bool noProcess = false;
bool noAnimations = false;
bool fadingOut = false;
bool readyToDelete = false;
bool noProcess = false;
bool noAnimations = false;

bool forceBlur = false;
bool forceBlurPopups = false;
int xray = -1;
bool ignoreAlpha = false;
float ignoreAlphaValue = 0.f;
bool dimAround = false;
bool forceBlur = false;
bool forceBlurPopups = false;
int xray = -1;
bool ignoreAlpha = false;
float ignoreAlphaValue = 0.f;
bool dimAround = false;

std::optional<std::string> animationStyle;
std::optional<std::string> animationStyle;

PHLLSREF self;
PHLLSREF self;

CBox geometry = {0, 0, 0, 0};
Vector2D position;
std::string szNamespace = "";
std::unique_ptr<CPopup> popupHead;
CBox geometry = {0, 0, 0, 0};
Vector2D position;
std::string szNamespace = "";
std::unique_ptr<CPopup> popupHead;

void onDestroy();
void onMap();
void onUnmap();
void onCommit();
void onDestroy();
void onMap();
void onUnmap();
void onCommit();

private:
struct {
Expand Down
1 change: 0 additions & 1 deletion src/managers/input/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,6 @@ void CInputManager::refocusLastWindow(CMonitor* pMonitor) {
if (!foundSurface && g_pCompositor->m_pLastWindow.lock() && g_pCompositor->isWorkspaceVisible(g_pCompositor->m_pLastWindow->m_pWorkspace)) {
// then the last focused window if we're on the same workspace as it
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
g_pCompositor->focusWindow(nullptr);
g_pCompositor->focusWindow(PLASTWINDOW);
} else {
// otherwise fall back to a normal refocus.
Expand Down
6 changes: 3 additions & 3 deletions src/managers/input/InputManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ class CInputManager {
bool isConstrained();

Vector2D getMouseCoordsInternal();
void refocus();
void refocusLastWindow(CMonitor* pMonitor);
void simulateMouseMovement();
void refocus();
void refocusLastWindow(CMonitor* pMonitor);
void simulateMouseMovement();
void sendMotionEventsToFocused();

void setKeyboardLayout();
Expand Down
2 changes: 1 addition & 1 deletion subprojects/wlroots-hyprland

0 comments on commit cd1007c

Please sign in to comment.