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

Fix for side panel widget out of screen #3522 #3550

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

petrugrd
Copy link
Contributor

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.

flameshot-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.

 * https://doc.qt.io/qt-5/qdesktopwidget.html#screen-geometry

Signed-off-by: Petru Gurduza <petrugurduza1@gmail.com>
@petrugrd petrugrd marked this pull request as draft April 1, 2024 00:29
@petrugrd
Copy link
Contributor Author

petrugrd commented Apr 1, 2024

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.

@mmahmoudian
Copy link
Member

@petrugrd Thanks. Looking forward for your PR to get out of draft and merge ready. Also thanks for using the Windows CI.

@petrugrd
Copy link
Contributor Author

petrugrd commented Apr 2, 2024

Hi @mmahmoudian,
Would be nice if someone tested this first on a Mac with the same screen configuration as pointed in the screenshot. I have doubts that more changes have to be done, which may or may not break other stuff, especially removing the next #if (defined(Q_OS_MACOS)) blocks:

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 <petrugurduza1@gmail.com>
@petrugrd petrugrd marked this pull request as ready for review April 2, 2024 12:37
@mmahmoudian
Copy link
Member

@petrugrd I have no access to MacOS. Maybe @panpuchkov has some access to a mylti-monitor Mac setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants