mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Allow turning on/off replay automatically when using fullscreen/power supply replay mode
This commit is contained in:
@@ -121,6 +121,8 @@ namespace gsr {
|
|||||||
|
|
||||||
mgl::Clock replay_status_update_clock;
|
mgl::Clock replay_status_update_clock;
|
||||||
std::string power_supply_online_filepath;
|
std::string power_supply_online_filepath;
|
||||||
|
bool power_supply_connected = false;
|
||||||
|
bool focused_window_is_fullscreen = false;
|
||||||
|
|
||||||
std::array<KeyBinding, 1> key_bindings;
|
std::array<KeyBinding, 1> key_bindings;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -899,11 +899,12 @@ namespace gsr {
|
|||||||
if(window && focused_window == window->get_system_handle())
|
if(window && focused_window == window->get_system_handle())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(recording_status == RecordingStatus::NONE) {
|
const bool prev_focused_window_is_fullscreen = focused_window_is_fullscreen;
|
||||||
if(focused_window != 0 && window_is_fullscreen(display, focused_window))
|
focused_window_is_fullscreen = focused_window != 0 && window_is_fullscreen(display, focused_window);
|
||||||
|
if(focused_window_is_fullscreen != prev_focused_window_is_fullscreen) {
|
||||||
|
if(recording_status == RecordingStatus::NONE && focused_window_is_fullscreen)
|
||||||
on_press_start_replay(false);
|
on_press_start_replay(false);
|
||||||
} else if(recording_status == RecordingStatus::REPLAY) {
|
else if(recording_status == RecordingStatus::REPLAY && !focused_window_is_fullscreen)
|
||||||
if(focused_window == 0 || !window_is_fullscreen(display, focused_window))
|
|
||||||
on_press_start_replay(true);
|
on_press_start_replay(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -912,12 +913,13 @@ namespace gsr {
|
|||||||
if(config.replay_config.turn_on_replay_automatically_mode != "turn_on_at_power_supply_connected")
|
if(config.replay_config.turn_on_replay_automatically_mode != "turn_on_at_power_supply_connected")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(recording_status == RecordingStatus::NONE) {
|
const bool prev_power_supply_status = power_supply_connected;
|
||||||
if(power_supply_online_filepath.empty() || power_supply_is_connected(power_supply_online_filepath.c_str()))
|
power_supply_connected = power_supply_online_filepath.empty() || power_supply_is_connected(power_supply_online_filepath.c_str());
|
||||||
on_press_start_replay(true);
|
if(power_supply_connected != prev_power_supply_status) {
|
||||||
} else if(recording_status == RecordingStatus::REPLAY) {
|
if(recording_status == RecordingStatus::NONE && power_supply_connected)
|
||||||
if(!power_supply_online_filepath.empty() && !power_supply_is_connected(power_supply_online_filepath.c_str()))
|
on_press_start_replay(false);
|
||||||
on_press_start_replay(true);
|
else if(recording_status == RecordingStatus::REPLAY && !power_supply_connected)
|
||||||
|
on_press_start_replay(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user