# Rhino 8 - Modal Dialogs Issue

**URL:** <https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683>\
**Category:** Rhino Developer\
**Tags:** windows, rhino8, dialog, modal\
**Created:** [December 16, 2023, 10:27pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683 "2023-12-16T22:27:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 16, 2023, 10:27pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/1 "2023-12-16T22:27:03Z")

</div>

In Rhino 7 our application (JewelBeetle) was able to interact with both the Viewports and a Command Dialog such as Sweep 2 Rail Options dialog. While the command is running, the dialog although appears modal, still allowed you to interact with the Viewport.

In Rhino 8 we just get the windows error sound, as if the viewports are from another application, and so you cannot interact with them, while the dialog box is open. This breaks a lot of commands that use Rhino Dialogs while running.

I hope someone has an idea on this issue, I’ve been working for two days for a solution and so far I’ve had no luck.

Background: We REPARENT the Rhino Window inside of our WPF Window. This is necessary for completeness of our custom UI. If I remove the Reparent logic, and allow Rhino to remain a free floating separate window, the issue doesn’t happen.

I’m just hoping there is a simple obvious solution from someone. Any thoughts on this @stevebaer @dale @Trav @menno ?

Here is a quick visual of Rhino 8 on the left, and Rhino 7 on the right:  
 ![Rhino8ModalFocusIssue](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/d/8/0d8343412d66c7f41feba60b359270990596349d.gif)

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 20, 2023, 7:13pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/2 "2023-12-20T19:13:38Z")

</div>

I would really appreciate any help, anyone can be here. We are pretty stumped. Does anyone else have any similar issue?

@pascal do you have any ideas with these popups from a running command? I’ve checked the window styles and it seems like they didn’t change going from R7 to R8. But for some reason they are acting more modal than in R7?

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [December 20, 2023, 8:59pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/3 "2023-12-20T20:59:46Z")

</div>

Hi Jason - programing is way above my paygrade and competence - I’ll see if I can get someone’s attention…

@dale - can you help?

-Pascal

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 20, 2023, 9:42pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/4 "2023-12-20T21:42:11Z")

</div>

I’ve done more digging and it seems that when I watch the Rhino Window for Window Messages, in Rhino 7, after that Dialog for Sweep2 is shown, window messages continue to pump into the Rhino window.

But in Rhino 8, as soon as the dialog for Sweep2 is shown, window messages are not getting to the Rhino Window.

I’ve looked at our code and there is no difference between our Rhino 7 vs. Rhino 8 version of logic.

The only thing currently that fixes the issue is to not reparent the Rhino Window, but we have to in order for it to live inside of our UI.

Hope this context helps spark a solution, and maybe see if there is some window message forwarding that used to be there in 7 that isn’t in 8 maybe? Or isn’t if it isnt the top level window in 8.

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 22, 2023, 8:15pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/5 "2023-12-22T20:15:57Z")

</div>

I’m not sure if there are any pinvoke Gods at McNeel, but in case this helps. Here is a sample of the code we are doing to reparent the Rhino Window inside of our UI, that worked fine in Rhino 7, but now in Rhino 8 these dialogs that popup during for instance the Sweep2 command, prevent the Rhino Windows from getting the messages from the mouse.

```auto
var rhinoWindowHandle = Rhino.RhinoApp.MainWindowHandle();
 Win32APIHelper.RemoveBordersAndFrame(rhinoWindowHandle);
 Win32APIHelper.ReparentWindow(rhinoWindowHandle, parentHandle);
 Win32APIHelper.SetWindowAsChild(rhinoWindowHandle, parentHandle, 0, 0, 800, 600);

```

The attached file was generated by ChatGPT to avoid giving away any of our actual code, but it does essentially do the same work we do in our code.  
[Win32APIHelper.cs](https://discourse.mcneel.com/uploads/short-url/cKU0BuSbB0U3AB32CEgRWpXn5hh.cs) (3.6 KB)

Do you guys have any idea if those dialogs have a custom window message loop that is different in Rhino 8 that is affected by the owner of the Rhino Window? That didn’t affect Rhino 7?

@dale can you tag someone on your team that may have any ideas?

---

<div class="post-metadata">

**Author:** ![jdhill](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jdhill/32/565976_2.png) [@jdhill](https://discourse.mcneel.com/u/jdhill)\
**Post date:** [December 22, 2023, 8:42pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/6 "2023-12-22T20:42:22Z")

</div>

all I notice without setting up a test project is that the SetParent docs say to clear WS\_POPUP and set WS\_CHILD _before_ calling SetParent, if hWndNewParent is non-NULL and currently a child of the desktop; it also says to synchronize UISTATE

but I guess you have probably already tried this

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 22, 2023, 8:43pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/7 "2023-12-22T20:43:12Z")

</div>

Thanks for responding Jeremy. I’ll give that a shot. My SetWindowAsChild() is that, and so if I push the ReparentWindow() call to the end, it doesn’t change the behavior.

So alas, the problem still exists. Thanks for trying buddy!

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 22, 2023, 11:51pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/8 "2023-12-22T23:51:44Z")

</div>

@pascal @dale I created an entire new solution, with the minimum code, demonstrating the issue we are having. I hope this can help someone there track down what is different in Rhino 8 that we need to code differently to handle.

The solution has everything needed with 4 easy steps to reproduce the issue.

[SampleFocusIssuePlugin.7z](https://discourse.mcneel.com/uploads/short-url/wTiSDFSsE7KIueJDnkiecFynm4n.7z) (130.5 KB)

This is a .Net 4.8 WPF General Utility Plugin that demonstrates the issue. It has everything needed to see the issue we are experiencing. Just run the solution, execute the **SampleFocusIssueCommand** and it will open the main window of the plugin.

Click the buttons 1-4 to see the issue.

And here is a video demoing the solution:

[![](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/7/4/4747f44e88814ceebff6af04a17a0e6fc32e25c4.jpeg "Rhino 8 Modal Dialog Issue") ](https://www.youtube.com/watch?v=hN3CcaO2uIw)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [December 27, 2023, 10:04pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/9 "2023-12-27T22:04:05Z")

</div>

Hi @jstevenson,

Just a quick note to let you know I’ve seen this and will investigate.

– Dale

---

<div class="post-metadata">

**Author:** ![brian](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/brian/32/504171_2.png) [@brian](https://discourse.mcneel.com/u/brian)\
**Post date:** [November 28, 2024, 4:52pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/10 "2024-11-28T16:52:25Z")

</div>

[RH-84865](https://mcneel.myjetbrains.com/youtrack/issue/RH-84865) is fixed in [Rhino 8 Service Release 14](https://www.rhino3d.com/download/rhino/8/latest)

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 4, 2024, 1:53pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/11 "2024-12-04T13:53:50Z")

</div>

Happy Thanksgiving @dale,

Looks like your changes fixed our issues with being unable to resize the toolbars or the command prompt. Unfortunately now the dialogs for commands like **Sweep2** no longer show up at all.

I can see the command is expecting the dialog to be visible, but is isn’t anywhere to be seen. This doesn’t seem to be related to being parented, because I had special code that makes the desktop the Rhino processes parent.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/1/3/5136f1cbb7578fbb690e5a5d374b6922f19f0145.jpeg)

If I use Rhino by itself of course this issue doesn’t happen. We are really stuck here, because now you can no longer **Add Slash** or manipulate the options in Sweep 2.

Interestingly enough the **Quad Remesh** dialog does show up, even though it was another of the commands that we had issues because of our reparenting, but you still cannot interact with the viewport still while it’s dialog is open unless we unparent the window.

I’m hoping you have some more ideas. At this point, the cure might have been worse that the disease, unless there are multiple commits affecting these issues.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [December 4, 2024, 10:12pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/12 "2024-12-04T22:12:26Z")

</div>

Hi @jstevenson,

Your `SampleFocusIssuePlugin` works nicely here, including the Sweep2 test.

Can you test this plug-in to make sure I’m not crazy?

– Dale

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 5, 2024, 9:59am UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/13 "2024-12-05T09:59:47Z")

</div>

Good Morning @dale,

I’m sorry if I mislead you, after further investigation, it appears as though **Sweep2** is now fixed. Looks like Rhino had remembered where that dialog window was last shown, and it was in a location on another monitor that wasn’t currently active on my system. The monitor has 2 inputs, and it was connected to another laptop at the time of testing.

I do still however have an issue with focus specifically with the **QuadRemesh** and 7 other commands. I’ve retested our list of commands that were known to have these issues. Here is the updated list of commands that continue to have this issue, I assume they use a different set of dialog logic than the now fixed Sweep2 command.

When a command isn’t allowing focus to the viewport, it’s dialog shows a Rhino Icon, while the command dialogs that you fixed are showing our application icon:  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/2/9/6294b233ef36bfb8b8553aab50de1700c4c0aee5.png) ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/3/9/0392c7df98888858f2659f4acf19c78c4b5c81ea.png)

_Previously had focus issues, these can now be used while dialog open:_  
**Loft, Rebuild, Sweep1, Sweep2, NetworkSrf, Patch, Heightfield, MatchSrf**

_These commands continue to not allow interacting with the viewport while their dialogs are displayed:_  
**Make2d, QuadRemesh, RibbonOffset, ShrinkWrap, SubDLoft, SubDSweep1, SubDSweep2, Vectorize**

So I cannot remove all of our unparent logic yet, but **Sweep2** and other above commands are now off our naughty list. I hope this can give you an idea of where to look next. The remaining commands with dialog issues are likely setting their dialog parent differently than the now working commands.

Thank you for fixing those 8 commands, just 8 more and we can delete a whole bunch of hacky code.

Thank you so much for spending time on this, I know this isn’t your core usage for Rhino, but we appreciate you digging into this for us.

– Jason

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 8, 2024, 10:39am UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/14 "2024-12-08T10:39:46Z")

</div>

Can you change the visibility of this work item to public?

---

<div class="post-metadata">

**Author:** ![nathanletwory](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathanletwory/32/482880_2.png) [@nathanletwory](https://discourse.mcneel.com/u/nathanletwory)\
**Post date:** [December 8, 2024, 11:02am UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/15 "2024-12-08T11:02:25Z")

</div>

Accessible now.

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 8, 2024, 11:43am UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/16 "2024-12-08T11:43:18Z")

</div>

I see that the issue is marked closed, but it is still happening on the other commands I mentioned two comments above. Can you ask @dale to re-open it, or create a new work item for these remaining commands?

Thank you sir!

Jason

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [December 9, 2024, 4:00pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/18 "2024-12-09T16:00:22Z")

</div>

Hi @jstevenson,

I’ve opened a new issue for the .NET specific dialog issue.

[https://mcneel.myjetbrains.com/youtrack/issue/RH-85097](https://mcneel.myjetbrains.com/youtrack/issue/RH-85097)

– Dale

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 20, 2024, 12:17pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/19 "2024-12-20T12:17:15Z")

</div>

Any chance of a Christmas Miracle for this one @curtisw ?

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [December 31, 2024, 12:49pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/20 "2024-12-31T12:49:55Z")

</div>

Any chance we can get some help on this before end of January? We release v1 of our software at end of January, would be great if we could resolve this last issue with our Rhino 8 users.

---

<div class="post-metadata">

**Author:** ![jstevenson](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jstevenson/32/773002_2.png) [@jstevenson](https://discourse.mcneel.com/u/jstevenson)\
**Post date:** [January 14, 2025, 5:07pm UTC](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683/21 "2025-01-14T17:07:23Z")

</div>

@dale @curtisw @Trav @Matt_Bennett We will be releasing our v1 of JewelBeetle in about 13 days, I would really like to be able to resolve this last issue with our Rhino 8 users.

Would anyone be able to look at RH-85097 soon?

Thank you for you for any help you can provide.

Jason

[Next page](https://discourse.mcneel.com/t/rhino-8-modal-dialogs-issue/171683.md?page=2)
