mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-07-11 11:05:00 -04:00
feat: distinguish dpms dispatch and disable dispatch in monitor
This commit is contained in:
parent
171d859cb5
commit
b0326d710c
5 changed files with 68 additions and 12 deletions
|
|
@ -73,6 +73,9 @@ int32_t setoption(const Arg *arg);
|
|||
int32_t disable_monitor(const Arg *arg);
|
||||
int32_t enable_monitor(const Arg *arg);
|
||||
int32_t toggle_monitor(const Arg *arg);
|
||||
int32_t dpms_off_monitor(const Arg *arg);
|
||||
int32_t dpms_on_monitor(const Arg *arg);
|
||||
int32_t dpms_toggle_monitor(const Arg *arg);
|
||||
int32_t scroller_stack(const Arg *arg);
|
||||
int32_t toggle_all_floating(const Arg *arg);
|
||||
int32_t dwindle_toggle_split_direction(const Arg *arg);
|
||||
|
|
|
|||
|
|
@ -1949,7 +1949,7 @@ int32_t disable_monitor(const Arg *arg) {
|
|||
if (match_monitor_spec(arg->v, m)) {
|
||||
wlr_output_state_set_enabled(&m->pending, false);
|
||||
mango_output_commit(m);
|
||||
m->asleep = 1;
|
||||
m->only_dpms_off = 0;
|
||||
updatemons(NULL, NULL);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1963,7 +1963,7 @@ int32_t enable_monitor(const Arg *arg) {
|
|||
if (match_monitor_spec(arg->v, m)) {
|
||||
wlr_output_state_set_enabled(&m->pending, true);
|
||||
mango_output_commit(m);
|
||||
m->asleep = 0;
|
||||
m->only_dpms_off = 0;
|
||||
updatemons(NULL, NULL);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1977,7 +1977,50 @@ int32_t toggle_monitor(const Arg *arg) {
|
|||
if (match_monitor_spec(arg->v, m)) {
|
||||
wlr_output_state_set_enabled(&m->pending, !m->wlr_output->enabled);
|
||||
mango_output_commit(m);
|
||||
m->asleep = !m->wlr_output->enabled;
|
||||
m->only_dpms_off = 0;
|
||||
updatemons(NULL, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t dpms_off_monitor(const Arg *arg) {
|
||||
Monitor *m = NULL;
|
||||
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
if (match_monitor_spec(arg->v, m)) {
|
||||
wlr_output_state_set_enabled(&m->pending, false);
|
||||
mango_output_commit(m);
|
||||
m->only_dpms_off = 1;
|
||||
updatemons(NULL, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t dpms_on_monitor(const Arg *arg) {
|
||||
Monitor *m = NULL;
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
if (match_monitor_spec(arg->v, m)) {
|
||||
wlr_output_state_set_enabled(&m->pending, true);
|
||||
mango_output_commit(m);
|
||||
m->only_dpms_off = 0;
|
||||
updatemons(NULL, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t dpms_toggle_monitor(const Arg *arg) {
|
||||
Monitor *m = NULL;
|
||||
wl_list_for_each(m, &mons, link) {
|
||||
if (match_monitor_spec(arg->v, m)) {
|
||||
wlr_output_state_set_enabled(&m->pending, !m->wlr_output->enabled);
|
||||
mango_output_commit(m);
|
||||
m->only_dpms_off = !m->wlr_output->enabled;
|
||||
updatemons(NULL, NULL);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue