all repos — openbox @ efc875f5f273f3a5f62ae5c2937a771167740442

openbox fork - make it a bit more like ryudo

return a NULL instead of segfaulting when asserts are off
Dana Jansens danakj@orodu.net
commit

efc875f5f273f3a5f62ae5c2937a771167740442

parent

bcb8de973abcbf6bc0cb1c46e764276c34fa5380

1 files changed, 7 insertions(+), 0 deletions(-)

jump to
M src/openbox.hhsrc/openbox.hh

@@ -171,7 +171,14 @@

//! Returns a managed screen inline OBScreen *screen(int num) { assert(num >= 0); assert(num < (signed)_screens.size()); + if (num >= screenCount()) + return NULL; return _screens[num]; + } + + //! Returns the number of managed screens + inline int screenCount() const { + return (signed)_screens.size(); } //! Returns the mouse cursors used throughout Openbox