Bug 458956 - Annotation view opens in top left corner
Summary: Annotation view opens in top left corner
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 22.08.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-10 13:17 UTC by gudvinr+kde
Modified: 2022-12-07 11:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.04


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gudvinr+kde 2022-09-10 13:17:40 UTC
SUMMARY

When I use annotation button in after screenshot notification, annotation editor launches in fixed position in top left corner instead of using standard placement rules. And it seems that it also doesn't remember its position.

Considering that I also use top panel, it makes this window non movable by dragging header because header is under this panel.

When I open annotation editor from gwenview, it opens in the middle of the screen.


STEPS TO REPRODUCE
1. Setup spectacle so it sends notification
2. Take screenshot
3. Use "Annotate" button on notification

OBSERVED RESULT

Annotation window opens in some reasonable place, e.g. in the middle of active screen.

EXPECTED RESULT

Annotation window opens in top left corner.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 1 Nate Graham 2022-09-13 18:16:29 UTC
Cannot reproduce on Wayland when using the "Centered" window placement. What window placement are you using?
Comment 2 gudvinr+kde 2022-09-13 19:07:02 UTC
I didn't know that settings to change this exist so apparently something that is on by default.

I there any info I can add to make sure that it is reproducible?
Comment 3 Nate Graham 2022-09-15 16:00:25 UTC
I don't know, sorry.
Comment 4 gudvinr+kde 2022-09-15 16:38:53 UTC
Is there any way to track window state changes (under wayland specifically) in kwin?
Preferably without compilation because I'd rather not.

One thing I noticed just now is when I open annotation editor from spectacle window and not from notification it opens in fullscreen.
If I close it and try to create new screenshot, then open again from spectacle window, it also opens in fullscreen.
Which means it also doesn't remember (or applies incorrectly) its size and position but in a different way.

These manipulation do not change behaviour when editor opened from notifications though, still opens in top left corner.

And another thing is if I open editor and mouse cursor is on another screen, which doesn't have any panels, window is opened in top left corner of this monitor with window header being outside of accessible screen space. So it's not just a panel.
Comment 5 gudvinr+kde 2022-09-29 18:25:55 UTC
Also I noticed that windows opens without titlebar and it only appears after I move window holding Meta button somewhere else.
Comment 6 Justin Zobel 2022-11-11 07:13:50 UTC
Trying to replicate this but all I get is a maximised Annotation window even if I restore it to "regular" size and try again, it maximises every time.
Operating System: Fedora Linux 37
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Kernel Version: 5.19.16-301.fc37.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
Comment 7 Noah Davis 2022-12-07 11:47:17 UTC
Git commit 9d4ffdf70e5a29fa9105cbf8c4f7e1ddca9e377a by Noah Davis.
Committed on 07/12/2022 at 11:46.
Pushed by ndavis into branch 'master'.

Port and rework UI for Qt Quick/QML

There are still some parts that use Qt Widgets, such as the settings dialog, font dialog, color dialog, print dialog and popup menus. The Qt Quick port is needed for a future patch where screen recording will be added and it also allows more animations to be used. The UI was redesigned, partly because the old UI couldn't be ported nicely to QML and partly to improve the appearance of the UI.

There are 2 window classes for the main UIs. CaptureWindow is used for the rectangle capture mode and ViewerWindow is used for the other modes and viewing accepted regions from the rectangle capture mode. Both UIs support adding annotations.

Fullscreen Capture UI:

The UI is a lot like the old UI, but there are floating toolbars that expose more functionality.

- Annotations, saving, copying and taking a new snapshot can be done directly.
- Export, Options and Help menus can be accessed directly.
- Info box no longer covers or overlaps with selection handles.
- Antialiasing for selection handles is fixed.
- Each screen now has its own fullscreen window, which fixes some issues on Wayland and X11.

Image Viewer UI (appears after a screenshot has been taken):

- Main controls are consolidated into a single top toolbar: Save, Save As, Copy, Export (opens popup menu), Show Annotation Tools, Configure (opens settings dialog), Help (opens popup menu)
- There is a right sidebar for selecting capture modes and related options that were in the old UI.
- The whole UI doesn't completely transform when annotation controls are shown anymore. Instead, a vertical left side toolbar (tools) and a bottom toolbar (tool options) are added and the right sidebar slides away. Undo and Redo are added to the top toolbar.
- It should be easier to understand the annotation UI now.
- Annotations done in the Fullscreen Capture UI can still be undone/redone in the Image Viewer UI.

No screenshot taken UI (appears when configured to start without taking a screenshot):

- Has buttons for each capture mode on the left
- Has all the other options that were in the Image Viewer UI sidebar and the old UI on the right
- Has buttons for opening the settings dialog and showing the help menu below the options.
- The heading can be used to drag the window just to make moving the dialog around a bit more convenient.

The kImageAnnotator library was replaced by a custom annotation system because kImageAnnotator only worked with Qt Widgets and can't work in the rectangle capture mode since it has its own UI.

There is some unused code in this patch that is meant for the upcoming video recording feature.
Related: bug 407843, bug 425311, bug 425853, bug 427117, bug 429141, bug 431278, bug 437495, bug 451838, bug 456399, bug 460689, bug 462521
FIXED-IN: 23.04

---

| Fullscreen Capture UI |
|-----------------------|
| ![Screenshot_20221207_052432](/uploads/0a1a94987c80f831ef8ce65e29258797/Screenshot_20221207_052432.png) |

| Image Viewer UI |
|-----------------|
| ![Screenshot_20221207_052647](/uploads/05b9e19702c030228c21fb816af08ee4/Screenshot_20221207_052647.png) |

| No Screenshot UI |
|-----------------|
| ![Screenshot_20221207_053432](/uploads/9d97d6642d050ad84a14bf39f5a914db/Screenshot_20221207_053432.png) |

| Image Viewer Annotations |
|--------------------------|
| ![Screenshot_20221207_052825](/uploads/a8a7ffb4844fa0556eeeee4a979e85dd/Screenshot_20221207_052825.png) |

| Export Menu |
|-------------|
| ![Screenshot_20220823_141330](/uploads/3117057d424b66ae84f84648030912a8/Screenshot_20220823_141330.png) |

| Options Menu |
|--------------|
| ![Screenshot_20220823_141058](/uploads/05f0589b01ae61a90540d1dd6ba154ae/Screenshot_20220823_141058.png) |

| Help Menu |
|-----------|
| ![Screenshot_20220823_141353](/uploads/2f8173dd31cc0ef5c6c598ae6f5bb088/Screenshot_20220823_141353.png) |

| Annotation Options (sections are hidden based on what the active tool can use) |
|--------------------|
| ![Screenshot_20221207_053046](/uploads/ded7a02e8f68d659377abb5d9dc43b11/Screenshot_20221207_053046.png)![Screenshot_20221207_053136](/uploads/c11b21ce6762a7d287ae3e421762bb10/Screenshot_20221207_053136.png) |

M  +5    -18   CMakeLists.txt
A  +33   -0    resources.qrc
M  +20   -31   src/CMakeLists.txt
A  +139  -0    src/CaptureModeModel.cpp     [License: LGPL(v2.0+)]
A  +60   -0    src/CaptureModeModel.h     [License: LGPL(v2.0+)]
M  +10   -10   src/ExportManager.cpp
M  +6    -5    src/ExportManager.h
A  +38   -0    src/Gui/AnimatedLoader.qml     [License: LGPL(v2.0+)]
A  +287  -0    src/Gui/AnnotationOptionsToolBarContents.qml     [License: LGPL(v2.0+)]
A  +1406 -0    src/Gui/Annotations/AnnotationDocument.cpp     [License: LGPL(v2.0+)]
A  +288  -0    src/Gui/Annotations/AnnotationDocument.h     [License: LGPL(v2.0+)]
A  +43   -0    src/Gui/Annotations/AnnotationEditor.qml     [License: LGPL(v2.0+)]
A  +254  -0    src/Gui/Annotations/AnnotationViewport.cpp     [License: LGPL(v2.0+)]
A  +66   -0    src/Gui/Annotations/AnnotationViewport.h     [License: LGPL(v2.0+)]
A  +919  -0    src/Gui/Annotations/EditAction.cpp     [License: LGPL(v2.0+)]
A  +256  -0    src/Gui/Annotations/EditAction.h     [License: LGPL(v2.0+)]
A  +282  -0    src/Gui/Annotations/ResizeHandles.qml     [License: LGPL(v2.0+)]
A  +45   -0    src/Gui/Annotations/SelectionBackground.qml     [License: LGPL(v2.0+)]
A  +207  -0    src/Gui/Annotations/TextTool.qml     [License: LGPL(v2.0+)]
A  +86   -0    src/Gui/Annotations/Utils.cpp     [License: LGPL(v2.0+)]
A  +13   -0    src/Gui/Annotations/Utils.h     [License: LGPL(v2.0+)]
A  +152  -0    src/Gui/AnnotationsToolBarContents.qml     [License: LGPL(v2.0+)]
A  +101  -0    src/Gui/ButtonGrid.qml     [License: LGPL(v2.0+)]
D  +0    -176  src/Gui/CaptureAreaComboBox.cpp
D  +0    -55   src/Gui/CaptureAreaComboBox.h
A  +133  -0    src/Gui/CaptureOptionsSidebarContents.qml     [License: LGPL(v2.0+)]
A  +236  -0    src/Gui/CaptureWindow.cpp     [License: LGPL(v2.0+)]
A  +58   -0    src/Gui/CaptureWindow.h     [License: LGPL(v2.0+)]
A  +27   -0    src/Gui/CopiedMessage.qml     [License: LGPL(v2.0+)]
A  +138  -0    src/Gui/DelaySpinBox.qml     [License: LGPL(v2.0+)]
A  +232  -0    src/Gui/DialogPage.qml     [License: LGPL(v2.0+)]
A  +23   -0    src/Gui/EmptyPage.qml     [License: LGPL(v2.0+)]
M  +84   -16   src/Gui/ExportMenu.cpp
M  +7    -9    src/Gui/ExportMenu.h
A  +13   -0    src/Gui/FloatingBackground.qml     [License: LGPL(v2.0+)]
A  +40   -0    src/Gui/FloatingToolBar.qml     [License: LGPL(v2.0+)]
A  +72   -0    src/Gui/HelpMenu.cpp     [License: LGPL(v2.0+)]
A  +25   -0    src/Gui/HelpMenu.h     [License: LGPL(v2.0+)]
A  +420  -0    src/Gui/ImageCaptureOverlay.qml     [License: LGPL(v2.0+)]
A  +495  -0    src/Gui/ImageView.qml     [License: LGPL(v2.0+)]
A  +21   -0    src/Gui/InlineMessage.qml     [License: LGPL(v2.0+)]
D  +0    -86   src/Gui/KSImageWidget.cpp
D  +0    -44   src/Gui/KSImageWidget.h
D  +0    -714  src/Gui/KSMainWindow.cpp
D  +0    -116  src/Gui/KSMainWindow.h
D  +0    -363  src/Gui/KSWidget.cpp
D  +0    -105  src/Gui/KSWidget.h
A  +67   -0    src/Gui/Magnifier.qml     [License: LGPL(v2.0+)]
A  +158  -0    src/Gui/MainToolBarContents.qml     [License: LGPL(v2.0+)]
A  +269  -0    src/Gui/OptionsMenu.cpp     [License: LGPL(v2.0+)]
A  +62   -0    src/Gui/OptionsMenu.h     [License: LGPL(v2.0+)]
D  +0    -61   src/Gui/ProgressButton.cpp
D  +0    -29   src/Gui/ProgressButton.h
A  +10   -0    src/Gui/SavedAndCopiedMessage.qml     [License: LGPL(v2.0+)]
A  +10   -0    src/Gui/SavedAndLocationCopied.qml     [License: LGPL(v2.0+)]
A  +31   -0    src/Gui/SavedMessage.qml     [License: LGPL(v2.0+)]
A  +21   -0    src/Gui/ScreenshotFailedMessage.qml     [License: LGPL(v2.0+)]
A  +303  -0    src/Gui/Selection.cpp     [License: LGPL(v2.0+)]
A  +134  -0    src/Gui/Selection.h     [License: LGPL(v2.0+)]
A  +918  -0    src/Gui/SelectionEditor.cpp     [License: LGPL(v2.0+)]
A  +131  -0    src/Gui/SelectionEditor.h     [License: LGPL(v2.0+)]
M  +2    -2    src/Gui/SettingsDialog/GeneralOptions.ui
M  +5    -5    src/Gui/SettingsDialog/SaveOptionsPage.cpp
M  +9    -0    src/Gui/SettingsDialog/SettingsDialog.cpp
M  +1    -0    src/Gui/SettingsDialog/SettingsDialog.h
M  +3    -3    src/Gui/SettingsDialog/settings.kcfgc
M  +108  -22   src/Gui/SettingsDialog/spectacle.kcfg
A  +22   -0    src/Gui/ShareErrorMessage.qml     [License: LGPL(v2.0+)]
A  +29   -0    src/Gui/SharedMessage.qml     [License: LGPL(v2.0+)]
A  +99   -0    src/Gui/ShortcutsTextBox.qml     [License: LGPL(v2.0+)]
A  +29   -0    src/Gui/SizeLabel.qml     [License: LGPL(v2.0+)]
A  +70   -0    src/Gui/SpectacleImageProvider.cpp     [License: LGPL(v2.0+)]
A  +18   -0    src/Gui/SpectacleImageProvider.h     [License: LGPL(v2.0+)]
A  +42   -0    src/Gui/SpectacleMenu.cpp     [License: LGPL(v2.0+)]
A  +32   -0    src/Gui/SpectacleMenu.h     [License: LGPL(v2.0+)]
A  +499  -0    src/Gui/SpectacleWindow.cpp     [License: LGPL(v2.0+)]
A  +121  -0    src/Gui/SpectacleWindow.h     [License: LGPL(v2.0+)]
A  +57   -0    src/Gui/UndoRedoGroup.qml     [License: LGPL(v2.0+)]
A  +204  -0    src/Gui/ViewerWindow.cpp     [License: LGPL(v2.0+)]
A  +65   -0    src/Gui/ViewerWindow.h     [License: LGPL(v2.0+)]
M  +5    -5    src/Main.cpp
M  +14   -9    src/Platforms/Platform.h
M  +38   -13   src/Platforms/PlatformKWinWayland.cpp
M  +5    -0    src/Platforms/PlatformKWinWayland.h
M  +28   -7    src/Platforms/PlatformKWinWayland2.cpp
M  +4    -0    src/Platforms/PlatformKWinWayland2.h
M  +28   -13   src/Platforms/PlatformXcb.cpp
M  +4    -3    src/Platforms/PlatformXcb.h
D  +0    -29   src/QuickEditor/ComparableQPoint.h
D  +0    -1042 src/QuickEditor/QuickEditor.cpp
D  +0    -140  src/QuickEditor/QuickEditor.h
A  +15   -0    src/ScreenImage.h     [License: LGPL(v2.0+)]
D  +0    -20   src/SpectacleCommon.h
M  +541  -303  src/SpectacleCore.cpp
M  +93   -41   src/SpectacleCore.h
M  +5    -6    src/SpectacleDBusAdapter.cpp
M  +3    -1    tests/CMakeLists.txt
M  +5    -5    tests/FilenameTest.cpp

https://invent.kde.org/graphics/spectacle/commit/9d4ffdf70e5a29fa9105cbf8c4f7e1ddca9e377a