mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 10:52:22 +02:00
LCL-GTK3: Make Screen.WorkArea work. Issue #36946, patch from Anton Kavalenka.
git-svn-id: trunk@63837 -
This commit is contained in:
parent
8b307ca09c
commit
3f80506401
@ -2891,6 +2891,10 @@ type
|
|||||||
function intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; inline; static;
|
function intern_static_string(atom_name: Pgchar): PGdkAtom; cdecl; inline; static;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TGdkDisplay }
|
||||||
|
|
||||||
|
PGdkMonitor = ^TGdkMonitor;
|
||||||
|
|
||||||
TGdkDisplay = object(TGObject)
|
TGdkDisplay = object(TGObject)
|
||||||
function get_default: PGdkDisplay; cdecl; inline; static;
|
function get_default: PGdkDisplay; cdecl; inline; static;
|
||||||
function open(display_name: Pgchar): PGdkDisplay; cdecl; inline; static;
|
function open(display_name: Pgchar): PGdkDisplay; cdecl; inline; static;
|
||||||
@ -2905,6 +2909,7 @@ type
|
|||||||
function get_default_screen: PGdkScreen; cdecl; inline;
|
function get_default_screen: PGdkScreen; cdecl; inline;
|
||||||
function get_device_manager: PGdkDeviceManager; cdecl; inline;
|
function get_device_manager: PGdkDeviceManager; cdecl; inline;
|
||||||
function get_event: PGdkEvent; cdecl; inline;
|
function get_event: PGdkEvent; cdecl; inline;
|
||||||
|
function get_primary_monitor: PGdkMonitor; cdecl;inline;
|
||||||
procedure get_maximal_cursor_size(width: Pguint; height: Pguint); cdecl; inline;
|
procedure get_maximal_cursor_size(width: Pguint; height: Pguint); cdecl; inline;
|
||||||
function get_n_screens: gint; cdecl; inline;
|
function get_n_screens: gint; cdecl; inline;
|
||||||
function get_name: Pgchar; cdecl; inline;
|
function get_name: Pgchar; cdecl; inline;
|
||||||
@ -3901,7 +3906,6 @@ type
|
|||||||
);
|
);
|
||||||
|
|
||||||
{ TGdkMonitor available since 3.22 }
|
{ TGdkMonitor available since 3.22 }
|
||||||
PGdkMonitor = ^TGdkMonitor;
|
|
||||||
TGdkMonitor = object(TGObject)
|
TGdkMonitor = object(TGObject)
|
||||||
public
|
public
|
||||||
function get_display ():PGdkDisplay;cdecl;inline;
|
function get_display ():PGdkDisplay;cdecl;inline;
|
||||||
@ -3974,6 +3978,7 @@ function gdk_display_get_event(display: PGdkDisplay): PGdkEvent; cdecl; external
|
|||||||
function gdk_display_get_n_screens(display: PGdkDisplay): gint; cdecl; external;
|
function gdk_display_get_n_screens(display: PGdkDisplay): gint; cdecl; external;
|
||||||
function gdk_display_get_name(display: PGdkDisplay): Pgchar; cdecl; external;
|
function gdk_display_get_name(display: PGdkDisplay): Pgchar; cdecl; external;
|
||||||
function gdk_display_get_screen(display: PGdkDisplay; screen_num: gint): PGdkScreen; cdecl; external;
|
function gdk_display_get_screen(display: PGdkDisplay; screen_num: gint): PGdkScreen; cdecl; external;
|
||||||
|
function gdk_display_get_primary_monitor(display: PGdkDisplay): PGdkMonitor; cdecl; external;
|
||||||
function gdk_display_get_type: TGType; cdecl; external;
|
function gdk_display_get_type: TGType; cdecl; external;
|
||||||
function gdk_display_has_pending(display: PGdkDisplay): gboolean; cdecl; external;
|
function gdk_display_has_pending(display: PGdkDisplay): gboolean; cdecl; external;
|
||||||
function gdk_display_is_closed(display: PGdkDisplay): gboolean; cdecl; external;
|
function gdk_display_is_closed(display: PGdkDisplay): gboolean; cdecl; external;
|
||||||
@ -4552,6 +4557,11 @@ begin
|
|||||||
Result := LazGdk3.gdk_display_get_event(@self);
|
Result := LazGdk3.gdk_display_get_event(@self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TGdkDisplay.get_primary_monitor: PGdkMonitor; cdecl;
|
||||||
|
begin
|
||||||
|
Result:=LazGdk3.gdk_display_get_primary_monitor(@Self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGdkDisplay.get_maximal_cursor_size(width: Pguint; height: Pguint); cdecl;
|
procedure TGdkDisplay.get_maximal_cursor_size(width: Pguint; height: Pguint); cdecl;
|
||||||
begin
|
begin
|
||||||
LazGdk3.gdk_display_get_maximal_cursor_size(@self, width, height);
|
LazGdk3.gdk_display_get_maximal_cursor_size(@self, width, height);
|
||||||
|
@ -3955,11 +3955,28 @@ end;
|
|||||||
|
|
||||||
function TGtk3WidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
|
function TGtk3WidgetSet.SystemParametersInfo(uiAction: DWord; uiParam: DWord;
|
||||||
pvParam: Pointer; fWinIni: DWord): LongBool;
|
pvParam: Pointer; fWinIni: DWord): LongBool;
|
||||||
|
var
|
||||||
|
wa:TGdkRectangle;
|
||||||
|
pdisp:PGdkDisplay;
|
||||||
|
pmon:PgdkMonitor;
|
||||||
|
pr:PRect;
|
||||||
begin
|
begin
|
||||||
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
|
Result:=True;
|
||||||
DebugLn('WARNING: TGtk3WidgetSet.SystemParametersInfo not implemented ...');
|
Case uiAction of
|
||||||
{$ENDIF}
|
SPI_GETWHEELSCROLLLINES: PDword(pvParam)^ := 3;
|
||||||
Result:=inherited SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
|
SPI_GETWORKAREA: begin
|
||||||
|
pdisp:=TGdkDisplay.get_default;
|
||||||
|
pmon:=pdisp^.get_primary_monitor();
|
||||||
|
pmon^.get_workarea(@wa);
|
||||||
|
pr:=PRect(pvParam);
|
||||||
|
pr^.Left:=wa.x;
|
||||||
|
pr^.Top:=wa.y;
|
||||||
|
pr^.Width:=wa.width;
|
||||||
|
pr^.Height:=wa.height;
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
Result:=False;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGtk3WidgetSet.TextOut(DC: HDC; X, Y: Integer; Str: PChar; Count: Integer): Boolean;
|
function TGtk3WidgetSet.TextOut(DC: HDC; X, Y: Integer; Str: PChar; Count: Integer): Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user