Skip to content

Commit

Permalink
Prevent idle when fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl-github-acc committed Sep 4, 2023
1 parent 9a1df68 commit a6a98eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <X11/XF86keysym.h>
/* appearance */
static const int noidlefullscreen = 1; /* disable idle when fullscreen */
static const int sloppyfocus = 1; /* focus follows mouse */
static const int mousefollowsfocus = 1; /* mouse follows focus */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
Expand Down
11 changes: 10 additions & 1 deletion dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,8 +1890,11 @@ void
killclient(const Arg *arg)
{
Client *sel = focustop(selmon);
if (sel)
if (sel) {
client_send_close(sel);
if (noidlefullscreen)
checkidleinhibitor(NULL);
}
}

void
Expand Down Expand Up @@ -2444,10 +2447,16 @@ setfullscreen(Client *c, int fullscreen)
if (fullscreen) {
c->prev = c->geom;
resize(c, c->mon->m, 0);
if (noidlefullscreen) {
wlr_idle_set_enabled(idle, NULL, 0);
wlr_idle_notifier_v1_set_inhibited(idle_notifier, 1);
}
} else {
/* restore previous size instead of arrange for floating windows since
* client positions are set by the user and cannot be recalculated */
resize(c, c->prev, 0);
if (noidlefullscreen)
checkidleinhibitor(NULL);
}
arrange(c->mon);
printstatus();
Expand Down

0 comments on commit a6a98eb

Please sign in to comment.