Skip to content

Commit 3acdfa4

Browse files
committed
Merge branch 'develop' into prod
2 parents 31d9dd1 + d439deb commit 3acdfa4

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

Source/Components/ImageGlass.Base/Types/Const.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static class Const
8787
/// <summary>
8888
/// Gets built-in image formats
8989
/// </summary>
90-
public const string IMAGE_FORMATS = ".3fr;.apng;.ari;.arw;.avif;.b64;.bay;.bmp;.cap;.cr2;.cr3;.crw;.cur;.cut;.dcr;.dcs;.dds;.dib;.dng;.drf;.eip;.emf;.erf;.exif;.exr;.fff;.fits;.flif;.gif;.gifv;.gpr;.hdr;.heic;.heif;.ico;.iiq;.jp2;.jpe;.jpeg;.jpg;.jxl;.k25;.kdc;.mdc;.mef;.mjpeg;.mos;.mrw;.nef;.nrw;.obm;.orf;.pbm;.pcx;.pef;.pgm;.png;.ppm;.psb;.psd;.ptx;.pxn;.qoi;.r3d;.raf;.raw;.rw2;.rwl;.rwz;.sr2;.srf;.srw;.svg;.tga;.tif;.tiff;.viff;.webp;.wmf;.wpg;.x3f;.xbm;.xpm;.xv";
90+
public const string IMAGE_FORMATS = ".3fr;.apng;.ari;.arw;.avif;.b64;.bay;.bmp;.cap;.cr2;.cr3;.crw;.cur;.cut;.dcr;.dcs;.dds;.dib;.dng;.drf;.eip;.emf;.erf;.exif;.exr;.fff;.fits;.flif;.gif;.gifv;.gpr;.hdr;.heic;.heif;.ico;.iiq;.jfif;.jp2;.jpe;.jpeg;.jpg;.jxl;.k25;.kdc;.mdc;.mef;.mjpeg;.mos;.mrw;.nef;.nrw;.obm;.orf;.pbm;.pcx;.pef;.pgm;.png;.ppm;.psb;.psd;.ptx;.pxn;.qoi;.r3d;.raf;.raw;.rw2;.rwl;.rwz;.sr2;.srf;.srw;.svg;.tga;.tif;.tiff;.viff;.webp;.wmf;.wpg;.x3f;.xbm;.xpm;.xv";
9191

9292
/// <summary>
9393
/// Number format to use for save/restore ImageGlass settings

Source/Components/ImageGlass.Settings/WindowPlacement/WindowSettings.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ public static void SetPlacementToWindow(Form frm, WindowPlacement wp)
6464

6565
try
6666
{
67+
_ = SetWindowPlacement(frm.Handle, ref wp);
68+
69+
// Windows 10 hack: if taskbar is on top, the window position is not correct
70+
// https://github.com/d2phap/ImageGlass/issues/1790
6771
if (wp.showCmd == WindowState.Normal)
6872
{
69-
frm.SetBounds(wp.normalPosition.Left, wp.normalPosition.Top,
70-
wp.normalPosition.Right - wp.normalPosition.Left,
71-
wp.normalPosition.Bottom - wp.normalPosition.Top);
72-
}
73-
else
74-
{
75-
_ = SetWindowPlacement(frm.Handle, ref wp);
73+
frm.SetBounds(
74+
wp.normalPosition.Left,
75+
wp.normalPosition.Top,
76+
wp.normalPosition.Right - wp.normalPosition.Left,
77+
wp.normalPosition.Bottom - wp.normalPosition.Top);
7678
}
7779
}
7880
catch { }

Source/Components/ImageGlass.Views/DXCanvas.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,17 @@ protected override void Dispose(bool disposing)
11231123
DisposeWeb2Control();
11241124
}
11251125

1126+
protected override void OnVerticalBlankTickerWaitError(VerticalBlankTickerErrorEventArgs e)
1127+
{
1128+
base.OnVerticalBlankTickerWaitError(e);
1129+
1130+
if (!EnableDebug)
1131+
{
1132+
Thread.Sleep(1000);
1133+
e.Handled = true;
1134+
}
1135+
}
1136+
11261137
protected override void OnMouseClick(MouseEventArgs e)
11271138
{
11281139
// disable the default OnMouseClick
@@ -1556,10 +1567,20 @@ protected override void OnRender(IGraphics g)
15561567
// navigation layer
15571568
DrawNavigationLayer(g);
15581569

1559-
15601570
if (EnableDebug)
15611571
{
1562-
var text = $"FPS: {FPS}";
1572+
var monitor = DirectN.Monitor.FromWindow(TopLevelControl.Handle);
1573+
1574+
var text = $"Monitor={monitor.Bounds.Size.ToString()}; Dpi={DeviceDpi} ({(int)monitor.ScaleFactor}%); Renderer={Source.ToString()}";
1575+
if (UseWebview2)
1576+
{
1577+
text += $"; v{Web2.Webview2Version}";
1578+
}
1579+
else
1580+
{
1581+
text += $"; Opacity={_imageOpacity}; FPS={FPS}";
1582+
}
1583+
15631584
var textSize = g.MeasureText(text, Font.Name, Font.Size, textDpi: DeviceDpi);
15641585
g.DrawRectangle(0, 0, textSize.Width, textSize.Height, 0, Color.Red, Color.Black.WithAlpha(200));
15651586
g.DrawText(text, Font.Name, Font.Size, 0f, 0f, Color.Yellow, textDpi: DeviceDpi);

0 commit comments

Comments
 (0)