# HG changeset patch # User Jordan Miner # Date 1250072190 18000 # Node ID 7adc733aca2d34f262c9a78315a435038c0d54ef # Parent 68be24186634a6e8ce455dfa4f654aca468ff4a8 Change Window.quickCreateGraphics() to create the handle if not already created. diff -r 68be24186634 -r 7adc733aca2d dynamin/gui/window.d --- a/dynamin/gui/window.d Wed Aug 12 05:14:04 2009 -0500 +++ b/dynamin/gui/window.d Wed Aug 12 05:16:30 2009 -0500 @@ -363,9 +363,8 @@ backend_recreateHandle(); } + // should create the handle if it hasn't been yet override protected Graphics quickCreateGraphics() { - if(!handleCreated) - return null; return backend_quickCreateGraphics(); } override bool onScreen() { @@ -586,8 +585,6 @@ unittest { auto w = new Window; assert(!w.handleCreated); - w.content = new Panel; - assert(!w.handleCreated); w.location = Point(5, 5); assert(!w.handleCreated); w.size = Size(100, 100); diff -r 68be24186634 -r 7adc733aca2d dynamin/gui/x_window.d --- a/dynamin/gui/x_window.d Wed Aug 12 05:14:04 2009 -0500 +++ b/dynamin/gui/x_window.d Wed Aug 12 05:16:30 2009 -0500 @@ -661,7 +661,7 @@ //backend_nativeToBorderSize(); } Graphics backend_quickCreateGraphics() { - auto surface = cairo_xlib_surface_create(display, _handle, + auto surface = cairo_xlib_surface_create(display, handle, XDefaultVisual(display, XDefaultScreen(display)), cast(int)width, cast(int)height); auto cr = cairo_create(surface);