Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 61 | { | |||
---|---|---|---|---|---|
67 | connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::moveResizedChanged); | 67 | connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::moveResizedChanged); | ||
68 | connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::removeCheckScreenConnection); | 68 | connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::removeCheckScreenConnection); | ||
69 | connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::setupCheckScreenConnection); | 69 | connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::setupCheckScreenConnection); | ||
70 | 70 | | |||
71 | connect(this, &AbstractClient::paletteChanged, this, &AbstractClient::triggerDecorationRepaint); | 71 | connect(this, &AbstractClient::paletteChanged, this, &AbstractClient::triggerDecorationRepaint); | ||
72 | 72 | | |||
73 | connect(Decoration::DecorationBridge::self(), &QObject::destroyed, this, &AbstractClient::destroyDecoration); | 73 | connect(Decoration::DecorationBridge::self(), &QObject::destroyed, this, &AbstractClient::destroyDecoration); | ||
74 | 74 | | |||
75 | // If the user manually moved the window, don't restore it after the keyboard closes | ||||
76 | connect(this, &AbstractClient::clientFinishUserMovedResized, this, [this] () { | ||||
77 | m_keyboardGeometryRestore = QRect(); | ||||
78 | }); | ||||
79 | connect(this, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged), this, [this] () { | ||||
davidedmundson: + clientFullscreen changed? | |||||
80 | m_keyboardGeometryRestore = QRect(); | ||||
81 | }); | ||||
82 | | ||||
75 | // replace on-screen-display on size changes | 83 | // replace on-screen-display on size changes | ||
76 | connect(this, &AbstractClient::geometryShapeChanged, this, | 84 | connect(this, &AbstractClient::geometryShapeChanged, this, | ||
77 | [this] (Toplevel *c, const QRect &old) { | 85 | [this] (Toplevel *c, const QRect &old) { | ||
78 | Q_UNUSED(c) | 86 | Q_UNUSED(c) | ||
79 | if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size() && !isInitialPositionSet()) { | 87 | if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size() && !isInitialPositionSet()) { | ||
80 | GeometryUpdatesBlocker blocker(this); | 88 | GeometryUpdatesBlocker blocker(this); | ||
81 | QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); | 89 | QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); | ||
82 | Placement::self()->place(this, area); | 90 | Placement::self()->place(this, area); | ||
▲ Show 20 Lines • Show All 1783 Lines • ▼ Show 20 Line(s) | |||||
1866 | QRect AbstractClient::inputGeometry() const | 1874 | QRect AbstractClient::inputGeometry() const | ||
1867 | { | 1875 | { | ||
1868 | if (isDecorated()) { | 1876 | if (isDecorated()) { | ||
1869 | return Toplevel::inputGeometry() + decoration()->resizeOnlyBorders(); | 1877 | return Toplevel::inputGeometry() + decoration()->resizeOnlyBorders(); | ||
1870 | } | 1878 | } | ||
1871 | return Toplevel::inputGeometry(); | 1879 | return Toplevel::inputGeometry(); | ||
1872 | } | 1880 | } | ||
1873 | 1881 | | |||
1882 | QRect AbstractClient::virtualKeyboardGeometry() const | ||||
1883 | { | ||||
1884 | return m_virtualKeyboardGeometry; | ||||
1885 | } | ||||
1886 | | ||||
1887 | void AbstractClient::setVirtualKeyboardGeometry(const QRect &geo) | ||||
1888 | { | ||||
1889 | // No keyboard anymore | ||||
1890 | if (geo.isEmpty() && !m_keyboardGeometryRestore.isEmpty()) { | ||||
1891 | setGeometry(m_keyboardGeometryRestore); | ||||
1892 | m_keyboardGeometryRestore = QRect(); | ||||
1893 | } else if (geo.isEmpty()) { | ||||
1894 | return; | ||||
1895 | // The keyboard has just been opened (rather than resized) save client geometry for a restore | ||||
1896 | } else if (m_keyboardGeometryRestore.isEmpty()) { | ||||
1897 | m_keyboardGeometryRestore = geometry(); | ||||
1898 | } | ||||
1899 | | ||||
1900 | m_virtualKeyboardGeometry = geo; | ||||
1901 | | ||||
1902 | if (!geo.intersects(m_keyboardGeometryRestore)) { | ||||
1903 | return; | ||||
1904 | } | ||||
1905 | | ||||
1906 | const QRect availableArea = workspace()->clientArea(MaximizeArea, this); | ||||
1907 | QRect newWindowGeometry = m_keyboardGeometryRestore; | ||||
1908 | | ||||
1909 | newWindowGeometry.moveBottom(geo.top()); | ||||
1910 | newWindowGeometry.setTop(qMax(newWindowGeometry.top(), availableArea.top())); | ||||
1911 | setGeometry(newWindowGeometry); | ||||
1912 | } | ||||
1913 | | ||||
1874 | bool AbstractClient::dockWantsInput() const | 1914 | bool AbstractClient::dockWantsInput() const | ||
1875 | { | 1915 | { | ||
1876 | return false; | 1916 | return false; | ||
1877 | } | 1917 | } | ||
1878 | 1918 | | |||
1879 | void AbstractClient::setDesktopFileName(QByteArray name) | 1919 | void AbstractClient::setDesktopFileName(QByteArray name) | ||
1880 | { | 1920 | { | ||
1881 | name = rules()->checkDesktopFile(name).toUtf8(); | 1921 | name = rules()->checkDesktopFile(name).toUtf8(); | ||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |
+ clientFullscreen changed?