Skip to content

Commit 6eeb9ce

Browse files
MrMartyKmisyltoad
authored andcommitted
fix: invert null checks in IsGamescopeProxy/Plane
The null checks were backwards - returning false for valid pointers and trying to dereference null ones. Matches the pattern already used in IsGamescopeToplevel.
1 parent f2dfad4 commit 6eeb9ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Backends/WaylandBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static inline uint32_t WaylandScaleToLogical( uint32_t pValue, uint32_t pFactor
8080
[[maybe_unused]] static bool IsGamescopeProxy( void *pProxy ) {
8181
// HACK: this probably should never be called with a null pointer, but it
8282
// was happening after a window was closed.
83-
if ( pProxy )
83+
if ( !pProxy )
8484
return false;
8585

8686
const char* const* pTag = wl_proxy_get_tag( (wl_proxy *)pProxy );
@@ -93,7 +93,7 @@ static inline uint32_t WaylandScaleToLogical( uint32_t pValue, uint32_t pFactor
9393
[[maybe_unused]] static bool IsGamescopePlane( wl_surface *pSurface ) {
9494
// HACK: this probably should never be called with a null pointer, but it
9595
// was happening after a window was closed.
96-
if ( pSurface )
96+
if ( !pSurface )
9797
return false;
9898
const char* const* pTag = wl_proxy_get_tag( (wl_proxy *)pSurface );
9999

0 commit comments

Comments
 (0)