pop-os / cosmic-dock

Pop!_OS fork of https://github.com/micheleg/dash-to-dock/tree/ubuntu-dock
GNU General Public License v2.0
72 stars 18 forks source link

Fixed Scaling issues for the dock when previewing on different scales #171

Closed NathanaelA closed 2 years ago

NathanaelA commented 2 years ago

This fixed #44, a rebase of my #48 on to Jammy (with some new fixes). This also has code to fix the potential error that was reported in #148 where apparently the the scale must be invalid directly after a monitor is plugged in/unplugged.

In addition the original math for the windowPreview was subtracting -22 pixels AFTER the scale calculation, this 22 pixels (11 for each side) should have been subtracted out before the scale was applied so that this window (see below) is actually centered properly on scaled displays.

image

NathanaelA commented 2 years ago
  1. Without the patch, does it center properly?

  2. Is this only LDPI? I'm using a Bonobo like this: image And it looks correct. (afaik, with the daemon disabled the bottom setting doesn't do anything, but the daemon caused lots of weird issues in day to day work, that I finally disabled it).

However, I did notice that if I switched it down to 100% scaling that it wasn't centered -- but 100% should be handled identical to the original code without any of my extra scaling handling code added -- because that would be ( Width / 1 = Width ).