Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ All notable changes to ConfigurO are recorded here. The updater reads the
heading for the running version to decide what to show, so keep the
`## [x.y]` format.

## [3.3]

### Fixes
- **The whole interface has been rendering at 1.0 scale since 1.0.** The
Per-Monitor-V2 switches Windows Forms needs live in `App.config`, and the
release ships a single executable with no `ConfigurO.exe.config` beside it.
Run that way -- which is how everyone runs it -- `Control.DeviceDpi` answers
96 on every machine, so the layout was computed at 100% and drawn two-thirds
size on a 150% display. Not blurry: the manifest still makes the process
Per-Monitor-V2 aware, so the window was measured at exactly the size it asked
for. Just small and dense, which reads as an older build rather than as a
fault. Scale now comes from `GetDpiForWindow`, falling back to
`GetDpiForMonitor` on 8.1 and `GetDeviceCaps` before that. Win32 always knew;
nothing was asking it. Verified against the bare executable with no config
file present: 96/1.00 before, 144/1.50 after.
- **80 of the 139 app icons were drawn as logos in a black box.** They had been
flattened onto an opaque black background with no alpha channel, which is
invisible against a black page and a hard black square against the app's
`#232532` cards. Alpha is restored by flooding inward from the border, so
only black actually connected to the outside is removed and a dark detail
inside a mark survives -- Opera keeps its counter, 7-Zip keeps its grey
field, Vivaldi keeps its red tile. The one-pixel fringe where each logo was
antialiased against the black is un-premultiplied so the edges stay smooth
instead of leaving a halo. No black-matted icon remains; the five still
without an alpha channel are square by design.

## [3.2]

### Fixes
Expand Down
Binary file modified feed/icons.zip
Binary file not shown.
Binary file modified feed/icons/7zip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/adobereader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/androidstudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/antiexploit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/anydesk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/atom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/audacity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/balena.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/bittorrent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/blender.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/bsplayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/deluge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/discord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/dropbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/eclipse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/epic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/evernote.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/filezilla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/flux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/foobar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/foxit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/gimp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified feed/icons/github.png
Binary file modified feed/icons/gyazo.png
Binary file modified feed/icons/iobitdefrag.png
Binary file modified feed/icons/iobitdrivers.png
Binary file modified feed/icons/iobituninstall.png
Binary file modified feed/icons/iobitupdater.png
Binary file modified feed/icons/irfanview.png
Binary file modified feed/icons/itunes.png
Binary file modified feed/icons/java.png
Binary file modified feed/icons/klite.png
Binary file modified feed/icons/libreoffice.png
Binary file modified feed/icons/lightshot.png
Binary file modified feed/icons/malwarebytes.png
Binary file modified feed/icons/maxthon.png
Binary file modified feed/icons/mega.png
Binary file modified feed/icons/mp3tag.png
Binary file modified feed/icons/nodejs.png
Binary file modified feed/icons/notepadpp.png
Binary file modified feed/icons/onedrive.png
Binary file modified feed/icons/opera.png
Binary file modified feed/icons/origin.png
Binary file modified feed/icons/peazip.png
Binary file modified feed/icons/photofiltre.png
Binary file modified feed/icons/postman.png
Binary file modified feed/icons/potplayer.png
Binary file modified feed/icons/putty.png
Binary file modified feed/icons/python.png
Binary file modified feed/icons/qbittorrent.png
Binary file modified feed/icons/revo.png
Binary file modified feed/icons/rufus.png
Binary file modified feed/icons/skype.png
Binary file modified feed/icons/spotify.png
Binary file modified feed/icons/steam.png
Binary file modified feed/icons/sublimemerge.png
Binary file modified feed/icons/sublimetext.png
Binary file modified feed/icons/sumatrapdf.png
Binary file modified feed/icons/teams.png
Binary file modified feed/icons/teamviewer.png
Binary file modified feed/icons/thunderbird.png
Binary file modified feed/icons/tor.png
Binary file modified feed/icons/uplay.png
Binary file modified feed/icons/utorrent.png
Binary file modified feed/icons/uui.png
Binary file modified feed/icons/viber.png
Binary file modified feed/icons/viper.png
Binary file modified feed/icons/visualstudio.png
Binary file modified feed/icons/vivaldi.png
Binary file modified feed/icons/vlc.png
Binary file modified feed/icons/vscode.png
Binary file modified feed/icons/vscodium.png
Binary file modified feed/icons/winamp.png
Binary file modified feed/icons/winrar.png
Binary file modified feed/icons/winscp.png
Binary file modified feed/icons/xampp.png
Binary file modified feed/icons/zoom.png
2 changes: 1 addition & 1 deletion src/ConfigurO/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void OnLoaded(object sender, EventArgs e)
TitleBar == null ? "absent" : "present",
TitleBar == null ? "-" : TitleBar.Bounds.ToString(),
TitleBar == null ? 0 : TitleBar.Height,
DeviceDpi,
NocturneScale.DpiOf(Handle),
NocturneScale.Factor.ToString("0.00",
System.Globalization.CultureInfo.InvariantCulture),
NocturneFonts.Bundled));
Expand Down
74 changes: 74 additions & 0 deletions src/ConfigurO/Nocturne/NocturneScale.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace ConfigurO
Expand Down Expand Up @@ -39,6 +40,79 @@ internal static void SetDpi(int dpi)
Factor = dpi / Base;
}

// ── Asking the system, not the framework ────────────────────────
const int LOGPIXELSX = 88;
const int MDT_EFFECTIVE_DPI = 0;
const int MONITOR_DEFAULTTONEAREST = 2;

[DllImport("user32.dll")] static extern uint GetDpiForWindow(IntPtr hwnd);
[DllImport("user32.dll")] static extern IntPtr MonitorFromWindow(IntPtr hwnd, int flags);
[DllImport("user32.dll")] static extern IntPtr GetDC(IntPtr hwnd);
[DllImport("user32.dll")] static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
[DllImport("gdi32.dll")] static extern int GetDeviceCaps(IntPtr hdc, int index);
[DllImport("shcore.dll")] static extern int GetDpiForMonitor(IntPtr monitor, int type, out uint x, out uint y);

/// <summary>
/// The DPI of the display <paramref name="hwnd"/> is on, straight from
/// Win32.
///
/// Deliberately not Control.DeviceDpi. WinForms on .NET Framework only
/// reports a real DPI when the DpiAwareness switches in App.config are
/// present, and those live in ConfigurO.exe.config -- a file the
/// release does not ship, because the app is distributed as one
/// executable. Run that way, DeviceDpi answers 96 on every machine,
/// the whole interface lays out at 1.0, and on a 150% display it comes
/// out two-thirds of the size it was drawn at. It is crisp, because
/// the manifest still makes the process Per-Monitor-V2 aware at the
/// Win32 level -- it is simply small, which reads as an older, denser
/// build of the app rather than as a bug.
///
/// Win32 has always known the right answer; nothing was asking it.
/// Every version since 1.0 shipped this way.
///
/// Falls back the way the API history goes: GetDpiForWindow is
/// Windows 10 1607, GetDpiForMonitor is 8.1, and GetDeviceCaps is the
/// system-wide value that works everywhere else.
/// </summary>
internal static int DpiOf(IntPtr hwnd)
{
if (hwnd != IntPtr.Zero)
{
try
{
uint d = GetDpiForWindow(hwnd);
if (d > 0) return (int)d;
}
catch (EntryPointNotFoundException) { } // pre-1607
catch (DllNotFoundException) { }

try
{
IntPtr monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
uint x, y;
if (monitor != IntPtr.Zero &&
GetDpiForMonitor(monitor, MDT_EFFECTIVE_DPI, out x, out y) == 0 && x > 0)
return (int)x;
}
catch (EntryPointNotFoundException) { } // pre-8.1
catch (DllNotFoundException) { }
}

try
{
IntPtr dc = GetDC(IntPtr.Zero);
if (dc != IntPtr.Zero)
{
int d = GetDeviceCaps(dc, LOGPIXELSX);
ReleaseDC(IntPtr.Zero, dc);
if (d > 0) return d;
}
}
catch (DllNotFoundException) { }

return 96;
}

/// <summary>Scales a design-token pixel value to the current display.</summary>
internal static int S(int v)
{
Expand Down
5 changes: 3 additions & 2 deletions src/ConfigurO/Nocturne/NocturneShell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ protected override void OnHandleCreated(EventArgs e)
// was computed at 96 DPI. Now that the target display is known,
// rescale before the first paint.
int previous = (int)Math.Round(NocturneScale.Factor * 96f);
NocturneScale.SetDpi(DeviceDpi);
if (DeviceDpi != previous)
int dpi = NocturneScale.DpiOf(Handle);
NocturneScale.SetDpi(dpi);
if (dpi != previous)
{
MinimumSize = NocturneScale.S(NocturneTheme.WindowMinimumSize);
if (WindowState == FormWindowState.Normal)
Expand Down
Loading