-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
display: automatically update display scale
This setting has been removed, since there is a property that actually updates properly and dynamically based on which display the mpv window is on. I figured this property existed, but I never bothered actually adding it until now.
- Loading branch information
Showing
4 changed files
with
14 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
class Window | ||
osdScale = settings['display-scale-factor'] | ||
@@osdScale = mp.get_property_number("display-hidpi-scale", 1) | ||
|
||
@@w, @@h = 0, 0 | ||
@@_rawW, @@_rawH = 0, 0 | ||
|
||
@update: => | ||
w, h = mp.get_osd_size! | ||
osdScale = mp.get_property_number("display-hidpi-scale", 1) | ||
|
||
@_rawW, @_rawH = w, h | ||
w, h = math.floor( w/osdScale ), math.floor( h/osdScale ) | ||
if w != @w or h != @h | ||
@w, @h = w, h | ||
|
||
if w != @w or h != @h or osdScale != @osdScale | ||
@w, @h, @osdScale = w, h, osdScale | ||
return true | ||
else | ||
return false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters