File tree 3 files changed +17
-0
lines changed
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ pub fn handle_app_output(
96
96
window_title,
97
97
decorated,
98
98
drag_window,
99
+ window_pos,
99
100
} = app_output;
100
101
101
102
if let Some ( decorated) = decorated {
@@ -116,6 +117,13 @@ pub fn handle_app_output(
116
117
window. set_title ( & window_title) ;
117
118
}
118
119
120
+ if let Some ( window_pos) = window_pos {
121
+ window. set_outer_position ( winit:: dpi:: PhysicalPosition {
122
+ x : window_pos. x as f64 ,
123
+ y : window_pos. y as f64 ,
124
+ } ) ;
125
+ }
126
+
119
127
if drag_window {
120
128
let _ = window. drag_window ( ) ;
121
129
}
Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ impl AppRunner {
268
268
window_title : _, // TODO: change title of window
269
269
decorated : _, // Can't toggle decorations
270
270
drag_window : _, // Can't be dragged
271
+ window_pos : _, // Can't set position of a web page
271
272
} = app_output;
272
273
}
273
274
Original file line number Diff line number Diff line change @@ -323,6 +323,11 @@ impl Frame {
323
323
self . output . decorated = Some ( decorated) ;
324
324
}
325
325
326
+ /// set the position of the outer window
327
+ pub fn set_window_pos ( & mut self , pos : egui:: Pos2 ) {
328
+ self . output . window_pos = Some ( pos) ;
329
+ }
330
+
326
331
/// When called, the native window will follow the
327
332
/// movement of the cursor while the primary mouse button is down.
328
333
///
@@ -503,5 +508,8 @@ pub mod backend {
503
508
504
509
/// Set to true to drag window while primary mouse button is down.
505
510
pub drag_window : bool ,
511
+
512
+ /// Set to some position to move the outer window (e.g. glium window) to this position
513
+ pub window_pos : Option < egui:: Pos2 > ,
506
514
}
507
515
}
You can’t perform that action at this time.
0 commit comments