Panelgadget bug or feature?
Panelgadget bug or feature?
The PanelGadget is spamming static controls (creating + destroying) and thus is causing massive GPU usage and flickering on resize.
I guess those controls are intended to mimic a container, but something fishy is going on here . They are even created when you only hover over buttons inside a PanelGadget...
tested with 5.62b1 and 5.31 (x86)
I guess those controls are intended to mimic a container, but something fishy is going on here . They are even created when you only hover over buttons inside a PanelGadget...
tested with 5.62b1 and 5.31 (x86)
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
could you try on a panel of a non PureBasic app ?
Re: Panelgadget bug or feature?
Already did and no such thing. Seems to be PB specific. You are using static controls as container, maybe there is some faulty code in the area of creating those container?
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
here is an example:
windowdetective
also: it only seems to affect the button class
Code: Select all
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #WS_OVERLAPPEDWINDOW | #PB_Window_ScreenCentered )
PanelGadget(0, 8, 8, 306, 203)
AddGadgetItem(0, -1, "Panel 1")
ButtonGadget(1, 10, 15, 80, 24,"Button 1")
ButtonGadget(2, 95, 15, 80, 24,"Button 2")
CloseGadgetList()
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
also: it only seems to affect the button class
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
Using MS Spy++ with your example code, I do not see the same traffic?
PB v561x64 on Windows 10 Pro x64.
Is this only related to x86?
PB v561x64 on Windows 10 Pro x64.
Is this only related to x86?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Panelgadget bug or feature?
Nope, also on x64!skywalk wrote:Using MS Spy++ with your example code, I do not see the same traffic?
PB v561x64 on Windows 10 Pro x64.
Is this only related to x86?
Following (partly) code was generated when hovering over a button inside a PB panelgadget (Win7 x64, PB 5.62b1 x64)
Code: Select all
CreateWindowExW ( 0, "STATIC", NULL, WS_CHILD, 98, 38, 80, 24, 0x0000000000020694, NULL, 0x0000000140000000, NULL )
DefWindowProcW ( 0x000000000018063e, WM_NCCREATE, 0, 1238000 )
DefWindowProcW ( 0x000000000018063e, WM_NCCALCSIZE, 0, 1238096 )
GetParent ( 0x000000000018063e )
EnableThemeDialogTexture ( 0x0000000000020694, ETDT_ENABLE )
DefWindowProcW ( 0x000000000018063e, WM_MOVE, 0, 2490466 )
CallWindowProcW ( 0x0000000140002bf4, 0x0000000000020694, WM_PARENTNOTIFY, 1, 1574462 )
CallWindowProcW ( 0x000007fefb00ee08, 0x0000000000020694, WM_PARENTNOTIFY, 1, 1574462 )
DefWindowProcW ( 0x0000000000020694, WM_PARENTNOTIFY, 1, 1574462 )
DrawThemeParentBackground ( 0x000000000018063e, 0xffffffffa1011414, NULL )
CallWindowProcW ( 0x0000000140002bf4, 0x0000000000020694, WM_ERASEBKGND, 18446744072115786772, 0 )
CallWindowProcW ( 0x000007fefb00ee08, 0x0000000000020694, WM_ERASEBKGND, 18446744072115786772, 0 )
CallWindowProcW ( 0x0000000140002bf4, 0x0000000000020694, WM_PRINTCLIENT, 18446744072115786772, 4 )
CallWindowProcW ( 0x000007fefb00ee08, 0x0000000000020694, WM_PRINTCLIENT, 18446744072115786772, 4 )
GetClientRect ( 0x0000000000020694, 0x000000000012dcc0 )
DrawThemeParentBackground ( 0x0000000000020694, 0xffffffffa1011414, NULL )
GetPropW ( 0x000000000002069a, "PB_GadgetStack_5368709120" )
GlobalFindAtomW ( "PB_GadgetStack_5368709120" )
CallWindowProcW ( 0x0000000140004e40, 0x000000000002069a, WM_ERASEBKGND, 18446744072115786772, 0 )
GetPropW ( 0x000000000002069a, "PB_WindowID" )
GlobalFindAtomW ( "PB_WindowID" )
GetPropW ( 0x000000000002069a, "PB_MDI_Gadget" )
GlobalFindAtomW ( "PB_MDI_Gadget" )
DefWindowProcW ( 0x000000000002069a, WM_ERASEBKGND, 18446744072115786772, 0 )
GetPropW ( 0x000000000002069a, "PB_GadgetStack_5368709120" )
GlobalFindAtomW ( "PB_GadgetStack_5368709120" )
CallWindowProcW ( 0x0000000140004e40, 0x000000000002069a, WM_PRINTCLIENT, 18446744072115786772, 4 )
GetPropW ( 0x000000000002069a, "PB_WindowID" )
GlobalFindAtomW ( "PB_WindowID" )
GetPropW ( 0x000000000002069a, "PB_MDI_Gadget" )
GlobalFindAtomW ( "PB_MDI_Gadget" )
DefWindowProcW ( 0x000000000002069a, WM_PRINTCLIENT, 18446744072115786772, 4 )
DrawThemeBackground ( 0x0000000000020001, 0xffffffffa1011414, 9, 0, 0x000000000012db90, NULL )
GetFocus ( )
DestroyWindow ( 0x000000000018063e )
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
Hi chi,
Are you seeing those messages on MS SPY++ or just using Window Detective?
Is Window Detective x64 app or only 32-bit?
I'm still not seeing "CreateWindowExW ( 0, "STATIC"..." with SPY++?
EDIT: Oops, if I SPY++ threads, I now see WM_CREATE and WM_DESTROY traffic.
I previously selected just Windows messages.
Are you seeing those messages on MS SPY++ or just using Window Detective?
Is Window Detective x64 app or only 32-bit?
I'm still not seeing "CreateWindowExW ( 0, "STATIC"..." with SPY++?
EDIT: Oops, if I SPY++ threads, I now see WM_CREATE and WM_DESTROY traffic.
I previously selected just Windows messages.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Panelgadget bug or feature?
I only found this behavior because of the visual representation of opening/closing windows in Window Detective (x86 only)... Would've missed it in Spy++
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
The bug is also visually noticeable with a statusbar! (move to the bug section?)
Without the panel and buttons the statusbar stays above the gadget while resizing, with the panel there is clearly z-fighting going on and with the buttons enabled, we also get those create/destroy messages in WinDetectiv back.
So maybe the main suspect is the static control?
Without the panel and buttons the statusbar stays above the gadget while resizing, with the panel there is clearly z-fighting going on and with the buttons enabled, we also get those create/destroy messages in WinDetectiv back.
So maybe the main suspect is the static control?
Code: Select all
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #WS_OVERLAPPEDWINDOW | #PB_Window_ScreenCentered )
CreateStatusBar(0, WindowID(0))
PanelGadget(0, 8, 8, 306, 183)
;AddGadgetItem(0, -1, "Panel 1")
;ButtonGadget(1, 10, 15, 80, 24,"Button 1")
;ButtonGadget(2, 95, 15, 80, 24,"Button 2")
CloseGadgetList()
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
Maybe I'm wrong, but didn't Fred saying using unofficial flags like #WS_OVERLAPPEDWINDOW to override the #PB_Window flags are not considered bugs?
Re: Panelgadget bug or feature?
Nothing wrong with #WS_OVERLAPPEDWINDOW and the bug has to do with the container of the PanelGadgetDude wrote:Maybe I'm wrong, but didn't Fred saying using unofficial flags like #WS_OVERLAPPEDWINDOW to override the #PB_Window flags are not considered bugs?
Code: Select all
Debug #WS_OVERLAPPEDWINDOW
Debug #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
Okay, I see.
This seems to solve the problem, and keeps the StatusBar on top at all times:
This seems to solve the problem, and keeps the StatusBar on top at all times:
Code: Select all
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #WS_OVERLAPPEDWINDOW | #PB_Window_ScreenCentered )
sb=CreateStatusBar(0, WindowID(0))
PanelGadget(0, 8, 8, 306, 183)
AddGadgetItem(0, -1, "Panel 1")
ButtonGadget(1, 10, 15, 80, 24,"Button 1")
ButtonGadget(2, 95, 15, 80, 24,"Button 2")
CloseGadgetList()
BringWindowToTop_(sb)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: Panelgadget bug or feature?
Thanks, but my example with the statusbar was to show off the actual bug I explained in the first post... Nothing more
Et cetera is my worst enemy
Re: Panelgadget bug or feature?
Okay... I'll just exit this thread now.
Re: Panelgadget bug or feature?
@Fred: May I suggest using the class "#32770" (Dialog box) instead of #WC_STATIC! This seems to be the most common 'container' for such panels...
Et cetera is my worst enemy