mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 02:39:51 +02:00
GTK3: Fixed workarea handling on systems with frequent monitor removals.
Closes: #40333. Thanks To: Anton Kavalenka. Check number of connected monitors and fail if none. Fall back to first monitory id no primary monitor is defined.
This commit is contained in:
parent
8f8892313a
commit
1b1444f245
@ -3949,6 +3949,11 @@ begin
|
||||
SPI_GETWORKAREA: begin
|
||||
pdisp:=TGdkDisplay.get_default;
|
||||
pmon:=pdisp^.get_primary_monitor();
|
||||
if not Assigned(pmon) then begin
|
||||
if pdisp^.get_n_monitors = 0 then
|
||||
Exit(False);
|
||||
pmon := pdisp^.get_monitor(0);
|
||||
end;
|
||||
pmon^.get_workarea(@wa);
|
||||
pr:=PRect(pvParam);
|
||||
pr^.Left:=wa.x;
|
||||
|
Loading…
Reference in New Issue
Block a user