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 | connect(this, &AbstractClient::fullScreenChanged, this, [this] () { | ||||
83 | m_keyboardGeometryRestore = QRect(); | ||||
84 | }); | ||||
85 | | ||||
75 | // replace on-screen-display on size changes | 86 | // replace on-screen-display on size changes | ||
76 | connect(this, &AbstractClient::geometryShapeChanged, this, | 87 | connect(this, &AbstractClient::geometryShapeChanged, this, | ||
77 | [this] (Toplevel *c, const QRect &old) { | 88 | [this] (Toplevel *c, const QRect &old) { | ||
78 | Q_UNUSED(c) | 89 | Q_UNUSED(c) | ||
79 | if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size() && !isInitialPositionSet()) { | 90 | if (isOnScreenDisplay() && !geometry().isEmpty() && old.size() != geometry().size() && !isInitialPositionSet()) { | ||
80 | GeometryUpdatesBlocker blocker(this); | 91 | GeometryUpdatesBlocker blocker(this); | ||
81 | QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); | 92 | QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); | ||
82 | Placement::self()->place(this, area); | 93 | Placement::self()->place(this, area); | ||
▲ Show 20 Lines • Show All 1783 Lines • ▼ Show 20 Line(s) | |||||
1866 | QRect AbstractClient::inputGeometry() const | 1877 | QRect AbstractClient::inputGeometry() const | ||
1867 | { | 1878 | { | ||
1868 | if (isDecorated()) { | 1879 | if (isDecorated()) { | ||
1869 | return Toplevel::inputGeometry() + decoration()->resizeOnlyBorders(); | 1880 | return Toplevel::inputGeometry() + decoration()->resizeOnlyBorders(); | ||
1870 | } | 1881 | } | ||
1871 | return Toplevel::inputGeometry(); | 1882 | return Toplevel::inputGeometry(); | ||
1872 | } | 1883 | } | ||
1873 | 1884 | | |||
1885 | QRect AbstractClient::virtualKeyboardGeometry() const | ||||
1886 | { | ||||
1887 | return m_virtualKeyboardGeometry; | ||||
1888 | } | ||||
1889 | | ||||
1890 | void AbstractClient::setVirtualKeyboardGeometry(const QRect &geo) | ||||
1891 | { | ||||
1892 | // No keyboard anymore | ||||
1893 | if (geo.isEmpty() && !m_keyboardGeometryRestore.isEmpty()) { | ||||
1894 | setGeometry(m_keyboardGeometryRestore); | ||||
1895 | m_keyboardGeometryRestore = QRect(); | ||||
1896 | } else if (geo.isEmpty()) { | ||||
1897 | return; | ||||
1898 | // The keyboard has just been opened (rather than resized) save client geometry for a restore | ||||
1899 | } else if (m_keyboardGeometryRestore.isEmpty()) { | ||||
1900 | m_keyboardGeometryRestore = geometry(); | ||||
1901 | } | ||||
1902 | | ||||
1903 | m_virtualKeyboardGeometry = geo; | ||||
1904 | | ||||
1905 | if (!geo.intersects(m_keyboardGeometryRestore)) { | ||||
1906 | return; | ||||
1907 | } | ||||
1908 | | ||||
1909 | const QRect availableArea = workspace()->clientArea(MaximizeArea, this); | ||||
1910 | QRect newWindowGeometry = m_keyboardGeometryRestore; | ||||
1911 | newWindowGeometry.moveBottom(geo.top()); | ||||
1912 | newWindowGeometry.setTop(qMax(newWindowGeometry.top(), availableArea.top())); | ||||
1913 | | ||||
1914 | setGeometry(newWindowGeometry); | ||||
1915 | } | ||||
1916 | | ||||
1874 | bool AbstractClient::dockWantsInput() const | 1917 | bool AbstractClient::dockWantsInput() const | ||
1875 | { | 1918 | { | ||
1876 | return false; | 1919 | return false; | ||
1877 | } | 1920 | } | ||
1878 | 1921 | | |||
1879 | void AbstractClient::setDesktopFileName(QByteArray name) | 1922 | void AbstractClient::setDesktopFileName(QByteArray name) | ||
1880 | { | 1923 | { | ||
1881 | name = rules()->checkDesktopFile(name).toUtf8(); | 1924 | name = rules()->checkDesktopFile(name).toUtf8(); | ||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |
+ clientFullscreen changed?