diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpgfx.pas | 20 | ||||
-rw-r--r-- | src/corelib/gfx_widget.pas | 2 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 8 |
3 files changed, 23 insertions, 7 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index 064b964a..6cc4aa69 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -1128,13 +1128,21 @@ begin Exit; //==> // we could not be sure about the buffer contents! - FCanvas.BeginDraw(False); try - // this works well on narrow characters like 'i' or 'l' in non-mono fonts - FCanvas.XORFillRectangle($FFFFFF, FLeft, FTop, FWidth, FHeight); - FVisible := not FVisible; - finally - FCanvas.EndDraw(FLeft, FTop, FWidth, FHeight); + FCanvas.BeginDraw(False); + try + // this works well on narrow characters like 'i' or 'l' in non-mono fonts + FCanvas.XORFillRectangle($FFFFFF, FLeft, FTop, FWidth, FHeight); + FVisible := not FVisible; + finally + FCanvas.EndDraw(FLeft, FTop, FWidth, FHeight); + end; + except + {$Note This occurs every now and again with TfpgMemo and CaretInvert painting! } + // Investigate this. + {$IFDEF DEBUG} + writeln('TfpgCaret.InvertCaret cause an exception'); + {$ENDIF} end; end; diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index 2032eb3d..644362f8 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -409,7 +409,7 @@ begin begin AllocateWindowHandle; DoSetWindowVisible(True); - + for n := 0 to ComponentCount - 1 do begin c := Components[n]; diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index 250ebf7f..aa3b36a9 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -1307,6 +1307,14 @@ var pmh: longword; GcValues: TXGcValues; begin + if Assigned(TfpgWindowImpl(awin)) then + begin + // This occurs every now and again with TfpgMemo and InvertCaret painting! + // Investigate this. + if not TfpgWindowImpl(awin).HasHandle then + raise Exception.Create(' Window doesn''t have a Handle'); + end; + XGetGeometry(xapplication.display, TfpgWindowImpl(awin).FWinHandle, @rw, @x, @y, @w, @h, @bw, @d); if FDrawing and buffered and (FBufferPixmap > 0) then |