diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc
index 91f3777f37..8b616b7881 100644
--- a/lcl/interfaces/gtk/gtkobject.inc
+++ b/lcl/interfaces/gtk/gtkobject.inc
@@ -854,6 +854,15 @@ procedure TGtkObject.SendCachedGtkMessages;
GtkLeft:=MainWidget^.Allocation.X;
GtkTop:=MainWidget^.Allocation.Y;
+
+ {$Ifdef GTK2}
+ if GTK_WIDGET_NO_WINDOW(MainWidget) and GTK_WIDGET_NO_WINDOW(MainWidget^.Parent)
+ // and (not GtkWidgetIsA(MainWidget,GTKAPIWidget_GetType))
+ then begin
+ Dec(GtkLeft, MainWidget^.parent^.Allocation.X);
+ Dec(GtkTop, MainWidget^.parent^.Allocation.Y);
+ end;
+ {$EndIf}
GtkWidth:=MainWidget^.Allocation.Width;
if GtkWidth<0 then GtkWidth:=0;
GtkHeight:=MainWidget^.Allocation.Height;
@@ -8445,6 +8454,10 @@ end;
{ =============================================================================
$Log$
+ Revision 1.432 2003/10/06 16:13:52 ajgenius
+ partly fixed gtk2 mouse offsets;
+ added new includes to gtk2 lpk
+
Revision 1.431 2003/10/06 10:50:10 mattias
added recursion to InvalidateClientRectCache
diff --git a/lcl/interfaces/gtk/gtkproc.inc b/lcl/interfaces/gtk/gtkproc.inc
index 5d2347d443..e79a1561c4 100644
--- a/lcl/interfaces/gtk/gtkproc.inc
+++ b/lcl/interfaces/gtk/gtkproc.inc
@@ -2153,6 +2153,13 @@ begin
if ClientWindow<>nil then begin
BeginGDKErrorTrap;
gdk_window_get_origin(ClientWindow,@Result.X,@Result.Y);
+ {$Ifdef GTK2}
+ if GTK_WIDGET_NO_WINDOW(ClientWidget)
+ then begin
+ Inc(Result.X, ClientWidget^.Allocation.X);
+ Inc(Result.Y, ClientWidget^.Allocation.Y);
+ end;
+ {$EndIf}
EndGDKErrorTrap;
exit;
end;
@@ -4899,6 +4906,10 @@ end;
{ =============================================================================
$Log$
+ Revision 1.215 2003/10/06 16:13:52 ajgenius
+ partly fixed gtk2 mouse offsets;
+ added new includes to gtk2 lpk
+
Revision 1.214 2003/10/03 01:25:01 ajgenius
add more gtk1i<->gtk2 key & event wrappers,
move more GTK2 workarounds from gtk to gtk2 interface,
diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc
index a32bb0d0c1..4eaad20a40 100644
--- a/lcl/interfaces/gtk/gtkwinapi.inc
+++ b/lcl/interfaces/gtk/gtkwinapi.inc
@@ -3609,10 +3609,24 @@ begin
inc(MainOrigin.X,Widget^.Allocation.X);
inc(MainOrigin.Y,Widget^.Allocation.Y);
end;
- if ClientWindow<>nil then
- gdk_window_get_origin(ClientWindow,@ClientOrigin.X,@ClientOrigin.Y)
- else begin
+ if ClientWindow<>nil then begin
+ {$Ifdef GTK2}
+ if GTK_WIDGET_NO_WINDOW(ClientWidget)
+ then begin
+ ClientOrigin.X := ClientWidget^.Allocation.X;
+ ClientOrigin.Y := ClientWidget^.Allocation.Y;
+ end else
+ {$EndIf}
+ gdk_window_get_origin(ClientWindow,@ClientOrigin.X,@ClientOrigin.Y);
+ end else begin
// client widget not realized
+ {$Ifdef GTK2}
+ if GTK_WIDGET_NO_WINDOW(ClientWidget)
+ then begin
+ ClientOrigin.X := ClientWidget^.Allocation.X;
+ ClientOrigin.Y := ClientWidget^.Allocation.Y;
+ end else
+ {$EndIf}
ClientOrigin:=MainOrigin;
end;
ARect.Left:=ClientOrigin.X-MainOrigin.X;
@@ -8951,6 +8965,10 @@ end;
{ =============================================================================
$Log$
+ Revision 1.290 2003/10/06 16:13:52 ajgenius
+ partly fixed gtk2 mouse offsets;
+ added new includes to gtk2 lpk
+
Revision 1.289 2003/10/02 18:18:32 ajgenius
buffer cs_opaque ExtTextOut blocks to help prevent extensive flickering
diff --git a/lcl/interfaces/gtk2/gtk2interface.lpk b/lcl/interfaces/gtk2/gtk2interface.lpk
index b5d1039d2a..fb49ac2e75 100644
--- a/lcl/interfaces/gtk2/gtk2interface.lpk
+++ b/lcl/interfaces/gtk2/gtk2interface.lpk
@@ -13,7 +13,7 @@
-
+
@@ -94,6 +94,14 @@
+
+
+
+
+
+
+
+