wxDialog loses focus at show

77 views
Skip to first unread message

Сергей Коныгин

unread,
Jun 15, 2023, 2:48:14 PM6/15/23
to wx-users
Hello!

Recently I noticed that my dialog windows have no focus after calling ShowModal(). Therefore I need to click the left mouse button in order to activate window. There are no visible problems except one more mouse clicking. Probably this strangeness appears since version 3.2.2.1.
I have no idea how to solve this problem.

Vadim Zeitlin

unread,
Jun 15, 2023, 3:02:02 PM6/15/23
to wx-u...@googlegroups.com
On Thu, 15 Jun 2023 11:48:14 -0700 (PDT) Сергей Коныгин wrote:

СК> Recently I noticed that my dialog windows have no focus after calling
СК> ShowModal(). Therefore I need to click the left mouse button in order to
СК> activate window. There are no visible problems except one more mouse
СК> clicking. Probably this strangeness appears since version 3.2.2.1.
СК> I have no idea how to solve this problem.

Me neither, so I can just recommend the usual:

1. Please try to reproduce the problem with minimal changes to the dialogs
sample (which already has all sorts of dialogs).
2. If this worked before, please try to run git-bisect to find the commit
in which is stopped working.

If you can do at least one of the above, please open an issue for this
problem and attach the diff to the sample (for (1)) or mention the commit
you found (for (2)) and, of course, in any case please provide your
platform details, i.e. at the very least which OS do you use.

Thanks,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

mihai....@gmail.com

unread,
May 24, 2024, 8:40:06 AMMay 24
to wx-users
Hi,

While debugging my application I have noticed the MouseMove events for the main window are still called even if there is another window shown over with ShowModal().

I have avoided unwanted behaviour by calling Freeze (before the ShowModal() call) for the main window ... 

I do not know when this "bug/behavior" was introduced.

I currently tested it for MacOS only.

best regards,
Mihai

mihai....@gmail.com

unread,
May 24, 2024, 11:08:26 AMMay 24
to wx-users
Hi,

I just tested it on Windows, and the problem is not manifesting.
So, it is specific for MacOS.
The dialog shown with ShowModal() does not get focus if I do not click on it. Because of that, mouse events (like mouse move) are still generated for window behind it ...

Mihai

mihai....@gmail.com

unread,
Jun 5, 2024, 1:43:35 AMJun 5
to wx-users
Hi,

The worst part of this problem is that even after calling wxMessageBox, the mouse move events are still generated for the window behind it.
So, I had to unbind all mouse move messages before calling ShowModal and wxMessageBox and then to bind them again.

This problem appears only on MacOS. I have not noticed it in the older versions of wxWidgets.

best regards,
Mihai

Vadim Zeitlin

unread,
Jun 8, 2024, 10:02:52 AMJun 8
to wx-u...@googlegroups.com
On Tue, 4 Jun 2024 22:43:35 -0700 (PDT) mihai....@gmail.com wrote:

m> The worst part of this problem is that even after calling wxMessageBox, the
m> mouse move events are still generated for the window behind it.
m> So, I had to unbind all mouse move messages before calling ShowModal and
m> wxMessageBox and then to bind them again.
m>
m> This problem appears only on MacOS. I have not noticed it in the older
m> versions of wxWidgets.

Sorry, I really can't add much more to what I had written previously. If
you can, please try running git-bisect to find when this broke and open an
issue with this information.

Thanks,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages