[Gambas-user] Test Screen.Available values

BB adamnt42 at gmail.com
Tue May 16 13:57:44 CEST 2023


On 16/5/23 7:30 pm, Bruce Steers wrote:
> Hi all.
>
> I have a problem with a program that Benoit does not get the same bug 
> and wondered if some people could test this program.
>
> the program is a simple screenshot program.
> I made it because I now use a laptop with 2 screens attached and with 
> the built-in screenshot programs it grabs the entire area of both 
> screens and i then have to crop the picture.
>
> This application detects what screen the mouse is on via an addition 
> to Mouse.class (Mouse.Screen) and only grabs that screens area.
>
> It also has an option to "hide panels" , if this is selected then is 
> uses the Screen.Available co'ords not the normal co'ords.
> like so...
>
>   Dim s As Screen = Screens[Mouse.Screen]
>
>   If NoPanels Then
>     hPic = Desktop.Screenshot(s.AvailableX, s.AvailableY, 
> s.AvailableWidth, s.AvailableHeight)
>   Else
>     hPic = Desktop.Screenshot(s.x, s.y, s.w, s.h)
>   Endif
>
>
> The problem....
> On my system this works as expected with GTK3 , if NoPanels is 
> selected the screenshot only includes the internal usable screen and 
> not the outer desktop panels.
>
> (note: my config is the plug-in 1280x1024 monitor is default screen, 
> laptop built-in 1366x768 is secondary screen)
>
> Now with GTK2 and QT5 it does not work and parts of the panels get 
> included in the screenshot.
> On my machine but not Benoits :-\
>
> Also for me KDE failed with GTK3 as well but for Ben no problems.
>
> So i am trying to figure out why it fails for me but not for Ben.
> Could some people test this application on their systems and report if 
> it works as expected or not.
>
> To test...
> Load the project.
> select the debug toolkit to use (either gtk3 or qt5)
> hit run.
> Ensure the "Hide Panels" checkbox is checked.
> Hit Okay
>
> the following window shows the screenshot image.  It should not 
> include your desktop panels just the inner screen part.
>
> Like i say on my Mint21-MATE machine this works as expected only with 
> GTK3 toolkit.
>
> Thanks all :)
> BruceS
>
>
> Ah, the old screen/desktop/monitor/framebuffer impedence problem 
> again. The architecture is somewhat akin to an Inuit stepping outside 
> and trying to define what the horizon means. (There is some sense in 
> that if you think about it)

The problem lies in an obscure specification called X. Some people tried 
to resolve issues like this one with a thing called, IIRC. "wasteland" 
or something like that anyway, but that was even worse.

Unfortunately that impedance in the XOrg spec has to my knowledge not 
yet been satisfactorily been sat down in a pub on a cold afternoon and 
had its googlies reorganized. In short, if you do find a solution it may 
work at your house here there somewhere most times other times and 
frequently not just when you want it to. In other words, it would be 
really nice if one day the X-men all sat down and decided what they 
really truly meant when they wrote all that unintelligible garbage, or not.

But I regress (possibly I meant something else there?).

mint is my second most hated distro! So there. It is the worst example 
of how to do things the easy way even if that means screw any common 
programs that are just too "hard" to get working, and the WORST forum I 
have ever seen. "You just need to do it our way you cretin!"

shutter is what you need. AFAIR there is an API, I've just never needed 
to use it.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230516/e99cb746/attachment.htm>


More information about the User mailing list