-
Notifications
You must be signed in to change notification settings - Fork 511
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
Property Browser window stays on top after switching focus #412
Comments
I believe the cause is somewhere along these lines: solvespace/src/platform/guiwin.cpp Lines 541 to 559 in f43954c
The relevant code in 2.3 is here: solvespace/src/win32/w32main.cpp Lines 1253 to 1319 in b1d87bf
There's a fair bit of difference between them. Do you think you could try playing with the Here is the fairly confusing Microsoft doc for window styles. |
I managed to arrive at the correct behaviour by applying the following: diff --git a/src/platform/guiwin.cpp b/src/platform/guiwin.cpp
index 73da2da..ec6bfca 100644
--- a/src/platform/guiwin.cpp
+++ b/src/platform/guiwin.cpp
@@ -545,7 +545,7 @@ public:
break;
case Window::Kind::TOOL:
- style |= WS_POPUPWINDOW|WS_CAPTION;
+ style |= (/*WS_POPUP | */WS_BORDER | WS_SYSMENU)|WS_CAPTION|WS_CHILD;
break;
}
sscheck(hWindow = CreateWindowExW(0, L"SolveSpace", L"", style, However, the window now looks Unfortunately, I haven't managed to make it look platable nor as-was in 2.3 (not for lack of slamming my head against a proverbial wall) with any combination of more or less sensible options. Also, a few questions that popped up while I was making this:
|
Have you tried this? I think the property browser isn't intended to have a sysmenu, and that might make it look better:
That's actually intended, or at least that was the 2.x behavior, IIRC. This should have the effect of forwarding key bindings to the parent window. Can you try disabling the following code and seeing if key bindings (e.g. solvespace/src/platform/guiwin.cpp Lines 945 to 952 in f43954c
Here is the part of the code that deals with scroll events: solvespace/src/platform/guiwin.cpp Lines 863 to 878 in f43954c
I'm not entirely sure from your description what went wrong here.
Depends. Some warnings are useful, some are not, and compilers constantly add new warnings. You could post them here if you wanted. |
The In both 2.3 as well as unpatched Commenting out the Another thing I saw in taking those screenshots is that in the Here's a video illustrating the issue: the scrolling code works fine, but the as the mouse is over the Property Browser window and scrolling, if there's any selectable face in the sketch window at the mouse's position, it will be highlighted, until the mouse is moved. And here's the warnings
|
I fixed the warning in be0dc7e. |
Now that I look closer at the window staying on top, well, there's code that does that: solvespace/src/platform/guiwin.cpp Lines 562 to 565 in be0dc7e
What if you comment it out and rely on parent-child relationship? |
That did it, the window abides as expected! |
As a Windows user, which set of |
Regarding this bug, I think I know what causes it, as well as why I can't reproduce it. Can you open another issue so it doesn't get lost? |
|
To recheck, do I understand it correctly that without that code, the property browser window is still on top of the main window at all times, but now it is no longer on top of other windows when the main window is not in focus? |
Yes |
Fixed in 5dbe090. |
Superb, thank you! |
System information
SolveSpace version: 3.0~62aba398
Operating system: Windows 10
Expected behavior
The Property Browser window is obscured alongside the sketch window after changing focus to a different window.
Actual behavior
The Property Browser window stays on top of whatever new window was selected. Clicking on any part of the window focuses it and brings back the sketch window.
Additional information
Works as expected on 2.3.
Screenshot
The text was updated successfully, but these errors were encountered: