PB 6.30 Beta 4 - ScreenGadget library - bug report

Post bugreports for the Windows version here
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

PeDe wrote: Tue Dec 09, 2025 12:41 pm PB v6.30b5 arm64, Raspberry Pi OS (Trixie, Wayland)

With a German keyboard, capital letters cannot be entered in StringScreenGadget and EditorScreenGadget. Umlauts such as ‘ÄÖÜäöü’ and special characters such as ‘$°^µ€’ cannot be entered.

Example used for input:
examples/3d/ScreenGadgetMultipleWindow.pb

Peter
I think that is because of the strange handling of the inkey() command of PB... It triggers on release, and not on press.
Can you try this? Hold down your altgr or the modifier key you need to type the character, press the button for the character, release it, release the modifier button. It is not a good behavior though, but I think the PB KeyboardInkey() command is the culprit.
PeDe
Enthusiast
Enthusiast
Posts: 330
Joined: Sun Nov 26, 2017 3:13 pm

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by PeDe »

PB v6.30b5 x64, Linux Mint 22.2, Intel J1900 CPU with integrated graphics

The mouse pointer can only be moved very slowly, almost only a few pixels at a time.
When I insert the procedure ‘SetFrameRate(60)’, the mouse pointer works normally, but the CPU (all 4 cores) is then constantly at 90%.

On the same PC running Windows 7 x64, the mouse pointer works normally, but the CPU (1 core) is always at 25%.

Example used:
examples/3d/ScreenGadgetMultipleWindow.pb
PeDe
Enthusiast
Enthusiast
Posts: 330
Joined: Sun Nov 26, 2017 3:13 pm

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by PeDe »

miso wrote: Tue Dec 09, 2025 1:23 pm Can you try this? Hold down your altgr or the modifier key you need to type the character, press the button for the character, release it, release the modifier button. It is not a good behavior though, but I think the PB KeyboardInkey() command is the culprit.
No, that doesn't work.
For example, I can enter the backslash with the ALT+GR key + ‘ß’, but not the € sign with the ALT+GR key + ‘E’.

Peter
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

PeDe wrote: Tue Dec 09, 2025 1:31 pm
miso wrote: Tue Dec 09, 2025 1:23 pm Can you try this? Hold down your altgr or the modifier key you need to type the character, press the button for the character, release it, release the modifier button. It is not a good behavior though, but I think the PB KeyboardInkey() command is the culprit.
No, that doesn't work.
For example, I can enter the backslash with the ALT+GR key + ‘ß’, but not the euro sign with the ALT+GR key + ‘E’.

Peter
Must be linux+used font specific then. On Windows, it works for me. Euro also (Hun Keyboard)
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

On Windows, in editorgadget the character "1" size seems to be wrong. It shifts the blinking cursor indicator to the right slightly with each entry.
Type 1111111111 to see.
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

miso wrote: Tue Dec 09, 2025 1:51 pm On Windows, in editorgadget the character "1" size seems to be wrong. It shifts the blinking cursor indicator to the right slightly with each entry.
Type 1111111111 to see.
This is an error in the Screengadget default font in windows. It does not happen with a different font.
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

After a couple of tests, I have to say this is truely an amazing work.

These are what I found problematic yet:
strange mousewheel + listview behavior:

Code: Select all

;-ERROR Description
;mousewheel triggers events, also weird behavior when mouseovered a listview gadget


InitSprite()
InitKeyboard():InitMouse()

Global lw.i,ps.i,p1.i,mw.i
Define c.i = 0
ExamineDesktops():dx=DesktopWidth(0)*0.9:dy=DesktopHeight(0)*0.9

OpenWindow(0, 0, 0, DesktopUnscaledX(dx),DesktopUnscaledY(dy), "[Escape] to quit", #PB_Window_BorderLess | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, dx, dy, 0, 0, 0)

; Create the Screen UI
InitScreenGadgets()

mw=OpenScreenWindow(#PB_Any, 200, 10, 300, 650, "Mywindow")
ps=PanelScreenGadget(#PB_Any,10,30,280,610)
p1=AddScreenGadgetItem(ps,-1,"panel-1")
lw=ListViewScreenGadget(#PB_Any,5,10,268,563)

ExamineHIDs()
While NextHID()
  c+1
  OpenHID(c,Val(HIDInfo(#PB_HID_VendorId)),Val(HIDInfo(#PB_HID_ProductId)))
  AddScreenGadgetItem(lw,-1,HIDInfo(#PB_HID_Product,c))
Wend


Repeat
  While WindowEvent() : Wend
  
  ClearScreen(RGB(0,0,0))
  ExamineMouse()
  ExamineKeyboard()
  
  If ScreenWindowEvent() = #PB_Event_Gadget
    eg = EventScreenGadget()
    Select eg
      Case lw
        Debug GetScreenGadgetText(lw)
          SetScreenGadgetText(MW,GetScreenGadgetText(lw))
    EndSelect
  EndIf
  
  RenderScreenGadgets()
  FlipBuffers()
  Delay(0)
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(3)
A minor problem here: renaming things changes string value of some gadgets, but does not rebuild the GUi graphics (yet)

And a major, probably library builder problem ( or I did not see something )
Seemingly one of my variable (mb) loses its scope for a while in this loop...

Code: Select all

;-ERROR Description
;Variable scope error
;setscreengadgettext not working with windows,panels

InitSprite()
InitKeyboard():InitMouse()

Global lw.i,ps.i,p1.i,mw.i
Global mb.i
ExamineDesktops():dx=DesktopWidth(0)*0.9:dy=DesktopHeight(0)*0.9

OpenWindow(0, 0, 0, DesktopUnscaledX(dx),DesktopUnscaledY(dy), "[Escape] to quit", #PB_Window_BorderLess | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, dx, dy, 0, 0, 0)

; Create the Screen UI
InitScreenGadgets()

mw=OpenScreenWindow(#PB_Any, 200, 10, 300, 650, "Mywindow")
ps=PanelScreenGadget(#PB_Any,10,30,280,610)
p1=AddScreenGadgetItem(ps,-1,"panel-1")
lw=ListViewScreenGadget(#PB_Any,5,10,268,563)


ExamineHIDs()
While NextHID()
  c+1
  OpenHID(c,Val(HIDInfo(#PB_HID_VendorId)),Val(HIDInfo(#PB_HID_ProductId)))
  AddScreenGadgetItem(lw,-1,HIDInfo(#PB_HID_Product,c))
Wend


Repeat
  While WindowEvent() : Wend
  
  ClearScreen(RGB(0,0,0))
  ExamineMouse()
  
  ExamineKeyboard()
  
  ;-THIS TRIGGERS if leftmouse
  If mb = 1 : Debug "Before":EndIf
  If ScreenWindowEvent() = #PB_Event_Gadget
    
      eg = EventScreenGadget()
       Select eg
        Case lw
          Debug GetScreenGadgetText(lw)
          ;-THIS TRIGGERS NOT if leftmouse (seems to be an error of scopes)
          If mb = 1 : Debug "Inbetween" : EndIf
          
          ;-I can set the text of the  window, but GUI graphics does not changes
          SetScreenGadgetText(MW,GetScreenGadgetText(lw))
          Debug GetScreenGadgetText(mw)
        Default
          SetScreenGadgetText(MW," ")
      EndSelect
    
  EndIf
  
  RenderScreenGadgets()
  
  mb = 0
  If MouseButton(1) : mb = 1 : EndIf
  
  ;-THIS TRIGGERS if leftmouse
  If mb = 1 : Debug "After": EndIf
  FlipBuffers()
  
  Delay(0)
Until KeyboardReleased(#PB_Key_Escape) Or MouseButton(3)
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 434
Joined: Thu Jul 09, 2015 9:07 am

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by pf shadoko »

FYI
ScreenGadget uses basic PB functions:
- Vectordrawing only at initialization, to draw the interface
- 2DDrawing for updating gadgets' graphics
- Sprite, mouse, and keyboard on every frame

@PeDe
I think it's a Linux-specific bug.
Try this example:

Code: Select all

InitSprite():InitMouse():InitKeyboard()
OpenWindow(0,0,0,800,600,"",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600)
CreateSprite(0,128,128)
StartDrawing(SpriteOutput(0))
Circle(64,64,64,$ff)
StopDrawing()

Repeat
  While WindowEvent():Wend
  ExamineMouse()
  ExamineKeyboard()
  ClearScreen(0)
  DisplaySprite(0,MouseX()-64,MouseY()-64)
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or MouseButton(3)
If it doesn't work correctly, submit a bug report.

@miso
- 1: Yes, I know, it's not a priority; it will be fixed for 6.31.
- 2: The click event is triggered when the button is released, so there's no "Inbetween" event.
Note:
debug GetScreenGadgetText(mw)
mw is a window, so GetScreenGadgetText isn't suitable.
(I haven't tried Get/SetScreenWindowTitle yet.)
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

- 2: The click event is triggered when the button is released, so there's no "Inbetween" event.
I see now. I wanted to avoid the wheel and rightclick event with checking the leftmouse, so thats why. Thanks for clarification.
User avatar
jacdelad
Addict
Addict
Posts: 2046
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by jacdelad »

pf shadoko wrote: Wed Dec 10, 2025 10:41 am FYI
ScreenGadget uses basic PB functions:
- Vectordrawing only at initialization, to draw the interface
- 2DDrawing for updating gadgets' graphics
- Sprite, mouse, and keyboard on every frame
If it's using vector drawing and 2d-drawing, could this possibly collide when program does that too, especially when it's threaded? I mean, you cannot paint on multiple surfaces at a time (which is logical).
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 434
Joined: Thu Jul 09, 2015 9:07 am

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by pf shadoko »

Even if the program is multithreaded, screengadget is not, and will always run on the main thread.
PeDe
Enthusiast
Enthusiast
Posts: 330
Joined: Sun Nov 26, 2017 3:13 pm

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by PeDe »

pf shadoko wrote: Wed Dec 10, 2025 10:41 am @PeDe
I think it's a Linux-specific bug.
Try this example:
The example doesn't work either. The mouse pointer only moves a few pixels at a time. The CPU is constantly at 50% capacity.
It's probably just bad luck with a PC that's over 10 years old.

System:
Linux Mint 22.2, Cinnamon 6.4.8, X11
Kernel: 6.8.0-88-generic
CPU: Intel Celeron© CPU J1900 @ 1.99GHz × 4
Graphics: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Graphics & Display

-----

I have the incorrect keyboard input in the String and EditorScreenGadget, no capital letters, etc. on several Linux systems.
Raspberry Pi OS, Linux Mint 22.2 and Ubuntu 24.04

------

On a 32-bit system, Linux Mint Debian 12 (LMDE6), there is a compiler error (Purifier enabled):
ASM:
ScreenGadgetMultipleWindow.pb (Line: 42)
Procedure stack has been corrupted.
C:
ScreenGadgetMultipleWindow.pb (Line: 163)
Invalid memory access.

Edit:
On other systems running Windows 7 and Raspberry Pi OS, I can compile the ‘ScreenGadgetMultipleWindow.pb’ example with PureBasic v6.30b5 32-bit.
On the system with the compiler error, I can run the 3D demo ‘Character.pb’, for example, but the notebook is probably too old.

Peter
Last edited by PeDe on Thu Dec 11, 2025 9:10 am, edited 2 times in total.
miso
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by miso »

PeDe wrote: Wed Dec 10, 2025 5:30 pm The CPU is constantly at 50% capacity.
Maybe this one can be solved with a delay(0) or delay(1) after the flipbuffers. If vsync ON, then the delay is not needed.
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 434
Joined: Thu Jul 09, 2015 9:07 am

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by pf shadoko »

@PeDe
- Regarding the mouse, I have the impression that FlipBuffers() does not wait for screen synchronization.
Can you measure the frame rate?
- Regarding compilation issues, I don't see any. The only “Linux” specificity concerns font size.
It may be a problem with lib creation.
PeDe
Enthusiast
Enthusiast
Posts: 330
Joined: Sun Nov 26, 2017 3:13 pm

Re: PB 6.30 Beta 4 - ScreenGadget library - bug report

Post by PeDe »

pf shadoko wrote: Thu Dec 11, 2025 6:14 pm @PeDe
- Regarding the mouse, I have the impression that FlipBuffers() does not wait for screen synchronization.
Can you measure the frame rate?
The system or graphics can only display 60 frames per second. If more frames were possible but are limited to 60, the mouse pointer does not work or works very slowly.
The flags ‘#PB_Screen_No/Smart/WaitSynchronization’ do not change anything.
If I limit the frames with ‘SetFrameRate()’ to, for example, 60, I get 59 frames per second and the mouse pointer works. The CPU is then at 50%.
Frames greater than 62 do not work because the frames are limited to 60 again.

Peter
Post Reply