-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(WIN32) i_get_window incorrectly assumes that GetWindowLongPtr will return an OSWindow #156
Comments
Hi @colugomusic At the moment, NAppGUI is designed to create its own runloop. However, I would like to add the support you need for your project. I would need some more context:
|
I don't use my own external loop. I use nappgui's
Yes I am mainly just using nappgui as a cross-platform solution to open up windows. All I need is this: struct device_ui {
View* view;
Layout* layout;
Panel* panel;
Window* window;
}; I then use nappgui is possibly too heavy of a library for what I need (simply a way to open a window) but it seems like the best thing I have found so far. Alternatives I have tried are choc's "DesktopWindow" class (https://github.com/Tracktion/choc/blob/main/gui/choc_DesktopWindow.h) and the "CrossWindow" project (https://github.com/alaingalvan/CrossWindow). But nappgui is also nice in that I can use it to also create debugging controls if I want to.
I'm not sure what the difference is between what you call a "blank" window and a "full" window. But I don't use an external message loop for handling the windows. I just use the
This isn't very easy for me to provide right now as audio plugin hosts are quite complex. You could have a look at the project I am working on here: https://github.com/colugomusic/scuff (The CLAP audio plugin host is partially implemented in the "sbox" subproject.) In the future I might extend the "test-host" subproject into a very simple plugin host but at the moment it's not there yet. By the way, instead of keeping track of all "known" HWND handles there is another approach which I have tested which appears to work. I found every call to 1234567 is just a random magic number that can then be used to check if a HWND came from nappgui. Then in |
Do you have a Discord user? |
Yes it is .colugo |
Related with this issue: #100 Is the opposite case, but both will be included in NAppGUI 1.5.0 release |
I am using
view_native
to get the native window handle. I need to do this as I am using nappgui to launch audio plugin editor windows (e.g. VST/CLAP), and I need to pass the native window handle to the plugins to allow them to embed their own UI into the OS window.If the audio plugin happens to create their own window handles internally then these foreign windows will end up being processed by nappgui's message loop.
The function
i_IsDialogMessage
will then calli_get_window
with a HWND which is unknown to nappgui, but nappgui assumes that, ifGetWindowLongPtr
returns non-null, then it must be anOSWindow
. This will result in a crash.I would recommend instead keep a list or map of HWNDs which are known to be managed by the nappgui framework, and ignoring any "foreign" window handles.
At the moment I am simply commenting out the call to
i_IsDialogMessage
in my fork of nappgui but it would be nice to have a better solution.I haven't tested this on Linux and macOS yet but I assume this is a problem specific to Windows' message processing.
The text was updated successfully, but these errors were encountered: