From abbc447fc3ff849364098cd63e58b5a86cd5116d Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Mon, 19 Sep 2011 19:53:24 -0700 Subject: [PATCH] Fixed gtk-object-destroy-callback for s. --- src/gtk-screen/gtk-screen.pkg | 2 +- src/gtk-screen/gtk-screen.scm | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gtk-screen/gtk-screen.pkg b/src/gtk-screen/gtk-screen.pkg index fe9a01aaf..4e33dbc8a 100644 --- a/src/gtk-screen/gtk-screen.pkg +++ b/src/gtk-screen/gtk-screen.pkg @@ -179,7 +179,7 @@ USA. fix-ink-widgets set-fix-ink-widgets! fix-ink-remove! - set-text-ink-position! + text-ink? set-text-ink-position! simple-text-ink? make-simple-text-ink simple-text-ink-text set-simple-text-ink-text! diff --git a/src/gtk-screen/gtk-screen.scm b/src/gtk-screen/gtk-screen.scm index cba1bc9f5..dca6e44e6 100644 --- a/src/gtk-screen/gtk-screen.scm +++ b/src/gtk-screen/gtk-screen.scm @@ -131,11 +131,12 @@ USA. (parse-geometry geometry (lambda (width height x y) - ;; Set-screen-size! will not work here. + (declare (ignore x y)) + ;; For make-editor-frame: (set-screen-x-size! screen width) (set-screen-y-size! screen height) (let ((toplevel (gtk-screen-toplevel screen))) - ;; This allows the luser to resize to smaller than the logical size. + ;; This allows the user to resize to smaller sizes. (gtk-window-set-geometry-hints toplevel toplevel 'min-width 100 'min-height 100))))) @@ -988,15 +989,19 @@ USA. widget) (define-method gtk-object-destroy-callback ((widget )) + ;; NOTE that this callback can be called before a widget is realized(!). (call-next-method widget) (let ((cursor (text-widget-cursor-ink widget))) (if cursor - (begin + (let ((mark (cursor-ink-point cursor))) (fix-ink-remove! cursor) - (mark-temporary! (cursor-ink-point cursor))))) - (gobject-unref! - (text-ink-pango-layout - (car (fix-drawing-display-list (text-widget-override-drawing widget)))))) + (if mark (mark-temporary! mark))))) + (and-let* ((drawing (text-widget-override-drawing widget)) + (ink (car (fix-drawing-display-list drawing))) + ((text-ink? ink)) + (layout (text-ink-pango-layout ink))) + (gobject-unref! layout)) + unspecific) (define-method fix-layout-realize-callback ((widget )) (%trace ";(fix-layout-realize-callback ) "widget"\n") -- 2.25.1