Add Rectangular Region mode on wayland [RFC]
AbandonedPublic

Authored by kpiwowarski on Nov 30 2018, 12:59 AM.

Details

Reviewers
broulik
apol
Group Reviewers
Spectacle
KDE Applications
KWin
Summary

Implement Rectangular Region mode on wayland session. Unfortunatelly I don't know how to position window under wayland so it only works ax expected on one screen and without panel :(

BUG: 377157

Diff Detail

Repository
R166 Spectacle
Branch
arcpatch-D12626
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5525
Build 5543: arc lint + arc unit
kpiwowarski created this revision.Nov 30 2018, 12:59 AM
Restricted Application added a project: Spectacle. · View Herald TranscriptNov 30 2018, 12:59 AM
Restricted Application added a subscriber: Spectacle. · View Herald Transcript
kpiwowarski requested review of this revision.Nov 30 2018, 12:59 AM
abalaji added inline comments.
src/PlatformBackends/KWinWaylandImageGrabber.cpp
81

pixmap should be a reference to avoid copying

88

pixmap should be a reference to avoid copying

120

pixmap should be a reference to avoid copying

141

pixmap should be a reference to avoid copying

Looks good! We can probably merge this before my D12626

ngraham edited the summary of this revision. (Show Details)Nov 30 2018, 3:21 AM
ngraham added a reviewer: KWin.

An application cannot position itself on Wayland. What instead should be done is implement a region selector in KWin's screenshot interface that returns a cropped pixmap.
There is currently a window and color picker in KWin but no region selector.

fvogt added a subscriber: fvogt.Nov 30 2018, 2:04 PM

I implemented the same hack here locally some time ago and it works perfectly fine if started with spectacle -platform xcb.

However, you'll always have to click to take the initial screenshot for the selection (but the other modes have the same issue) and with the wayland platform it's not possible to get the positioning correct over multiple monitors.

IMO clipping a rectangular selection should be implemented outside of KWin, which would make implementing stuff like drawing lines and arrows easier.

kpiwowarski abandoned this revision.Oct 19 2019, 11:50 PM