Search found 100 matches

by Big Muscle
Wed Dec 13, 2023 2:29 pm
Forum: C++ Development
Topic: Non-blocking (Popup)menu possible?
Replies: 9
Views: 3745

Re: Non-blocking (Popup)menu possible?

As you explained, even though wxWindow::PopupMenu(...) is a blocking call (it doesn't return until the popup menu is closed), wxWidget's event system is still working behind the scenes, and events are still sent/received, in the main thread, during that period of time. On MSW however, this excludes...
by Big Muscle
Fri Dec 02, 2022 8:04 am
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

So I probably found a cause of the problem. There was a hidden call to ProcessEvent initiated from the child thread which resulted in calling GUI functions from this child thread. After fixing this, the problem does not seem to appear anymore :-)
by Big Muscle
Wed Nov 30, 2022 2:06 pm
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

So the problem appears also when completely removing idle events and do all processing in onTimer event handler.
by Big Muscle
Mon Nov 28, 2022 6:59 pm
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

So there is something weird that I really cannot understand. This is my (simplified) code: void OnTimer() { wxWakeUpIdle(); } void OnIdle() { bool hasNewFrame = false; Frame frame = GetCameraFrame(); if(frame.timestamp != lastFrameTimestamp) { lastFrameTimestamp = frame.timestamp; UpdateImage(frame)...
by Big Muscle
Wed Nov 23, 2022 8:57 am
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

Since onTimer events are running, I tried experiment with saving the time of last call of onPaint event: void CWindow::OnTimer(wxTimerEvent&) { if (Utils::getTimeMillis() - g_lastRefreshTime > 20000) { ... When I call Refresh+Update here, the GUI repaints once. If I open another dialog/message b...
by Big Muscle
Tue Nov 22, 2022 12:22 pm
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

Unfortunately, there does not seem to be any problem with locks in threads. All threads are running properly, nothing seems to be deadlocked, only main thread does not receive any GUI events.
by Big Muscle
Wed Nov 16, 2022 12:15 pm
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

Yes, everything runs on main thread. Background threads only processes data and call wxLogInfo eventually (very rarely). The problem appears only at application startup. GUI is drawn but stops a few second after. E.g. GTK+3 "draw" signal stops being received. If it does not appear at start...
by Big Muscle
Tue Nov 15, 2022 1:39 pm
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

I will try, but I don't think it helps, because problem is that no events are processed (except onIdle and onTimer, so maybe they are not window events?). The window does not respond to mouse clicks etc.
by Big Muscle
Tue Nov 15, 2022 12:22 pm
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

There is not RequestMore(). The timer ticks every 125 ms a calls wxWakeUpIdle(). OnIdle handler process data from camera and calls Refresh(). It works most of the time. I'm logging events: 2022-11-15 12:49:58: OnTimer 2022-11-15 12:49:58: OnIdle 2022-11-15 12:49:58: OnPaint 2022-11-15 12:49:59: OnTi...
by Big Muscle
Tue Nov 15, 2022 9:19 am
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Re: Application stops receiving events

That was my first suspicion. So I tried changing the timer (in debugger) to oneshot, so it gets executed only once but it does not help.
by Big Muscle
Tue Nov 15, 2022 8:42 am
Forum: C++ Development
Topic: Application stops receiving events
Replies: 17
Views: 4836

Application stops receiving events

I came into weird situation. I don't know if it is my code bug or problem with wxWidgets or GTK+. wxWidgets 3.3.0 (but happened also on 3.2.0), GTK+3, Raspbian. It happens completely randomly (about 1 run of 20) that application is executed, paints the GUI and then it gets stuck. OnTimer events (tim...
by Big Muscle
Fri Jul 22, 2022 1:18 pm
Forum: C++ Development
Topic: Blocking socket and timeout
Replies: 3
Views: 330

Re: Blocking socket and timeout

It is GTK+3, version 3.2.0 built from github source. It will probably hard to reproduce with socket sample. Write() seems to block only in very rare cases (e.g. when remote client hangs). But maybe I'm doing something wrong. What I want to achieve is to have socket that read/write in separate thread...
by Big Muscle
Fri Jul 22, 2022 11:40 am
Forum: C++ Development
Topic: Blocking socket and timeout
Replies: 3
Views: 330

Blocking socket and timeout

Hello, I have a question. Maybe I'm doing something wrong. I have a socket that is being written in the separate thread. The socket is blocking and I set timeout to 2 seconds, but it seems that the timeout is not respected and Write is blocked forever. Is it correct? I would expect that it will bloc...
by Big Muscle
Tue Jun 07, 2022 9:54 am
Forum: Platform Related Issues
Topic: [GTK+3] Screenshot using wxScreenDC not refreshed
Replies: 7
Views: 634

Re: [GTK+3] Screenshot using wxScreenDC not refreshed

No difference. This is ugly but this works - blit screenDC to clientDC and then clientDC to memoryDC: wxScreenDC dc; wxSize size = dc.GetSize(); wxClientDC clientDC(this); clientDC.Blit(0, 0, size.x, size.y, &dc, 0, 0); wxBitmap bmp(size.x, size.y); wxMemoryDC memDC(bmp); memDC.Blit(0, 0, size.x...
by Big Muscle
Tue Jun 07, 2022 9:05 am
Forum: Platform Related Issues
Topic: [GTK+3] Screenshot using wxScreenDC not refreshed
Replies: 7
Views: 634

Re: [GTK+3] Screenshot using wxScreenDC not refreshed

I already found that topic and it does not work (unless I do something wrong). However, I noticed that the problem appears only when blitting wxScreenDC to wxMemoryDC. When I blit to wxPaintDC then everything seems ok.