From 2d5991c4c67b9ead40df34cfdb73434231956116 Mon Sep 17 00:00:00 2001 From: graemeg Date: Sun, 27 May 2007 08:45:29 +0000 Subject: * Minor improvement in setting the window title under X11. * Thanks to Felipe for fixing the TFBitmap issue, the Base Style in the GUI can now use bitmaps under Linux as well. --- gfx/x11/gfx_x11.pas | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gfx') diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas index 868281b9..d10ed0fd 100644 --- a/gfx/x11/gfx_x11.pas +++ b/gfx/x11/gfx_x11.pas @@ -273,6 +273,8 @@ uses GELImage ,fpGFX ,fpUTF8Utils + ,Xatom + ,CTypes {,keysym ,libc , } ; resourcestring @@ -821,12 +823,12 @@ begin else raise EX11Error.CreateFmt(SWindowUnsupportedPixelFormat, [Attr.Depth]); end; - + if Attr.Depth >= 16 then begin - PixelFormat.RedMask := Visual^.red_mask; + PixelFormat.RedMask := Visual^.red_mask; PixelFormat.GreenMask := Visual^.green_mask; - PixelFormat.BlueMask := Visual^.blue_mask; + PixelFormat.BlueMask := Visual^.blue_mask; end; end; @@ -868,6 +870,7 @@ begin else FStride := AWidth * (FormatTypeBPPTable[APixelFormat.FormatType] shr 3); end; + GetMem(FData, FStride * Height); end; @@ -1689,8 +1692,18 @@ begin end; procedure TX11Window.SetTitle(const ATitle: String); +var + tp: TXTextProperty; begin + tp.value := PCUChar(ATitle); + tp.encoding := XA_WM_NAME; + tp.format := 8; + tp.nitems := UTF8Length(ATitle); + + XSetWMName(GFApplication.Handle, Handle, @tp); XStoreName(GFApplication.Handle, Handle, PChar(ATitle)); + XSetIconName(GFApplication.Handle, Handle, PChar(ATitle)); + XSetWMIconName(GFApplication.Handle, Handle, @tp); end; procedure TX11Window.DoSetCursor; -- cgit v1.2.3-70-g09d2