View Issue Details

IDProjectCategoryView StatusLast Update
0036946LazarusWidgetsetpublic2020-04-24 17:24
ReporterAnton Kavalenka Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.1 (SVN) 
Summary0036946: gtk3: Make Screen.WorkArea work
DescriptionPatch for TGtk3WidgetSet.SystemParametersInfo
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetGTK 3
Attached Files

Relationships

related to 0036963 closedZeljan Rikalo gtk3: GDK api for GDkMonitor 

Activities

Anton Kavalenka

2020-04-21 17:36

reporter  

gtk3winapi.diff (1,128 bytes)   
Index: lcl/interfaces/gtk3/gtk3winapi.inc
===================================================================
--- lcl/interfaces/gtk3/gtk3winapi.inc	(revision 63043)
+++ lcl/interfaces/gtk3/gtk3winapi.inc	(working copy)
@@ -4006,10 +4006,18 @@
 function TGtk3WidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
   pvParam: Pointer; fWinIni: DWord): LongBool;
 begin
-  {$IFDEF GTK3DEBUGNOTIMPLEMENTED}
-  DebugLn('WARNING: TGtk3WidgetSet.SystemParametersInfo not implemented ...');
-  {$ENDIF}
-  Result:=inherited SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
+  Result:=True;
+  Case uiAction of
+    SPI_GETWHEELSCROLLLINES: PDword(pvParam)^ := 3;
+    SPI_GETWORKAREA: begin
+      TRect(pvParam^):=Bounds(GetSystemMetrics(SM_XVIRTUALSCREEN),
+                              GetSystemMetrics(SM_YVIRTUALSCREEN),
+                              GetSystemMetrics(SM_CXVIRTUALSCREEN),
+                              GetSystemMetrics(SM_CYVIRTUALSCREEN));
+    end;
+  else
+    Result:=False;
+  end;
 end;
 
 function TGtk3WidgetSet.TextOut(DC: HDC; X, Y: Integer; Str: PChar; Count: Integer): Boolean;
gtk3winapi.diff (1,128 bytes)   

Zeljan Rikalo

2020-04-21 17:47

developer   ~0122323

@Anton, that patch is not good. Please look into gtk2 implementation, but I'll bet that Gtk3 have gtk_screen_workarea or similar

Anton Kavalenka

2020-04-21 18:16

reporter   ~0122324

gdk_monitor_get_workarea () is not in LazGdk3.pas, update needed

Zeljan Rikalo

2020-04-21 18:45

developer   ~0122325

hmmm.... gdk_monitor_get_workarea () is added in gtk3 3.22 but our bindings support 3.6 or 3.8 afair, maybe same approach as with gtk2 is needed

Zeljan Rikalo

2020-04-21 18:49

developer   ~0122326

maybe we should rethink gtk3 bindings and update it to 3.22 , according to https://en.wikipedia.org/wiki/GTK it is last stable version...well there's 3.24 but with minor adjustment for easy conversion between gtk3 and gtk4.

Issue History

Date Modified Username Field Change
2020-04-21 17:36 Anton Kavalenka New Issue
2020-04-21 17:36 Anton Kavalenka File Added: gtk3winapi.diff
2020-04-21 17:47 Zeljan Rikalo Assigned To => Zeljan Rikalo
2020-04-21 17:47 Zeljan Rikalo Status new => feedback
2020-04-21 17:47 Zeljan Rikalo LazTarget => -
2020-04-21 17:47 Zeljan Rikalo Note Added: 0122323
2020-04-21 18:16 Anton Kavalenka Note Added: 0122324
2020-04-21 18:16 Anton Kavalenka Status feedback => assigned
2020-04-21 18:45 Zeljan Rikalo Note Added: 0122325
2020-04-21 18:49 Zeljan Rikalo Note Added: 0122326
2020-04-24 17:24 Zeljan Rikalo Relationship added related to 0036963