backends/libinput: update screens on Workspace::outputsChanged
Using OutputBackend::outputsQueried can cause problems because it's emitted before output settings like enablement get adjusted to the new output configuration. It also doesn't react to output changes initiated by KScreen and is in the way of plans to use multiple output backends at the same time. BUG: 461901
This commit is contained in:
parent
acb25fbd5e
commit
cdeacdbdad
6 changed files with 19 additions and 1 deletions
|
@ -136,7 +136,6 @@ void Connection::doSetup()
|
|||
deactivate();
|
||||
}
|
||||
});
|
||||
connect(kwinApp()->outputBackend(), &OutputBackend::outputsQueried, this, &Connection::updateScreens);
|
||||
handleEvent();
|
||||
}
|
||||
|
||||
|
|
|
@ -46,4 +46,9 @@ void LibinputBackend::initialize()
|
|||
m_connection->setup();
|
||||
}
|
||||
|
||||
void LibinputBackend::updateScreens()
|
||||
{
|
||||
m_connection->updateScreens();
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
~LibinputBackend() override;
|
||||
|
||||
void initialize() override;
|
||||
void updateScreens() override;
|
||||
|
||||
private:
|
||||
QThread m_thread;
|
||||
|
|
|
@ -31,6 +31,10 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void updateScreens()
|
||||
{
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void deviceAdded(InputDevice *device);
|
||||
void deviceRemoved(InputDevice *device);
|
||||
|
|
|
@ -2588,6 +2588,7 @@ void InputRedirection::init()
|
|||
|
||||
void InputRedirection::setupWorkspace()
|
||||
{
|
||||
connect(workspace(), &Workspace::outputsChanged, this, &InputRedirection::updateScreens);
|
||||
if (waylandServer()) {
|
||||
m_keyboard->init();
|
||||
m_pointer->init();
|
||||
|
@ -2602,6 +2603,13 @@ void InputRedirection::setupWorkspace()
|
|||
}
|
||||
}
|
||||
|
||||
void InputRedirection::updateScreens()
|
||||
{
|
||||
for (const auto &backend : m_inputBackends) {
|
||||
backend->updateScreens();
|
||||
}
|
||||
}
|
||||
|
||||
QObject *InputRedirection::lastInputHandler() const
|
||||
{
|
||||
return m_lastInputDevice;
|
||||
|
|
|
@ -302,6 +302,7 @@ public Q_SLOTS:
|
|||
|
||||
private Q_SLOTS:
|
||||
void handleInputConfigChanged(const KConfigGroup &group);
|
||||
void updateScreens();
|
||||
|
||||
private:
|
||||
void setupInputBackends();
|
||||
|
|
Loading…
Reference in a new issue