From 70f3000113e52d40d9b4910fd504a8517abb40a9 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Wed, 13 Apr 2022 14:51:30 +0200 Subject: [PATCH] Background button: Keep default size if the monitor size is unavailable --- src/preferences/BackgroundButton.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/preferences/BackgroundButton.js b/src/preferences/BackgroundButton.js index cc4e8f5..033dfdf 100644 --- a/src/preferences/BackgroundButton.js +++ b/src/preferences/BackgroundButton.js @@ -47,6 +47,8 @@ var BackgroundButton = GObject.registerClass({ #setupSize() { const display = Gdk.Display.get_default(); const monitor = display.get_monitors().get_item(0); + if (monitor.width_mm === 0 || monitor.height_mm === 0) + return; if (monitor.width_mm > monitor.height_mm) this.thumb_height *= monitor.height_mm / monitor.width_mm; else