mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-07-02 00:06:12 -04:00
opt: disable vrr when focus empty tag if not global enable vrr
This commit is contained in:
parent
82b98d999c
commit
31c00adea9
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);
|
client_change_mon(cur, m);
|
||||||
cur = cur->group_next;
|
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
|
|
@ -3922,7 +3922,8 @@ void focusclient(Client *c, int32_t lift) {
|
||||||
selmon->sel = c;
|
selmon->sel = c;
|
||||||
c->isfocusing = true;
|
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 &&
|
if (last_focus_client && !last_focus_client->iskilling &&
|
||||||
last_focus_client != c) {
|
last_focus_client != c) {
|
||||||
|
|
@ -4004,6 +4005,7 @@ void focusclient(Client *c, int32_t lift) {
|
||||||
// clear text input focus state
|
// clear text input focus state
|
||||||
dwl_im_relay_set_focus(dwl_input_method_relay, NULL);
|
dwl_im_relay_set_focus(dwl_input_method_relay, NULL);
|
||||||
wlr_seat_keyboard_notify_clear_focus(seat);
|
wlr_seat_keyboard_notify_clear_focus(seat);
|
||||||
|
check_vrr_enable(c);
|
||||||
if (active_constraint) {
|
if (active_constraint) {
|
||||||
cursorconstrain(NULL);
|
cursorconstrain(NULL);
|
||||||
}
|
}
|
||||||
|
|
@ -6531,12 +6533,24 @@ void check_keep_idle_inhibit(Client *c) {
|
||||||
|
|
||||||
void check_vrr_enable(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;
|
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);
|
enable_adaptive_sync(c->mon, &state);
|
||||||
wlr_output_commit_state(c->mon->wlr_output, &state);
|
wlr_output_commit_state(c->mon->wlr_output, &state);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue