From a4a1469e9d5c0d76423f429c5b1db79c23ffbcfb Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 16 Jul 2009 02:00:13 +0000 Subject: [PATCH] gtk: don't raise an exception if we are creating DC and can't get drawable (fixes issue #14035) git-svn-id: trunk@20869 - --- lcl/interfaces/gtk/gtkdevicecontext.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/gtk/gtkdevicecontext.inc b/lcl/interfaces/gtk/gtkdevicecontext.inc index 81ff1577fe..0465cca486 100644 --- a/lcl/interfaces/gtk/gtkdevicecontext.inc +++ b/lcl/interfaces/gtk/gtkdevicecontext.inc @@ -277,7 +277,9 @@ begin //force creation gtk_widget_realize(ClientWidget); AWindow := GetControlWindow(ClientWidget); - if AWindow = nil then RaiseUnableToRealize; + // Don't raise an exception. Not all operations needs drawable. For example font metrics: + // http://bugs.freepascal.org/view.php?id=14035 + //if AWindow = nil then RaiseUnableToRealize; end; end else begin