mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2025-11-06 19:14:57 +11:00
wayland/screencopy: apply output transform to wlr screencopy
Note that this only fixes output copies, and not toplevel copies. Toplevel copies are harder because a toplevel can be on more than one output. Hopefully we'll all be using image-copy-capture before this one comes up. Fixes #75
This commit is contained in:
parent
27f97c3283
commit
d949f91347
4 changed files with 103 additions and 8 deletions
|
|
@ -1,7 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <private/qwayland-wayland.h>
|
||||
#include <private/qwaylandscreen_p.h>
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qtclasshelpermacros.h>
|
||||
#include <qtypes.h>
|
||||
#include <qwayland-wlr-screencopy-unstable-v1.h>
|
||||
|
||||
#include "../manager.hpp"
|
||||
|
|
@ -24,6 +27,7 @@ public:
|
|||
Q_DISABLE_COPY_MOVE(WlrScreencopyContext);
|
||||
|
||||
void captureFrame() override;
|
||||
void updateTransform(bool previouslyUnset);
|
||||
|
||||
protected:
|
||||
// clang-format off
|
||||
|
|
@ -39,9 +43,38 @@ private slots:
|
|||
void onScreenDestroyed();
|
||||
|
||||
private:
|
||||
void submitFrame();
|
||||
|
||||
class OutputTransformQuery: public QtWayland::wl_output {
|
||||
public:
|
||||
OutputTransformQuery(WlrScreencopyContext* context);
|
||||
~OutputTransformQuery() override;
|
||||
Q_DISABLE_COPY_MOVE(OutputTransformQuery);
|
||||
|
||||
qint32 transform = -1;
|
||||
void setScreen(QtWaylandClient::QWaylandScreen* screen);
|
||||
|
||||
protected:
|
||||
void output_geometry(
|
||||
qint32 x,
|
||||
qint32 y,
|
||||
qint32 width,
|
||||
qint32 height,
|
||||
qint32 subpixel,
|
||||
const QString& make,
|
||||
const QString& model,
|
||||
qint32 transform
|
||||
) override;
|
||||
|
||||
private:
|
||||
WlrScreencopyContext* context;
|
||||
};
|
||||
|
||||
WlrScreencopyManager* manager;
|
||||
buffer::WlBufferRequest request;
|
||||
bool copiedFirstFrame = false;
|
||||
OutputTransformQuery transform {this};
|
||||
bool yInvert = false;
|
||||
|
||||
QtWaylandClient::QWaylandScreen* screen;
|
||||
bool paintCursors;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue