Commit 88ef8ba 1 parent 1d1b97b commit 88ef8ba Copy full SHA for 88ef8ba
File tree 2 files changed +17
-10
lines changed
druid-shell/src/platform/windows
2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ This means that druid no longer requires cairo on macOS and uses Core Graphics i
102
102
- GTK: Support file filters in open/save dialogs. ([ #903 ] by [ @jneem ] )
103
103
- GTK: Support DPI values other than 96. ([ #904 ] by [ @xStrom ] )
104
104
- Windows: Removed flashes of white background at the edge of the window when resizing. ([ #915 ] by [ @xStrom ] )
105
+ - Windows: Reduced chance of white flash when opening a new window. ([ #916 ] by [ @xStrom ] )
105
106
- X11: Support key and mouse button state. ([ #920 ] by [ @jneem ] )
106
107
- Routing ` LifeCycle::FocusChanged ` to descendant widgets. ([ #925 ] by [ @yrns ] )
107
108
- Built-in open and save menu items now show the correct label and submit the right commands. ([ #930 ] by [ @finnerale ] )
@@ -201,6 +202,7 @@ This means that druid no longer requires cairo on macOS and uses Core Graphics i
201
202
[ #905 ] : https://github.com/xi-editor/druid/pull/905
202
203
[ #909 ] : https://github.com/xi-editor/druid/pull/909
203
204
[ #915 ] : https://github.com/xi-editor/druid/pull/915
205
+ [ #916 ] : https://github.com/xi-editor/druid/pull/916
204
206
[ #917 ] : https://github.com/xi-editor/druid/pull/917
205
207
[ #920 ] : https://github.com/xi-editor/druid/pull/920
206
208
[ #924 ] : https://github.com/xi-editor/druid/pull/924
Original file line number Diff line number Diff line change @@ -422,22 +422,27 @@ impl WndProc for MyWndProc {
422
422
//println!("wndproc msg: {}", msg);
423
423
match msg {
424
424
WM_CREATE => {
425
- let dcomp_state = unsafe {
426
- create_dcomp_state ( self . present_strategy , hwnd) . unwrap_or_else ( |e| {
427
- warn ! ( "Creating swapchain failed, falling back to hwnd: {:?}" , e) ;
428
- None
429
- } )
430
- } ;
431
-
432
- self . state . borrow_mut ( ) . as_mut ( ) . unwrap ( ) . dcomp_state = dcomp_state;
433
425
if let Some ( state) = self . handle . borrow ( ) . state . upgrade ( ) {
434
426
state. hwnd . set ( hwnd) ;
435
427
}
436
- let handle = self . handle . borrow ( ) . to_owned ( ) ;
437
428
if let Some ( state) = self . state . borrow_mut ( ) . as_mut ( ) {
429
+ let dcomp_state = unsafe {
430
+ create_dcomp_state ( self . present_strategy , hwnd) . unwrap_or_else ( |e| {
431
+ warn ! ( "Creating swapchain failed, falling back to hwnd: {:?}" , e) ;
432
+ None
433
+ } )
434
+ } ;
435
+ if dcomp_state. is_none ( ) {
436
+ unsafe {
437
+ let rt = paint:: create_render_target ( & self . d2d_factory , hwnd) ;
438
+ state. render_target = rt. ok ( ) ;
439
+ }
440
+ }
441
+ state. dcomp_state = dcomp_state;
442
+
443
+ let handle = self . handle . borrow ( ) . to_owned ( ) ;
438
444
state. handler . connect ( & handle. into ( ) ) ;
439
445
}
440
-
441
446
Some ( 0 )
442
447
}
443
448
WM_ERASEBKGND => Some ( 0 ) ,
You can’t perform that action at this time.
0 commit comments