Skip to content

Commit 567f794

Browse files
committed
If available, hide uosc during selection
1 parent d0390c8 commit 567f794

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/crop.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ function cancel_crop()
340340
mp.unregister_idle(draw_crop_zone)
341341
mp.set_osd_ass(1280, 720, '')
342342
active = false
343+
if uosc_available and uosc_off then
344+
mp.commandv('script-message-to', 'uosc', 'disable-elements', mp.get_script_name(), '')
345+
uosc_off = false
346+
end
343347
end
344348

345349
function start_crop(mode)
@@ -360,6 +364,10 @@ function start_crop(mode)
360364
active = true
361365
active_mode = mode_maybe
362366

367+
if uosc_available then
368+
mp.commandv('script-message-to', 'uosc', 'disable-elements', mp.get_script_name(), 'timeline,controls,volume,top_bar')
369+
uosc_off = true
370+
end
363371
if opts.mouse_support then
364372
crop_cursor.x, crop_cursor.y = mp.get_mouse_pos()
365373
end
@@ -403,6 +411,11 @@ function toggle_crop(mode)
403411
end
404412
end
405413

414+
-- check if uosc is available
415+
mp.register_script_message('uosc-version', function(version)
416+
uosc_available = true
417+
end)
418+
406419
-- bindings
407420
if opts.mouse_support then
408421
bindings["MOUSE_MOVE"] = function() crop_cursor.x, crop_cursor.y = mp.get_mouse_pos(); redraw() end

0 commit comments

Comments
 (0)