diff --git a/src/controls.js b/src/controls.js index 308d5b12..f861da3b 100644 --- a/src/controls.js +++ b/src/controls.js @@ -28,6 +28,8 @@ class ClapperControls extends Gtk.Box this.currentPosition = 0; this.currentDuration = 0; this.isPositionDragging = false; + + this.isMobileMonitor = false; this.isMobile = false; this.showHours = false; diff --git a/src/widget.js b/src/widget.js index 2298b9ec..fc622d57 100644 --- a/src/widget.js +++ b/src/widget.js @@ -571,13 +571,20 @@ class ClapperWidget extends Gtk.Grid const geometry = monitor.geometry; const size = this.windowSize; - debug(`detected monitor resolution: ${geometry.width}x${geometry.height}`); + debug(`monitor application-pixels: ${geometry.width}x${geometry.height}`); if(geometry.width >= size[0] && geometry.height >= size[1]) { root.set_default_size(size[0], size[1]); debug(`restored window size: ${size[0]}x${size[1]}`); } + const monitorWidth = Math.max(geometry.width, geometry.height); + + if(monitorWidth < 1280) { + this.controls.isMobileMonitor = true; + debug('mobile monitor detected'); + } + surface.connect('notify::state', this._onStateNotify.bind(this)); } });