Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Mouse Interaction with UI causes Paint to not function
Mouse Interaction with UI causes Paint to not function [message #60036] Tue, 11 July 2023 18:10 Go to next message
devilsclaw is currently offline  devilsclaw
Messages: 72
Registered: August 2022
Member
So I have a custom paint that shows a loading progress area as a file is loaded. If I move my mouse any where inside the window not just in the custom paint area and it will now update until the mouse stops or leaves the window. Some how the mouse is causing a lock up on painting.

[Updated on: Tue, 11 July 2023 18:10]

Report message to a moderator

Re: Mouse Interaction with UI causes Paint to not function [message #60037 is a reply to message #60036] Tue, 11 July 2023 19:25 Go to previous messageGo to next message
devilsclaw is currently offline  devilsclaw
Messages: 72
Registered: August 2022
Member
Its not as simple as that it seems. I created a demo and its working. Maybe something to do with a two top windows interacting with each other. still working on the demo.
Re: Mouse Interaction with UI causes Paint to not function [message #60041 is a reply to message #60036] Fri, 14 July 2023 17:32 Go to previous message
devilsclaw is currently offline  devilsclaw
Messages: 72
Registered: August 2022
Member
Dual Window may not be required but its how I got it to happen.

I have a GUI app what has a Window that then starts another main window with custom drawing. from now one first window is main window and the second window is sub window.

in the main window code it does a job that causes the sub window to show a progress bar which is custom drawn. this job is in it own thread and uses EnterGuiMutex and LeaveGuiMutex. the thread will loop and call fresh when things change.

In this setup it causes performance problems and even allowing the mouse to enter and move around will cause the painting to stop rendering new images.

I found that if I use std::this_thread::sleep_for(std::chrono::milliseconds(2)); in the thread which allow it to loose context. This allow everything to work fine.

Just figured I will let people fined out what I found out. That ended up being the solution for me.
Previous Topic: BufferPainter Clip Crash - Fatal error: Invalid memory access!
Next Topic: Font and Image rendering slow
Goto Forum:
  


Current Time: Sat May 04 10:24:21 CEST 2024

Total time taken to generate the page: 0.03175 seconds