next try to fix the gtk1 crashing on focussing a window from Andrew Haines

git-svn-id: trunk@6996 -
This commit is contained in:
mattias 2005-03-20 09:35:47 +00:00
parent 5ec0ba3595
commit 4442c43d56
3 changed files with 16 additions and 9 deletions

View File

@ -323,10 +323,6 @@ end;
procedure TCustomBarChart.BeginUpdate; procedure TCustomBarChart.BeginUpdate;
begin begin
if FUpdateCount=0 then begin
Canvas.Brush.Color:=Color;
Canvas.FillRect(GetClientRect);
end;
Inc(FUpdateCount); Inc(FUpdateCount);
end; end;

View File

@ -1159,15 +1159,21 @@ procedure GDK_WINDOW_ACTIVATE(Window: PGdkWindowPrivate);
var var
XDisplay: PDisplay; XDisplay: PDisplay;
XScreen: PScreen; XScreen: PScreen;
XRootWindow, aXRootWindow,
XWindow: TWindow; XWindow: x.TWindow;
XEvent: TXClientMessageEvent; XEvent: xlib.TXClientMessageEvent;
_NET_ACTIVE_WINDOW: Integer; _NET_ACTIVE_WINDOW: Integer;
begin begin
if (Window=nil) or (gdk.destroyed(Window^)<>0) then exit;
XDisplay := GDK_WINDOW_XDISPLAY (Window); XDisplay := GDK_WINDOW_XDISPLAY (Window);
if XDisplay=nil then exit;
XScreen := XDefaultScreenOfDisplay(xdisplay); XScreen := XDefaultScreenOfDisplay(xdisplay);
XRootWindow := XRootWindowOfScreen(xscreen); if XScreen=nil then exit;
aXRootWindow := XRootWindowOfScreen(xscreen);
if aXRootWindow=0 then exit;
XWindow := GDK_WINDOW_XWINDOW (Window); XWindow := GDK_WINDOW_XWINDOW (Window);
if XWindow=0 then exit;
_NET_ACTIVE_WINDOW := XInternAtom(xdisplay, '_NET_ACTIVE_WINDOW', false); _NET_ACTIVE_WINDOW := XInternAtom(xdisplay, '_NET_ACTIVE_WINDOW', false);
@ -1179,7 +1185,7 @@ begin
XEvent.data.l[1] := CurrentTime; XEvent.data.l[1] := CurrentTime;
XEvent.data.l[1] := 0; // Applications current active window XEvent.data.l[1] := 0; // Applications current active window
XSendEvent(XDisplay, XRootWindow, False, SubstructureNotifyMask, @XEvent); XSendEvent(XDisplay, aXRootWindow, False, SubstructureNotifyMask, @XEvent);
end; end;
procedure GDK_WINDOW_MAXIMIZE(Window: PGdkWindowPrivate); procedure GDK_WINDOW_MAXIMIZE(Window: PGdkWindowPrivate);

View File

@ -224,7 +224,9 @@ begin
FormWidget:=PGtkWidget(AForm.Handle); FormWidget:=PGtkWidget(AForm.Handle);
FormWindow:=PGdkWindowPrivate(FormWidget^.window); FormWindow:=PGdkWindowPrivate(FormWidget^.window);
if FormWindow<>nil then begin if FormWindow<>nil then begin
{ $IFDEF EnableGtkWindowFocus}
GDK_WINDOW_ACTIVATE(FormWindow); GDK_WINDOW_ACTIVATE(FormWindow);
{ $ENDIF}
end; end;
{$ENDIF} {$ENDIF}
{$ifdef gtk2} {$ifdef gtk2}
@ -8985,6 +8987,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.415 2005/03/20 09:35:47 mattias
next try to fix the gtk1 crashing on focussing a window from Andrew Haines
Revision 1.414 2005/03/19 09:17:20 mattias Revision 1.414 2005/03/19 09:17:20 mattias
gtk1: minimizing windows, missing: window state events from Andrew Haines gtk1: minimizing windows, missing: window state events from Andrew Haines