-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix for side panel widget out of screen #3522 #3550
base: master
Are you sure you want to change the base?
Fix for side panel widget out of screen #3522 #3550
Conversation
The problem was that the panel was moved relative to (0, 0) coordinates, which is not an issue in case of single display, or multiple displays in the same row. Since capture widget is placed on all screens, the point (0, 0) will be the top left corner of virtual screen instead of top left corner of the current screen concluding from QDesktopWidget documentation (*). This caused the panel to be shifted up if the height of the primary screen was smaller than the virtual one. * https://doc.qt.io/qt-5/qdesktopwidget.html#screen-geometry Signed-off-by: Petru Gurduza <[email protected]>
24a3151
to
40e996a
Compare
Hello @flameshot-org. I updated also .github/workflows/Windows-pack.yml in order for Windows build to pass successfully. Feel free to take this change in another commit for builds to pass. BR, Petru. |
@petrugrd Thanks. Looking forward for your PR to get out of draft and merge ready. Also thanks for using the Windows CI. |
Hi @mmahmoudian, diff --git a/src/widgets/panel/utilitypanel.cpp b/src/widgets/panel/utilitypanel.cpp
index 5fc1889e2f..4fd9310fbd 100644
--- a/src/widgets/panel/utilitypanel.cpp
+++ b/src/widgets/panel/utilitypanel.cpp
@@ -42,7 +42,7 @@ UtilityPanel::UtilityPanel(CaptureWidget* captureWidget)
m_internalPanel,
&QWidget::hide);
-#if (defined(Q_OS_WIN) || defined(Q_OS_MACOS))
+#if (defined(Q_OS_MACOS))
move(0, 0);
#endif
hide();
@@ -87,7 +87,7 @@ void UtilityPanel::show()
m_showAnimation->setEndValue(QRect(0, 0, width(), height()));
m_internalPanel->show();
m_showAnimation->start();
-#if (defined(Q_OS_WIN) || defined(Q_OS_MACOS))
+#if (defined(Q_OS_MACOS))
move(0, 0);
#endif
QWidget::show(); |
Signed-off-by: Petru Gurduza <[email protected]>
@petrugrd I have no access to MacOS. Maybe @panpuchkov has some access to a multi-monitor Mac setup. |
Hi @mmahmoudian , @panpuchkov. Is there any chance to test this PR on a Mac setup, or it can be reviewed and merged as it is? |
This fixes the issue #3522
The problem was that the panel was moved relative to (0, 0) coordinates, which is not an issue in case of single display, or multiple displays in the same row.
Since capture widget is placed on all screens, the point (0, 0) will be the top left corner of virtual screen instead of top left corner of the current screen concluding from QDesktopWidget documentation (*). This caused the panel to be shifted up if the height of the primary screen was smaller than the virtual one.