as in subject

Darek
Index: interfaces/gtk/gtkproc.inc
===================================================================
--- interfaces/gtk/gtkproc.inc  (wersja 9239)
+++ interfaces/gtk/gtkproc.inc  (kopia robocza)
@@ -8371,6 +8371,40 @@
 {$ENDIF UseXinerama}
 {$ENDIF Gtk1}
 
+function  XGetWorkarea(var ax,ay,awidth,aheight:gint): gint;
+
+var
+  XDisplay: PDisplay;
+  XScreen: PScreen;
+  XWindow: TWindow;
+  AtomType: x.TAtom;
+  Format: gint;
+  nitems: gulong;
+  bytes_after: gulong;
+  current_desktop: pguint;
+  res   : Integer;
+begin
+  Result := -1;
+  xdisplay := gdk_display;
+  xscreen := XDefaultScreenOfDisplay(xdisplay);
+  xwindow := XRootWindowOfScreen(xscreen);
+  res:=XGetWindowProperty (xdisplay, xwindow,
+             XInternAtom(xdisplay, '_NET_WORKAREA', false),
+             0, MaxInt, False, XA_CARDINAL, @atomtype, @format, @nitems,
+             @bytes_after, gpointer(@current_desktop));
+  if (atomtype = XA_CARDINAL) and (format = 32) and  (nitems > 0) then begin
+    result:=res;
+    ax:=current_desktop[0];
+    ay:=current_desktop[1];
+    awidth:=current_desktop[2];
+    aheight:=current_desktop[3];
+    XFree (current_desktop);
+  end;
+end;
+
+
+
+
 {$IFDEF ASSERT_IS_ON}
   {$UNDEF ASSERT_IS_ON}
   {$C-}
Index: interfaces/gtk/gtkwinapi.inc
===================================================================
--- interfaces/gtk/gtkwinapi.inc        (wersja 9239)
+++ interfaces/gtk/gtkwinapi.inc        (kopia robocza)
@@ -5586,6 +5582,7 @@
 function TGtkWidgetSet.GetSystemMetrics(nIndex: Integer): Integer;
 var
   P : Pointer;
+  ax,ay,ah,aw : gint;
 begin
   Assert(False, Format('Trace:> [TGtkWidgetSet.GetSystemMetrics] %d', 
[nIndex]));
   case nIndex of
@@ -5689,11 +5686,13 @@
       end;
     SM_CXMAXIMIZED:
       begin
-        Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetSystemMetrics] --> 
SM_CXMAXIMIZED      ');
+        if XGetWorkarea(ax,ay,aw,ah)>=0 then result:=aw
+                                        else getSystemMetrics(SM_CXSCREEN);
       end;
     SM_CYMAXIMIZED:
       begin
-        Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetSystemMetrics] --> 
SM_CYMAXIMIZED      ');
+         if XGetWorkarea(ax,ay,aw,ah)>=0 then result:=ah
+                                        else getSystemMetrics(SM_CYSCREEN);
       end;
     SM_CXMAXTRACK:
       begin
Index: interfaces/gtk/gtkproc.pp
===================================================================
--- interfaces/gtk/gtkproc.pp   (wersja 9239)
+++ interfaces/gtk/gtkproc.pp   (kopia robocza)
@@ -776,7 +776,9 @@
 function GetDefaultFontName: string;
 Procedure FillScreenFonts(ScreenFonts: TStrings);
 function GetTextHeight(DCTextMetric: TDevContextTextMetric): integer;
+function  XGetWorkarea(var ax,ay,awidth,aheight:gint): gint;
 
+
 // decoration
 Function GetWindowDecorations(AForm: TCustomForm): Longint;
 Function GetWindowFunction(AForm: TCustomForm): Longint;

Reply via email to