@@ -3,6 +3,7 @@ import { GObject, St, Clutter, Mtk, Meta, Gio } from '@gi.ext';
33import SnapAssistTile from './snapAssistTile' ;
44import SnapAssistLayout from './snapAssistLayout' ;
55import Layout from '../layout/Layout' ;
6+ import LayoutUtils from '../layout/LayoutUtils' ;
67import Tile from '../layout/Tile' ;
78import Settings from '@settings/settings' ;
89import GlobalState from '@utils/globalState' ;
@@ -19,9 +20,9 @@ import { logger } from '@utils/logger';
1920export const SNAP_ASSIST_SIGNAL = 'snap-assist' ;
2021
2122const GAPS = 4 ;
22- // 16:9 ratio and then rounded to int
23- const SNAP_ASSIST_LAYOUT_WIDTH = 120 ;
24- const SNAP_ASSIST_LAYOUT_HEIGHT = 68 ;
23+ // The size of the smallest size of the monitor
24+ // Will result into a size of 120x68 if the monitor is 16:9
25+ const SNAP_ASSIST_LAYOUT_SIZE = 68 ;
2526
2627const debug = logger ( 'SnapAssist' ) ;
2728
@@ -209,7 +210,7 @@ class SnapAssistContent extends St.BoxLayout {
209210 ? Math . max (
210211 0 ,
211212 this . _snapAssistantThreshold -
212- this . height / 2 +
213+ 46 * getMonitorScalingFactor ( this . _monitorIndex ) +
213214 this . _padding ,
214215 )
215216 : - this . height + this . _padding ;
@@ -237,12 +238,13 @@ class SnapAssistContent extends St.BoxLayout {
237238 this . _snapAssistLayouts . forEach ( ( lay ) => lay . destroy ( ) ) ;
238239 this . remove_all_children ( ) ;
239240
240- const [ , scalingFactor ] = getScalingFactorOf ( this ) ;
241-
242241 const layoutGaps = buildMarginOf ( GAPS ) ;
242+ const [ width , height ] = LayoutUtils . calc_size (
243+ this ,
244+ this . _monitorIndex ,
245+ SNAP_ASSIST_LAYOUT_SIZE ,
246+ ) ;
243247
244- const width = SNAP_ASSIST_LAYOUT_WIDTH * scalingFactor ;
245- const height = SNAP_ASSIST_LAYOUT_HEIGHT * scalingFactor ;
246248 // build the layouts inside the snap assistant. Place a spacer between each layout
247249 this . _snapAssistLayouts = layouts . map ( ( lay , ind ) => {
248250 const saLay = new SnapAssistLayout (
0 commit comments