Skip to content
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

Make color picker preview mouse passthrough. #102320

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/linuxbsd/x11/display_server_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,7 @@ bool DisplayServerX11::mouse_process_popups() {
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
// Area of the parent window, which responsible for opening sub-menu.
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
if (win_rect.has_point(pos)) {
if (win_rect.has_point(pos) && !window_get_flag(DisplayServer::WINDOW_FLAG_MOUSE_PASSTHROUGH, E->get())) {
break;
} else if (safe_rect != Rect2i() && safe_rect.has_point(pos)) {
break;
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3632,7 +3632,7 @@
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
// Area of the parent window, which responsible for opening sub-menu.
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
if (win_rect.has_point(pos)) {
if (win_rect.has_point(pos) && !window_get_flag(DisplayServer::WINDOW_FLAG_MOUSE_PASSTHROUGH, E->get())) {
break;
} else if (safe_rect != Rect2i() && safe_rect.has_point(pos)) {
break;
Expand Down
4 changes: 2 additions & 2 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4389,7 +4389,7 @@ LRESULT DisplayServerWindows::MouseProc(int code, WPARAM wParam, LPARAM lParam)
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
// Area of the parent window, which responsible for opening sub-menu.
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
if (win_rect.has_point(pos)) {
if (win_rect.has_point(pos) && !window_get_flag(DisplayServer::WINDOW_FLAG_MOUSE_PASSTHROUGH, E->get())) {
break;
} else if (safe_rect != Rect2i() && safe_rect.has_point(pos)) {
break;
Expand Down Expand Up @@ -5010,7 +5010,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
Rect2i win_rect = Rect2i(window_get_position_with_decorations(E->get()), window_get_size_with_decorations(E->get()));
// Area of the parent window, which responsible for opening sub-menu.
Rect2i safe_rect = window_get_popup_safe_rect(E->get());
if (win_rect.has_point(pos)) {
if (win_rect.has_point(pos) && !window_get_flag(DisplayServer::WINDOW_FLAG_MOUSE_PASSTHROUGH, E->get())) {
break;
} else if (safe_rect != Rect2i() && safe_rect.has_point(pos)) {
break;
Expand Down
1 change: 1 addition & 0 deletions scene/gui/color_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,7 @@ void ColorPicker::_pick_button_pressed() {
} else {
picker_window->set_size(Vector2i(55, 72));
picker_window->set_flag(Window::FLAG_EXCLUDE_FROM_CAPTURE, true); // Only supported on MacOS and Windows.
picker_window->set_flag(Window::FLAG_MOUSE_PASSTHROUGH, true);
}
picker_window->connect(SceneStringName(visibility_changed), callable_mp(this, &ColorPicker::_pick_finished));
picker_window->connect(SceneStringName(window_input), callable_mp(this, &ColorPicker::_target_gui_input));
Expand Down