Changeset View
Changeset View
Standalone View
Standalone View
xdgshellclient.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | |||||
90 | XdgShellClient::~XdgShellClient() = default; | 90 | XdgShellClient::~XdgShellClient() = default; | ||
91 | 91 | | |||
92 | void XdgShellClient::init() | 92 | void XdgShellClient::init() | ||
93 | { | 93 | { | ||
94 | connect(this, &XdgShellClient::desktopFileNameChanged, this, &XdgShellClient::updateIcon); | 94 | connect(this, &XdgShellClient::desktopFileNameChanged, this, &XdgShellClient::updateIcon); | ||
95 | createWindowId(); | 95 | createWindowId(); | ||
96 | setupCompositing(); | 96 | setupCompositing(); | ||
97 | updateIcon(); | 97 | updateIcon(); | ||
98 | SurfaceInterface *s = surface(); | | |||
99 | Q_ASSERT(s); | | |||
100 | doSetGeometry(QRect(QPoint(0, 0), m_clientSize)); | 98 | doSetGeometry(QRect(QPoint(0, 0), m_clientSize)); | ||
101 | if (waylandServer()->inputMethodConnection() == s->client()) { | 99 | | ||
100 | if (waylandServer()->inputMethodConnection() == surface()->client()) { | ||||
102 | m_windowType = NET::OnScreenDisplay; | 101 | m_windowType = NET::OnScreenDisplay; | ||
103 | } | 102 | } | ||
104 | 103 | | |||
105 | connect(surface(), &SurfaceInterface::sizeChanged, this, &XdgShellClient::handleSurfaceSizeChanged); | 104 | connect(surface(), &SurfaceInterface::sizeChanged, this, &XdgShellClient::handleSurfaceSizeChanged); | ||
106 | connect(s, &SurfaceInterface::unmapped, this, &XdgShellClient::unmap); | 105 | connect(surface(), &SurfaceInterface::unmapped, this, &XdgShellClient::unmap); | ||
107 | connect(s, &SurfaceInterface::unbound, this, &XdgShellClient::destroyClient); | 106 | connect(surface(), &SurfaceInterface::unbound, this, &XdgShellClient::destroyClient); | ||
108 | connect(s, &SurfaceInterface::destroyed, this, &XdgShellClient::destroyClient); | 107 | connect(surface(), &SurfaceInterface::destroyed, this, &XdgShellClient::destroyClient); | ||
109 | 108 | | |||
110 | if (m_xdgShellSurface) { | 109 | if (m_xdgShellSurface) { | ||
111 | connect(m_xdgShellSurface, &XdgShellSurfaceInterface::destroyed, this, &XdgShellClient::destroyClient); | 110 | connect(m_xdgShellSurface, &XdgShellSurfaceInterface::destroyed, this, &XdgShellClient::destroyClient); | ||
112 | connect(m_xdgShellSurface, &XdgShellSurfaceInterface::configureAcknowledged, this, &XdgShellClient::handleConfigureAcknowledged); | 111 | connect(m_xdgShellSurface, &XdgShellSurfaceInterface::configureAcknowledged, this, &XdgShellClient::handleConfigureAcknowledged); | ||
113 | 112 | | |||
114 | m_caption = m_xdgShellSurface->title().simplified(); | 113 | m_caption = m_xdgShellSurface->title().simplified(); | ||
115 | connect(m_xdgShellSurface, &XdgShellSurfaceInterface::titleChanged, this, &XdgShellClient::handleWindowTitleChanged); | 114 | connect(m_xdgShellSurface, &XdgShellSurfaceInterface::titleChanged, this, &XdgShellClient::handleWindowTitleChanged); | ||
116 | QTimer::singleShot(0, this, &XdgShellClient::updateCaption); | 115 | QTimer::singleShot(0, this, &XdgShellClient::updateCaption); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 157 | } else if (m_xdgShellPopup) { | |||
161 | connect(m_xdgShellPopup, &XdgShellPopupInterface::destroyed, this, &XdgShellClient::destroyClient); | 160 | connect(m_xdgShellPopup, &XdgShellPopupInterface::destroyed, this, &XdgShellClient::destroyClient); | ||
162 | } | 161 | } | ||
163 | 162 | | |||
164 | // set initial desktop | 163 | // set initial desktop | ||
165 | setDesktop(VirtualDesktopManager::self()->current()); | 164 | setDesktop(VirtualDesktopManager::self()->current()); | ||
166 | 165 | | |||
167 | // setup shadow integration | 166 | // setup shadow integration | ||
168 | getShadow(); | 167 | getShadow(); | ||
169 | connect(s, &SurfaceInterface::shadowChanged, this, &Toplevel::getShadow); | 168 | connect(surface(), &SurfaceInterface::shadowChanged, this, &Toplevel::getShadow); | ||
170 | 169 | | |||
171 | connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) { | 170 | connect(waylandServer(), &WaylandServer::foreignTransientChanged, this, [this](KWayland::Server::SurfaceInterface *child) { | ||
172 | if (child == surface()) { | 171 | if (child == surface()) { | ||
173 | handleTransientForChanged(); | 172 | handleTransientForChanged(); | ||
174 | } | 173 | } | ||
175 | }); | 174 | }); | ||
176 | handleTransientForChanged(); | 175 | handleTransientForChanged(); | ||
177 | 176 | | |||
178 | AbstractClient::updateColorScheme(QString()); | 177 | AbstractClient::updateColorScheme(QString()); | ||
179 | } | 178 | } | ||
180 | 179 | | |||
181 | void XdgShellClient::finishInit() { | 180 | void XdgShellClient::finishInit() | ||
182 | SurfaceInterface *s = surface(); | 181 | { | ||
183 | disconnect(s, &SurfaceInterface::committed, this, &XdgShellClient::finishInit); | 182 | disconnect(surface(), &SurfaceInterface::committed, this, &XdgShellClient::finishInit); | ||
184 | 183 | | |||
185 | bool needsPlacement = !isInitialPositionSet(); | 184 | bool needsPlacement = !isInitialPositionSet(); | ||
186 | 185 | | |||
187 | if (supportsWindowRules()) { | 186 | if (supportsWindowRules()) { | ||
188 | setupWindowRules(false); | 187 | setupWindowRules(false); | ||
189 | 188 | | |||
190 | const QRect originalGeometry = QRect(pos(), sizeForClientSize(clientSize())); | 189 | const QRect originalGeometry = QRect(pos(), sizeForClientSize(clientSize())); | ||
191 | const QRect ruledGeometry = rules()->checkGeometry(originalGeometry, true); | 190 | const QRect ruledGeometry = rules()->checkGeometry(originalGeometry, true); | ||
▲ Show 20 Lines • Show All 1748 Lines • Show Last 20 Lines |