@@ -16,6 +16,7 @@ const Params = imports.misc.params;
1616const Util = imports . misc . util ;
1717
1818const Dialog = imports . ui . dialog ;
19+ const Layout = imports . ui . layout ;
1920const Lightbox = imports . ui . lightbox ;
2021const Main = imports . ui . main ;
2122
@@ -82,8 +83,10 @@ var ModalDialog = GObject.registerClass({
8283
8384 Main . uiGroup . add_actor ( this ) ;
8485
85- let constraint = new Clutter . BindConstraint ( { source : global . stage ,
86- coordinate : Clutter . BindCoordinate . POSITION | Clutter . BindCoordinate . SIZE } ) ;
86+ let constraint = new Clutter . BindConstraint ( {
87+ source : global . stage ,
88+ coordinate : Clutter . BindCoordinate . POSITION | Clutter . BindCoordinate . SIZE
89+ } ) ;
8790 this . add_constraint ( constraint ) ;
8891
8992 this . backgroundStack = new St . Widget ( { layout_manager : new Clutter . BinLayout ( ) } ) ;
@@ -92,6 +95,8 @@ var ModalDialog = GObject.registerClass({
9295 x_fill : true ,
9396 y_fill : true
9497 } ) ;
98+ this . _monitorConstraint = new Layout . MonitorConstraint ( ) ;
99+ this . _backgroundBin . add_constraint ( this . _monitorConstraint ) ;
95100 this . add_actor ( this . _backgroundBin ) ;
96101
97102 this . dialogLayout = new Dialog . Dialog ( this . backgroundStack , params . styleClass ) ;
@@ -177,10 +182,7 @@ var ModalDialog = GObject.registerClass({
177182 }
178183
179184 _fadeOpen ( ) {
180- let monitor = Main . layoutManager . currentMonitor ;
181-
182- this . _backgroundBin . set_position ( monitor . x , monitor . y ) ;
183- this . _backgroundBin . set_size ( monitor . width , monitor . height ) ;
185+ this . _monitorConstraint . index = global . display . get_current_monitor ( ) ;
184186
185187 this . _setState ( State . OPENING ) ;
186188
0 commit comments