Inform Screens about size change

Summary:
Changes to a Wayland output that could affect the overall geometry
need to be communicated to the Screens class.

Test Plan: Compiles, runtime tested with other patches for rotation.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25900
This commit is contained in:
Roman Gilg 2020-01-02 14:55:03 +00:00 committed by David Edmundson
parent 9c398de683
commit f246768468

View file

@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#include "abstract_wayland_output.h" #include "abstract_wayland_output.h"
#include "screens.h"
#include "wayland_server.h" #include "wayland_server.h"
// KWayland // KWayland
@ -167,6 +169,7 @@ void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet
{ {
qCDebug(KWIN_CORE) << "Apply changes to the Wayland output."; qCDebug(KWIN_CORE) << "Apply changes to the Wayland output.";
bool emitModeChanged = false; bool emitModeChanged = false;
bool overallSizeCheckNeeded = false;
// Enablement changes are handled by platform. // Enablement changes are handled by platform.
if (changeSet->modeChanged()) { if (changeSet->modeChanged()) {
@ -185,6 +188,7 @@ void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet
qCDebug(KWIN_CORE) << "Server setting position: " << changeSet->position(); qCDebug(KWIN_CORE) << "Server setting position: " << changeSet->position();
setGlobalPos(changeSet->position()); setGlobalPos(changeSet->position());
// may just work already! // may just work already!
overallSizeCheckNeeded = true;
} }
if (changeSet->scaleChanged()) { if (changeSet->scaleChanged()) {
qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale(); qCDebug(KWIN_CORE) << "Setting scale:" << changeSet->scale();
@ -192,6 +196,11 @@ void AbstractWaylandOutput::applyChanges(const KWayland::Server::OutputChangeSet
emitModeChanged = true; emitModeChanged = true;
} }
overallSizeCheckNeeded |= emitModeChanged;
if (overallSizeCheckNeeded) {
emit screens()->changed();
}
if (emitModeChanged) { if (emitModeChanged) {
emit modeChanged(); emit modeChanged();
} }