Browse Source

[X11] Fix IME subwindow in the popup not getting input focus.

bruvzg 2 years ago
parent
commit
9f42649823
2 changed files with 4 additions and 1 deletions
  1. 1 1
      platform/linuxbsd/x11/display_server_x11.cpp
  2. 3 0
      scene/gui/popup_menu.cpp

+ 1 - 1
platform/linuxbsd/x11/display_server_x11.cpp

@@ -4897,7 +4897,7 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, V
 	//   handling decorations and placement.
 	//   handling decorations and placement.
 	//   On the other hand, focus changes need to be handled manually when this is set.
 	//   On the other hand, focus changes need to be handled manually when this is set.
 	// - save_under is a hint for the WM to keep the content of windows behind to avoid repaint.
 	// - save_under is a hint for the WM to keep the content of windows behind to avoid repaint.
-	if (wd.is_popup || wd.no_focus) {
+	if (wd.no_focus) {
 		windowAttributes.override_redirect = True;
 		windowAttributes.override_redirect = True;
 		windowAttributes.save_under = True;
 		windowAttributes.save_under = True;
 		valuemask |= CWOverrideRedirect | CWSaveUnder;
 		valuemask |= CWOverrideRedirect | CWSaveUnder;

+ 3 - 0
scene/gui/popup_menu.cpp

@@ -840,6 +840,9 @@ void PopupMenu::_notification(int p_what) {
 				float pm_delay = pm->get_submenu_popup_delay();
 				float pm_delay = pm->get_submenu_popup_delay();
 				set_submenu_popup_delay(pm_delay);
 				set_submenu_popup_delay(pm_delay);
 			}
 			}
+			if (!is_embedded()) {
+				set_flag(FLAG_NO_FOCUS, true);
+			}
 		} break;
 		} break;
 
 
 		case NOTIFICATION_THEME_CHANGED:
 		case NOTIFICATION_THEME_CHANGED: