Fix inactive window passes events to window below (fix #4561)#4835
Fix inactive window passes events to window below (fix #4561)#4835Gasparoken wants to merge 1 commit into
Conversation
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| mouse_widgets_list); | ||
|
|
||
| if (mouse_widgets_list.size() == 2) | ||
| int otot=0; |
There was a problem hiding this comment.
warning: variable 'otot' of type 'int' can be declared 'const' [misc-const-correctness]
| int otot=0; | |
| int const otot=0; |
|
I will try to find an alternative solution at the os-laf level. |
Prior to this fix, if all of the following conditions were met: + While a modal window (such as the Preferences dialog) was open. + 'Multiple window UI' was enabled. + A non-modal window (such as the Preview window) overlapped the modal window. + The non-modal window was selected, so this window is on top of the modal window. Caused mouse clicks and movements within the overlay area of the non-modal window to be incorrectly passed to the window below, i.e. the modal window. Instead, it would be expected that no action would be taken.
57fc056 to
ea01d19
Compare
|
This fix will work if aseprite/laf#116 is merged first. |
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| spec.minimizable(window->isDesktop()); | ||
| spec.borderless(!window->isDesktop()); | ||
| spec.transparent(window->isTransparent()); | ||
| spec.modal(window->isForeground() || window->isOnTop()); |
There was a problem hiding this comment.
warning: no member named 'modal' in 'os::WindowSpec' [clang-diagnostic-error]
spec.modal(window->isForeground() || window->isOnTop());
^|
I'll left this to review in a future version as #4561 was a bug report for Windows, so I need to test this in all platform (and the laf fix was made only on macOS if I remember correctly). |
|
I'm trying to review all pending PRs. Testing this I'm not sure if a "isOnTop()" should be treated as a modal window (e.g. the combobox popup is the only one calling "setOnTop()" and it shouldn't a modal window). I'll merge a modified version of this patch calling spec.modal(window->isForeground());Anyway the |
Prior to this fix, if all of the following conditions were met: + While a modal window (such as the Preferences dialog) was open. + 'Multiple window UI' was enabled. + A non-modal window (such as the Preview window) overlapped the modal window. + The non-modal window was selected, so this window is on top of the modal window. Caused mouse clicks and movements within the overlay area of the non-modal window to be incorrectly passed to the window below, i.e. the modal window. Instead, it would be expected that no action would be taken. @dacap note: At the moment this fix only works on macOS because the os::WindowSpec::modal() parameter is only used on macOS.
|
Merged in d9785e5 |
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, If a window is foreground (modal), child windows (like combo boxes) must also use the modal level to appear above it. Regression of commit d9785e5: 'Fix inactive window passes events to window below (aseprite#4561, aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, If a window has a new child window (like combo boxes), it must be brought to the same level as its parent to appear above it. This fixes a regression inserted in the commit d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, If a window has a new child window (like combo boxes), it must be brought to the same level as its parent to appear above it. This fixes a regression inserted in the commit aseprite/aseprite@d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, If a window has a new child window (like combo boxes), it must be brought to the same level as its parent to appear above it. This fixes a regression inserted in the commit aseprite/aseprite@d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, If a window has a new child window (like a combo box list), it must be brought to the same level as its parent to appear above it. This fixes a regression inserted in the commit aseprite/aseprite@d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, if a window has a new child window (like a combo box list), it must be brought above its parent's z-order so it always appears on top, even when the parent is clicked/activated. This fixes a regression inserted in the commit aseprite/aseprite@d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, if a window has a new child window (like a combo box list), it must be brought above its parent's z-order so it always appears on top, even when the parent is clicked/activated. This fixes a regression inserted in the commit aseprite/aseprite@d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
Before this fix, on MacOS, combo box lists expanded behind the Preferences dialog when the 'UI with multiple windows' option was enabled. Now, if a window has a new child window (like a combo box list), it must be brought above its parent's z-order so it always appears on top, even when the parent is clicked/activated. This fixes a regression inserted in the commit aseprite/aseprite@d9785e5: 'Fix inactive window passes events to window below (aseprite/aseprite#4561, aseprite/aseprite#4835)'
This is a first approach, it may be wrong and for sure I need some advice.
Ideally I would like to make it so that at the OS level another window cannot be brought to the front/activated if there is already a modal window open.
Currently, this fix allows a non-modal window to be selected and brought to the front but does not allow events to propagate to the modal window.
fix #4561