mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 00:34:45 +00:00
quicksettings: Fix crash when stop record
This commit is contained in:
parent
3d4b31c26b
commit
11af97b83e
2 changed files with 13 additions and 2 deletions
|
|
@ -17,6 +17,6 @@ add_subdirectory(flashlight)
|
||||||
add_subdirectory(nightcolor)
|
add_subdirectory(nightcolor)
|
||||||
add_subdirectory(powermenu)
|
add_subdirectory(powermenu)
|
||||||
# TODO: Disable screen recording quick setting, as it does not work properly
|
# TODO: Disable screen recording quick setting, as it does not work properly
|
||||||
# add_subdirectory(record)
|
add_subdirectory(record)
|
||||||
add_subdirectory(screenshot)
|
add_subdirectory(screenshot)
|
||||||
add_subdirectory(screenrotation)
|
add_subdirectory(screenrotation)
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,21 @@ QS.QuickSetting {
|
||||||
}
|
}
|
||||||
icon: "media-record"
|
icon: "media-record"
|
||||||
enabled: false
|
enabled: false
|
||||||
|
available: record.encoder != PWRec.PipeWireRecord.NoEncoder
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
if (!record.active) {
|
if (!record.active) {
|
||||||
record.output = RecordUtil.videoLocation("screen-recording.mp4");
|
// See this https://invent.kde.org/plasma/kpipewire/-/blob/eb21912e7e0ce5a70c6f906c6e5a20f56cc6783e/src/pipewirerecord.cpp#L82
|
||||||
|
switch (record.encoder) {
|
||||||
|
case PWRec.PipeWireRecord.H264Main:
|
||||||
|
case PWRec.PipeWireRecord.H264Baseline:
|
||||||
|
record.output = RecordUtil.videoLocation("screen-recording.mp4");
|
||||||
|
break;
|
||||||
|
case PWRec.PipeWireRecord.VP8:
|
||||||
|
case PWRec.PipeWireRecord.VP9:
|
||||||
|
record.output = RecordUtil.videoLocation("screen-recording.webm");
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
RecordUtil.showNotification(i18n("New Screen Recording"), i18n("New Screen Recording saved in %1", record.output), record.output);
|
RecordUtil.showNotification(i18n("New Screen Recording"), i18n("New Screen Recording saved in %1", record.output), record.output);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue