mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-24 13:36:42 -04:00
opt: disable vrr when focus empty tag if not global enable vrr
This commit is contained in:
parent
041a06e659
commit
5639b0728a
2 changed files with 18 additions and 9 deletions
|
|
@ -265,9 +265,4 @@ void client_set_group_mon(Client *c, Monitor *m) {
|
|||
client_change_mon(cur, m);
|
||||
cur = cur->group_next;
|
||||
}
|
||||
}
|
||||
|
||||
void handle_client_focus_change(Client *c) {
|
||||
check_keep_idle_inhibit(c);
|
||||
check_vrr_enable(c);
|
||||
}
|
||||
22
src/mango.c
22
src/mango.c
|
|
@ -4009,7 +4009,8 @@ void focusclient(Client *c, int32_t lift) {
|
|||
selmon->sel = c;
|
||||
c->isfocusing = true;
|
||||
|
||||
handle_client_focus_change(c);
|
||||
check_keep_idle_inhibit(c);
|
||||
check_vrr_enable(c);
|
||||
|
||||
if (last_focus_client && !last_focus_client->iskilling &&
|
||||
last_focus_client != c) {
|
||||
|
|
@ -4091,6 +4092,7 @@ void focusclient(Client *c, int32_t lift) {
|
|||
// clear text input focus state
|
||||
dwl_im_relay_set_focus(dwl_input_method_relay, NULL);
|
||||
wlr_seat_keyboard_notify_clear_focus(seat);
|
||||
check_vrr_enable(c);
|
||||
if (active_constraint) {
|
||||
cursorconstrain(NULL);
|
||||
}
|
||||
|
|
@ -6667,12 +6669,24 @@ void check_keep_idle_inhibit(Client *c) {
|
|||
|
||||
void check_vrr_enable(Client *c) {
|
||||
|
||||
if (!c || !c->mon)
|
||||
struct wlr_output_state state = {0};
|
||||
Monitor *m = c && c->mon ? c->mon : selmon;
|
||||
|
||||
if (!m)
|
||||
return;
|
||||
|
||||
struct wlr_output_state state = {0};
|
||||
if (!c && m && !m->iscleanuping && m->is_vrr_opening &&
|
||||
!m->vrr_global_enable) {
|
||||
disable_adaptive_sync(m, &state);
|
||||
wlr_output_commit_state(m->wlr_output, &state);
|
||||
return;
|
||||
}
|
||||
|
||||
if (c->vrr_only_fullscreen && c->isfullscreen && !c->mon->is_vrr_opening) {
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
if (VISIBLEON(c, c->mon) && c->vrr_only_fullscreen && c->isfullscreen &&
|
||||
!c->mon->is_vrr_opening) {
|
||||
enable_adaptive_sync(c->mon, &state);
|
||||
wlr_output_commit_state(c->mon->wlr_output, &state);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue