mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
fodcusadjacenttag: Add selmon->sel guards for tagandviewtoleft/right to prevent segmentation faults ref. #191
This commit is contained in:
parent
ce270a320e
commit
84355a6d90
@ -63,7 +63,8 @@ viewtoright(const Arg *arg)
|
|||||||
void
|
void
|
||||||
tagandviewtoleft(const Arg *arg)
|
tagandviewtoleft(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
if (selmon->sel != NULL
|
||||||
|
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
&& selmon->tagset[selmon->seltags] > 1) {
|
&& selmon->tagset[selmon->seltags] > 1) {
|
||||||
selmon->sel->tags >>= 1;
|
selmon->sel->tags >>= 1;
|
||||||
selmon->seltags ^= 1; /* toggle sel tagset */
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
@ -83,7 +84,8 @@ tagandviewtoleft(const Arg *arg)
|
|||||||
void
|
void
|
||||||
tagandviewtoright(const Arg *arg)
|
tagandviewtoright(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
if (selmon->sel != NULL
|
||||||
|
&& __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1
|
||||||
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
&& selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) {
|
||||||
selmon->sel->tags <<= 1;
|
selmon->sel->tags <<= 1;
|
||||||
selmon->seltags ^= 1; /* toggle sel tagset */
|
selmon->seltags ^= 1; /* toggle sel tagset */
|
||||||
|
Loading…
Reference in New Issue
Block a user