~neon/project-neon/kscreen

« back to all changes in this revision

Viewing changes to kded/output.h

  • Committer: Roman Gilg
  • Date: 2020-01-15 13:57:12 UTC
  • Revision ID: git-v1:8032881459d18c31b00d1023f814d9ed5049532a
feat(kded): add orientation sensor

Summary:
With this patch KScreen controls rotation of internal outputs if an orientation
sensor is present and emitting rotation values.

The default behavior is auto-rotation but can be configured through control
files.

This functionality is developed for the Wayland session but might potentially
also work on X11, what needs to be tested more.

Test Plan: Screen of convertible with orientation sensor rotates.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel, davidedmundson

Tags: #plasma

Maniphest Tasks: T11475

Differential Revision: https://phabricator.kde.org/D26037

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#define KDED_OUTPUT_H
19
19
 
20
20
#include "../common/control.h"
 
21
#include "../common/globals.h"
21
22
 
22
23
#include <kscreen/types.h>
23
24
 
 
25
#include <QOrientationReading>
24
26
#include <QVariantMap>
25
27
 
26
28
class Output
34
36
 
35
37
    static QString dirPath();
36
38
 
 
39
    static bool updateOrientation(KScreen::OutputPtr &output,
 
40
                                  QOrientationReading::Orientation orientation);
 
41
 
37
42
private:
38
43
    static QString globalFileName(const QString &hash);
39
44
    static QVariantMap getGlobalData(KScreen::OutputPtr output);
41
46
    static void readIn(KScreen::OutputPtr output, const QVariantMap &info, Control::OutputRetention retention);
42
47
    static bool readInGlobal(KScreen::OutputPtr output);
43
48
    static void readInGlobalPartFromInfo(KScreen::OutputPtr output, const QVariantMap &info);
44
 
 
45
49
    /*
46
50
     * When a global output value (scale, rotation) is changed we might
47
51
     * need to reposition the outputs when another config is read.