After replacing the "refresh" threads with timers, the problem disappeared. For some reason, the refresh events were not being queued properly by the detached threads, especially after system reboot.
Thank you very much for your help and Happy New Year
Search found 83 matches
- Sat Jan 02, 2021 4:44 pm
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
- Wed Dec 30, 2020 6:30 pm
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Re: Application window refreshing only on mouse movement.
I've tried re-installing the application on Linux Mint, instead of Ubuntu Cinnamon Remix, and the problem still persists. It seems to only occur after a system reboot. The application will not refresh until the mouse is hovered over it. However, the application starts to work normally when it's rest...
- Wed Dec 30, 2020 10:22 am
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Re: Application window refreshing only on mouse movement.
Moving the mouse outside any of your application windows should not trigger any events and therefore should not have any effect. Moving the mouse outside the application window doesn't trigger any events, only moving it over the wxWidgets frame. Could that still be related to the Linux environment ...
- Wed Dec 30, 2020 9:54 am
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Re: Application window refreshing only on mouse movement.
How many different elements are there to be updated? Or do you just unconditionally refresh everything? I unconditionally refresh everything. If the threads are constantly working anyway, you could just have a timer in the main thread, e.g. at 2-20 Hz (which should be enough for gui updates) and up...
- Tue Dec 29, 2020 5:51 pm
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Re: Application window refreshing only on mouse movement.
Because you algorythm is doing so. ;-) Just get rid of the updating/refreshing thread and do this directly in the main GUI one. Thanks for your reply, however, I don't understand how my algorithm is doing so? How does the process of queuing events from a separate thread cause the main window to onl...
- Tue Dec 29, 2020 5:25 pm
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Re: Application window refreshing only on mouse movement.
Did you leave out the part where the thread actually does something, or is this all it does? (which wouldn't make any sense). The thread only queues events in the main window. Other threads are tasked with fetching or sending new data, which is then shared between all threads in the application. Pe...
- Tue Dec 29, 2020 1:04 pm
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Re: Application window refreshing only on mouse movement.
Thank you for your replies. As I'm not currently in the office, I can't answer all your questions, however, I can answer the following: Does wxWidgets use GTK2 or GTK3? I'm using wxWidgets version 3.1.4, with GTK3. In addition - what theme do you use? Latest version of Ubuntu Cinnamon Remix, with th...
- Mon Dec 28, 2020 6:04 pm
- Forum: Platform Related Issues
- Topic: Application window refreshing only on mouse movement.
- Replies: 18
- Views: 16305
Application window refreshing only on mouse movement.
Hello, I've developed a multithreaded wxWidgets application on a Linux platform. The application uses a few detached threads for fetching new data from local devices or the network, and a single thread to queue events in the "main" loop, which then updates the display via event handlers. D...
- Sun Jun 07, 2020 10:53 am
- Forum: C++ Development
- Topic: Adding static text to wxMenuBar
- Replies: 1
- Views: 381
Adding static text to wxMenuBar
Hello, I'm developing an application with a top menu bar, along with some drop-down menus. This works fine, however I'd also like to use a part of the menu bar (ideally the top right corner) to display the system time. Is there any way to display (and periodically update) a wxStaticText, or some equ...
- Mon Apr 06, 2020 3:40 pm
- Forum: Platform Related Issues
- Topic: wxSound Noise
- Replies: 1
- Views: 832
Re: wxSound Noise
I'm using Audacity to convert my mp3 files to .wav, and I'm starting to suspect it of creating a file format that causes the popping noise in wxWidgets. I'm not sure what wave format wxWidgets uses, since every .wav file that I download or tried to convert online failed to work? Only files created i...
- Mon Apr 06, 2020 2:59 pm
- Forum: Platform Related Issues
- Topic: wxSound Noise
- Replies: 1
- Views: 832
wxSound Noise
Hello, I'm using the wxSound class for a short user notification, which loops in the background. However, at the start of every loop, when the app starts to play the sound file, there is a noticeable 'popping' noise, which is pretty loud. I've tried different sound files and different headsets/speak...
- Thu Mar 26, 2020 2:38 pm
- Forum: C++ Development
- Topic: Error when closing application.
- Replies: 2
- Views: 715
Re: Error when closing application.
Ok, I've found the problem, apologies for the long post, but it had me confused for a while. The memory location I was referring to in: mbMaster->mb_mapping->tab_input_registers[11] was not created correctly, and hence the pointer errors, coming from the external Modbus library. I'm not sure why the...
- Thu Mar 26, 2020 2:15 pm
- Forum: C++ Development
- Topic: Error when closing application.
- Replies: 2
- Views: 715
Re: Error when closing application.
Upon further investigation, it seems that these function calls - in the Thread loop - are causing the error when closing the app for some reason: if (ct != -1) { wxCriticalSectionLocker enter(mbMaster->mb_guard); mbMaster->mb_mapping->tab_input_registers[11] = modbus_read_input_bits(ctx, 10001, MB_N...
- Thu Mar 26, 2020 2:05 pm
- Forum: C++ Development
- Topic: Error when closing application.
- Replies: 2
- Views: 715
Error when closing application.
Hello, I'm writing a new mulithreaded application in wxWidgets, and I'm encountering a pointer/malloc error that I can't quite figure out. I'm not sure if the problem lies in my wxWidgets code, or the external library that I'm using. On starting my wxWidgets application, I create an additional threa...
- Sat Oct 19, 2019 2:40 pm
- Forum: C++ Development
- Topic: Delete thread with blocking function
- Replies: 14
- Views: 2559
Re: Delete thread with blocking function
I managed to find (what I hope is) a good solution to the problem, by following these recommendations: https://github.com/stephane/libmodbus/issues/452 I made the TCP/IP socket non-blocking, using the following function: fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | O_NONBLOCK); This effectivel...