MouseDown not firing on label selection when run on Win10

I have combed through the forums posts I can find concerning MouseDown not firing and to start off I do have “return True” in my MouseDown event. The flow is as follows:
1). User runs main app
2). User clicks to add some stuff which triggers 1st dialog popup
3). Selections in the 1st dialog trigger a 2nd dialog popup
4). Selections in the 2nd dialog trigger a 3rd dialog popup
5). Selecting a checkbox in the 3rd triggers a 4th authentication popup

The 4th window has 4 labels, a password textfield and two buttons, the password textfield has focus when the window pops up.

The 3rd label has a URL shown and it has 3 events, MouseDown, MouseEnter & MouseExit, the intent is on the MouseDown event ShowURL is called with the string shown in the label and the browser should pop up with that link. The issue I’m having is that the MouseDown event is never called (I have a break point here in debugging), the MouseEnter & Exit events are called without issue. This only occurs if the application is run on Win10, it seems to run ok on MacOS.

I have tried duplicating this with a very simple app with an initial window kicking off 3 others with the 3rd containing a similar label and password text field but that works ok on Win10 and MacOS so the issue has something to do with the original application and how it’s working.

Wondering if there are any ideas on where to look next, running Xojo 2019r1 but this was seen originally on 2018r4. Like I mentioned above I’m returning true from the MouseDown event as that seemed to fix a similar issue for others, I’ve also tried forcing the label to have focus when the MouseEnter event fires but nothing has worked so far.

Depending on the modality of your windows, you might be encountering <https://xojo.com/issue/55262> where no clicks can happen on a window opened from a modal window. Watch the video on the 2nd post and see if it matches what you’re experiencing with the lack of “clickablility” of buttons on the last opened window.

In your demo project, check the modality and the frame type of the windows that you open to ensure they are the same as your main project. If you can replicate it, post a link up and we’ll see what we can do. To work around it, it might be that your last opened window needs to also be opened modally or another work around like Massimo posted on the forum link in that ticket.

I found sometimes ago (in a not recent version but don’t remember witch) that if you open a dialog from a MouseDown event, subsequent mouse events are not (consistently) raised. The MouseDown event seems to be “in use”.
Is it your case ? If yes, you could try to open the dialog in the MousUp event or in a PushButton Action event or with a Timer.

Thanks all for the suggestions and clues, so I think my situation is similar to the one Francois describes, my scenario w/some more detail is:

  • We have the main app (window #1)
  • Main app triggers a panel (window #2) w/a collection of checkboxes
  • Selecting one of the checkboxes raises MouseDown (no return True here)
  • Next to the checkbox is a button which when selected triggers movable modal (window #3)
  • The #3 modal window has a checkbox which when selected triggers a 2nd movable modal (window #4)
  • Window #4 has the URL label and password text field
  • When the URL label is clicked on by the mouse it does not trigger a MouseDown event

So 2nd MouseDown (in window #4) isn’t triggered because the MouseDown in the upper window (#2) is “in use” or “on hold”, will see if I can trigger in window #2 w/something other than MouseDown if possible.

Ok problem resolved using a timer, the problem turned out to be the call to launch window#4 from the “CellAction” for the checkbox in window #3, it works fine but the resulting window #4 has no MouseDown events. So created a timer in window #3 to get called when CellAction fired (checkbox is selected), also added a method in window #3 (CellActionTimer) to be the timers’ callback, the code to launch window #4 was placed here. The window launches and I’m able to get MouseDown events which properly trigger ShowURL and the browser.

Again thanks for the help, comments and suggestions.

Glad you got it working Mike. I had commented about the issue two years ago on <https://xojo.com/issue/46071> and obviously forgot. I added the info about it happening with a listbox to the original ticket here <https://xojo.com/issue/19233>. 7.5 years and counting :slight_smile: