For Linuxmint alt to sys "GetSystemMetrics", 0 to ScrW% & 1 to ScrH%

Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
Ihsgut
Posts: 2
Joined: Thu 17 Apr 2025, 10:24

For Linuxmint alt to sys "GetSystemMetrics", 0 to ScrW% & 1 to ScrH%

Post by Ihsgut »

I am tryng to write a program which is compatible for Windows & LinuxMint
the Windows system works fine with the following
sys "GetSystemMetrics", 0 to ScrW%
sys "GetSystemMetrics", 1 to ScrH%
but LinuxMint does not recognise the function
is there an alternative that I can use with LinuxMint

ihsgut@gmail.com
Richard Russell
Posts: 325
Joined: Tue 18 Jun 2024, 09:32

Re: For Linuxmint alt to sys "GetSystemMetrics", 0 to ScrW% & 1 to ScrH%

Post by Richard Russell »

Ihsgut wrote: Thu 17 Apr 2025, 10:35 is there an alternative that I can use with LinuxMint
This should work (it's documented here):

Code: Select all

      DIM rc{x%, y%, w%, h%}
      SYS "SDL_GetDisplayUsableBounds", 0, rc{}, @memhdc%
      ScrW% = rc.w%
      ScrH% = rc.h%
It returns the 'usable' display size, i.e. excluding the taskbar. If you would rather know the 'full' display size, including the taskbar, then use:

Code: Select all

      DIM rc{x%, y%, w%, h%}
      SYS "SDL_GetDisplayBounds", 0, rc{}, @memhdc%
      ScrW% = rc.w%
      ScrH% = rc.h%
Note that the values returned take into account High DPI Scaling, they do not correspond to the physical display size in pixels.
Ihsgut
Posts: 2
Joined: Thu 17 Apr 2025, 10:24

Re: For Linuxmint alt to sys "GetSystemMetrics", 0 to ScrW% & 1 to ScrH%

Post by Ihsgut »

I must say Thankyou for your prompt response to my issue which is now solved
Thanx , Thanx & Thanx again!!!!

ihsgut@gmail.com