Skip to content

osc.lua: allow clicking window controls from the top#17619

Open
guidocella wants to merge 2 commits intompv-player:masterfrom
guidocella:windowcontrols-fitts
Open

osc.lua: allow clicking window controls from the top#17619
guidocella wants to merge 2 commits intompv-player:masterfrom
guidocella:windowcontrols-fitts

Conversation

@guidocella
Copy link
Copy Markdown
Contributor

Allow clicking window controls buttons when the mouse is at the top of the window to make them easier to click.

The close button with the default windowcontrols_alignment=right specifically is already clickable from the rightmost part of the window.

Partial fix of #9791.

@guidocella
Copy link
Copy Markdown
Contributor Author

Also fixed clicking from the bottom.

@avih
Copy link
Copy Markdown
Member

avih commented Mar 22, 2026

I can't understand what the PR actually does.

The commit message[s] should state clearly: "Before this commit doing XYZ was impossible. XYZ is useful because... Now XYZ is possible."

@guidocella guidocella force-pushed the windowcontrols-fitts branch from 6f56cef to 152ed0b Compare March 22, 2026 11:09
@guidocella
Copy link
Copy Markdown
Contributor Author

Because it's already explained in detail in the linked issue. I reworded it a bit, I guess.

@avih
Copy link
Copy Markdown
Member

avih commented Mar 22, 2026

Because it's already explained in detail in the linked issue

When someone looks at the mpv git log, on on plane, they shouldn't have to open a browser to tell what actually gets fixed here.

The reworded 1st commit looks better. Thanks.

Please add a similar comment at the 2nd commit too, and if it's a partial fix as the message says, please explain which part gets fixed here, and which still remains an issue.

@na-na-hi
Copy link
Copy Markdown
Contributor

First commit works, but

osc.lua: allow clicking bottombar buttons from the bottom of the window

Does this fix anything? These buttons are already clickable at the bottom border in master.

@kasper93
Copy link
Copy Markdown
Member

Does this fix anything? These buttons are already clickable at the bottom border in master.

I don't know about this PR, but on master at least play/pause button should extend to left border to allow it to be clickable in the bottom left corner.

@na-na-hi
Copy link
Copy Markdown
Contributor

I don't know about this PR, but on master at least play/pause button should extend to left border to allow it to be clickable in the bottom left corner.

I agree. This PR does not fix it.

@guidocella
Copy link
Copy Markdown
Contributor Author

Does this fix anything? These buttons are already clickable at the bottom border in master.

2nd commit is about clicking the bottom buttons like play_pause from the bottom, not the window controls.

Fixing it horizontally needs more work. I tried adding \h\h\h to play_pause's content and removing padX but the position of other buttons and the seekbar also need to be updated.

Window controls are not clickable from the very top of the window, they
have a margin to the top that makes them harder to click. Make them
clickable also from the very top to make them easier to activate.

The close button with the default windowcontrols_alignment=right
specifically is already clickable from the rightmost part of the window.

Partial fix of mpv-player#9791 (other buttons also need to be updated).
@guidocella guidocella force-pushed the windowcontrols-fitts branch from 152ed0b to d9a4d0c Compare March 22, 2026 12:15
@guidocella
Copy link
Copy Markdown
Contributor Author

Oh wait you are right, they are already clickable from the bottom. What the commit does is remove the empty space between the 2 lines.

@guidocella guidocella force-pushed the windowcontrols-fitts branch from d9a4d0c to 180206c Compare March 22, 2026 12:20
@kasper93
Copy link
Copy Markdown
Member

What the commit does is remove the empty space between the 2 lines.

Is this desirable? I would expect small deadzone between buttons, so if I misclick a little it does nothing and not do something else.

@guidocella
Copy link
Copy Markdown
Contributor Author

Dunno but at the same time the menu button is small and you have to click exactly within it. Thoughts?

@guidocella
Copy link
Copy Markdown
Contributor Author

Actually commit 2 does fix clicking from the bottom with slimbottombar.

There is an area between the 2 lines of bottombar and topbar that is not
clickable, e.g. between the menu and play_pause icons. Make it all
clickable so it's easier to click buttons.

This also allows clicking from the bottom in slimbottombar and from the
top in topbottombar.
@guidocella guidocella force-pushed the windowcontrols-fitts branch from 180206c to 0116771 Compare March 24, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants