Recent

Author Topic: Main menu flickers badly in IDE and apps generated by it.  (Read 1625 times)

jamie

  • Hero Member
  • *****
  • Posts: 5069
Main menu flickers badly in IDE and apps generated by it.
« on: December 09, 2022, 03:45:22 am »
Apps with a Main Menu and a few items will flicker badly in some cases while moving the form around.

 Seen with the IDE and many apps generated by it.

 Is there some sort of redundant refresh being done?

The only true wisdom is knowing you know nothing

dbannon

  • Hero Member
  • *****
  • Posts: 2289
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #1 on: December 09, 2022, 04:56:06 am »
What is flickering ?  The Main menu "button" (for lack of a better word) or the menu contents ?

I cannot move the application while menu contents is displayed so must be first choice ?

OS, widget set ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

jamie

  • Hero Member
  • *****
  • Posts: 5069
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #2 on: December 09, 2022, 03:43:57 pm »
U don't need to drop a menu. Just simply move a form around that has a list of headings

This is windows .

Moving it back to left is very noticeable and moving it to right is just random in flicker .

This problem has been there on all versions of laz since started using it back before 1.64
The only true wisdom is knowing you know nothing

dbannon

  • Hero Member
  • *****
  • Posts: 2289
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #3 on: December 09, 2022, 11:57:08 pm »
I only have two apps supported on Windows and neither has a conventional main menu so I cannot comment.

Strange that no one else has commented ....

Might be useful to move this thread to under a Windows heading ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

wp

  • Hero Member
  • *****
  • Posts: 10480
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #4 on: December 10, 2022, 12:16:33 am »
Cannot confirm any flicker on Win 11 when I drag the IDE's main form with the menu left and right with IDE (Laz/main, Laz 1.4.4).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8620
  • Debugger - SynEdit - and more
    • wiki
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #5 on: December 10, 2022, 01:10:22 am »
Well I do vaguely recall that a similar report had been around ages ago. Not sure what the outcome was, i.e. if it ever was even reproduced.

I take it, it must be pretty noticeable the way you describe it?
And then given that the IDE itself has a main menu, anyone (on Win) who ever moved the IDE-main-bar should have noticed it?
So I would guess there must be more to what causes it.

Sofar, I know "Windows" as you mention that.

Which version of Windows, bitness?
Potentially some interaction between LCL and Graphics card or driver - or even monitor?

You have carefully tried with various other apps, and none had the issue (sorry for asking, but I don't always take the obvious for granted)?

Define "move"
- So does the speed of moving has an impact?
- You said left / right / what about up down?
- What about moving with the keyboard? Alt-space to open the "app-icon menu", select move, and use cursor keys.

Define "flicker"
- I guess some form of quick switching between 2 or more visual states.
- Does it affect text (only menu, or also labels, toolbars, buttons...?)
  Does it affect icons?
  Does it affect frame/edges
- Do they disappear and then are redrawn
- Do they change color, thickness(boldness), or relative location?




So I did a test myself. And the below applies to the "ide main bar" and in the exact same way to "notepad" (the one that comes with Windows) and Firefox. It also happens to some text content, but not all text in the windows (depending in what kind of control the text was / or maybe font used....) Only app I could not notice it was the windows file explorer.
=> so this observation is not an LCL issue, but something in Windows or my setup.

If I move very slowly the text in the window title-bar and in (to lesser extend) the menu-titles seem to briefly flash bold and return to normal.
Though only noticeable, if I look really hard for it.

Well to be exact, that happens on 2 out of 4 of my screens. It does not happen on the other ones. (at least one screen that it happens and that it doesn't share the same gfx card).

Noteworthy, both of the monitors on which it happens are old (like a decade old).... No idea if that is significant.


Just before posting, if the IDE main bar is split across 2 screens that have different ppi scaling, and also at the same time (due to different height of the screens) vertically partly cut off on one of the screens, then I could observe a real bad flicker in the part of the IDE bar on the other screen.

And this I have not reproduced with other apps (yet).

jamie

  • Hero Member
  • *****
  • Posts: 5069
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #6 on: December 10, 2022, 01:49:05 am »
Its windows 10 Proc,32/64-bit Home etc.  does not matter on the bit-ness.
This has been going on since I can remember.

The Menu items on the bar are getting redrawn. I can see where the area is getting erased and menu items text redrawn.

 I find it hard to believe that nobody in the community has never noticed this.

  In one app a secondary form with a menu and a page control will flicker the menu while changing tabs. And also, when you first focus it, you will see a flashy redraw.

 It's very noticeable when dragging the form around left to right.

 Delphi tools has never done this, nor has other DEV tools for GUI building does this that I use.
The only true wisdom is knowing you know nothing

lainz

  • Hero Member
  • *****
  • Posts: 4077
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #7 on: December 10, 2022, 02:02:50 am »
Do you have Double Buffered set to true for the form?
lainz.github.io

jamie

  • Hero Member
  • *****
  • Posts: 5069
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #8 on: December 10, 2022, 02:08:06 am »
unbelievable.
The only true wisdom is knowing you know nothing

440bx

  • Hero Member
  • *****
  • Posts: 3268
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #9 on: December 10, 2022, 02:23:01 am »
Apps with a Main Menu and a few items will flicker badly in some cases while moving the form around.

 Seen with the IDE and many apps generated by it.

 Is there some sort of redundant refresh being done?
can you post a very short (as simple as possible) project that exhibits the problem ?  along with whatever steps must be followed to make the menu flicker ?  it would be very nice if you could identify in which cases the menu flickers and, at least some, in which it doesn't flicker.




FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 SP1 64bit.

jamie

  • Hero Member
  • *****
  • Posts: 5069
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #10 on: December 10, 2022, 02:47:48 am »
Really? The IDE itself isn't evidence enough?

 I am sure someone will come around when they figure out what it is I am talking about.

 Don't worry about, I'll look at the source code myself. I just thought by now that someone would have made a comment about it. I believe others have but they ended here like I am now.

The only true wisdom is knowing you know nothing

440bx

  • Hero Member
  • *****
  • Posts: 3268
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #11 on: December 10, 2022, 02:58:39 am »
Really? The IDE itself isn't evidence enough?
This has nothing to do with "evidence", this is not an episode of Perry Mason, Sherlock Holmes or Hercule Poirot.  Really!!

A very simple project that exhibits the problem you've mentioned can be used to determine the cause of the problem and fix it, which I presume is something you should be interested in and, it is significantly simpler to pinpoint the problem in a small project than in a rather large one such as the Lazarus IDE.

Post the shortest, simplest project possible that exhibits the problem and I am fairly sure I won't be the only one that will try to determine what causes it. You might even get the problem solved.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 SP1 64bit.

GetMem

  • Hero Member
  • *****
  • Posts: 3953
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #12 on: December 10, 2022, 08:26:19 am »
The IDE does flicker if AnchordockingDsg/DockedFormEditor is installed. Grab the IDE and move it slowly up and left. Actually it does flicker a lot.
I cannot reproduce the flickering with a regular application.

440bx

  • Hero Member
  • *****
  • Posts: 3268
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #13 on: December 10, 2022, 09:26:10 am »
The IDE does flicker if AnchordockingDsg/DockedFormEditor is installed. Grab the IDE and move it slowly up and left. Actually it does flicker a lot.
I cannot reproduce the flickering with a regular application.
that gives the impression that the code responsible for the flicker is most likely in the AnchordockingDsg/DockedFormEditor component.

Originally, if @Jamie had posted a simple project exhibiting the problem, I was going to use Rohitab's API spy to see what API calls may be causing it.  Since I don't use AnchordockingDsg/DockedFormEditor hopefully someone who does is interested in finding the cause of the flicker.

My _guess_ is that the component messes around with the window class styles, possibly activating CS_HREDRAW and CS_VREDRAW, which are the most common reasons for abundant flicker.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 SP1 64bit.

GetMem

  • Hero Member
  • *****
  • Posts: 3953
Re: Main menu flickers badly in IDE and apps generated by it.
« Reply #14 on: December 10, 2022, 09:39:50 am »
@440bx

Quote
that gives the impression that the code responsible for the flicker is most likely in the AnchordockingDsg/DockedFormEditor component.
Yes, I agree.

I found a way to reproduce it with the undocked IDE too(Lazarus trunk/Windows10). Drag the IDE down(200-300 px or so), then move it up until the mouse "touch" the upper part of the screen(Mouse.PY = 0), then make a small circle with the mouse. I know this is an extreme case, but I believe this is the kind of flickering @Jamie saw.
 


 

TinyPortal © 2005-2018