Skip to content

Commit 136d435

Browse files
committed
[Crop] fix for window-dragging changes in mpv
With recent changes to mpv, trying to select an area had a bit of an issue with detecting mouse input, turning off window-dragging while crop is active fixes thes issue.
1 parent 24cb2ac commit 136d435

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/crop.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local opts = {
99
draw_crosshair = true,
1010
draw_text = true,
1111
mouse_support = true,
12+
disable_window_dragging = true,
1213
coarse_movement = 30,
1314
left_coarse = "LEFT",
1415
right_coarse = "RIGHT",
@@ -389,6 +390,9 @@ function cancel_crop()
389390
mp.commandv('script-message-to', 'uosc', 'disable-elements', mp.get_script_name(), '')
390391
uosc_off = false
391392
end
393+
if opts.disable_window_dragging and not mp.get_property_bool("window-dragging") then
394+
mp.set_property_bool("window-dragging", true)
395+
end
392396
end
393397

394398
-- adjust coordinates based on previous values
@@ -552,6 +556,9 @@ function start_crop(mode)
552556
active = true
553557
active_mode = mode_maybe
554558

559+
if opts.disable_window_dragging then
560+
mp.set_property_bool("window-dragging", false)
561+
end
555562
if uosc_available then
556563
mp.commandv('script-message-to', 'uosc', 'disable-elements', mp.get_script_name(), 'timeline,controls,volume,top_bar')
557564
uosc_off = true

0 commit comments

Comments
 (0)