Skip to content
Snippets Groups Projects
Commit 903a5904 authored by Joni Poikelin's avatar Joni Poikelin
Browse files

Fix QComboBox popup from opening on wrong screen


Nothing seems to be telling the popup on which screen it should be shown
on. To fix this, simply set same screen the QComboBox uses to the popup.

Task-number: QTBUG-58392
Change-Id: If62a26fe4e51bcf3d770ee72c9baa998541618f4
Reviewed-by: default avatarAndy Shaw <andy.shaw@qt.io>
parent 2a41e05f
No related merge requests found
...@@ -2746,6 +2746,22 @@ void QComboBox::showPopup() ...@@ -2746,6 +2746,22 @@ void QComboBox::showPopup()
bool startTimer = !container->isVisible(); bool startTimer = !container->isVisible();
container->raise(); container->raise();
container->create();
QWindow *containerWindow = container->window()->windowHandle();
if (containerWindow) {
QWindow *win = window()->windowHandle();
if (win) {
QScreen *currentScreen = win->screen();
if (currentScreen && !currentScreen->virtualSiblings().contains(containerWindow->screen())) {
containerWindow->setScreen(currentScreen);
// This seems to workaround an issue in xcb+multi GPU+multiscreen
// environment where the window might not always show up when screen
// is changed.
container->hide();
}
}
}
container->show(); container->show();
container->updateScrollers(); container->updateScrollers();
view()->setFocus(); view()->setFocus();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment