Changeset View
Changeset View
Standalone View
Standalone View
client.cpp
Show First 20 Lines • Show All 2060 Lines • ▼ Show 20 Line(s) | 2060 | case 2: | |||
---|---|---|---|---|---|
2061 | border = ElectricBottom; | 2061 | border = ElectricBottom; | ||
2062 | break; | 2062 | break; | ||
2063 | case 3: | 2063 | case 3: | ||
2064 | border = ElectricLeft; | 2064 | border = ElectricLeft; | ||
2065 | break; | 2065 | break; | ||
2066 | } | 2066 | } | ||
2067 | if (border != ElectricNone) { | 2067 | if (border != ElectricNone) { | ||
2068 | disconnect(m_edgeRemoveConnection); | 2068 | disconnect(m_edgeRemoveConnection); | ||
2069 | disconnect(m_edgeGeometryTrackingConnection); | ||||
2069 | bool successfullyHidden = false; | 2070 | bool successfullyHidden = false; | ||
2070 | 2071 | | |||
2071 | if (((value >> 8) & 0xFF) == 1) { | 2072 | if (((value >> 8) & 0xFF) == 1) { | ||
2072 | setKeepBelow(true); | 2073 | setKeepBelow(true); | ||
2073 | successfullyHidden = keepBelow(); //request could have failed due to user kwin rules | 2074 | successfullyHidden = keepBelow(); //request could have failed due to user kwin rules | ||
2074 | 2075 | | |||
2075 | m_edgeRemoveConnection = connect(this, &AbstractClient::keepBelowChanged, this, [this](){ | 2076 | m_edgeRemoveConnection = connect(this, &AbstractClient::keepBelowChanged, this, [this](){ | ||
2076 | if (!keepBelow()) { | 2077 | if (!keepBelow()) { | ||
2077 | ScreenEdges::self()->reserve(this, ElectricNone); | 2078 | ScreenEdges::self()->reserve(this, ElectricNone); | ||
2078 | } | 2079 | } | ||
2079 | }); | 2080 | }); | ||
2080 | } else { | 2081 | } else { | ||
2081 | hideClient(true); | 2082 | hideClient(true); | ||
2082 | successfullyHidden = isHiddenInternal(); | 2083 | successfullyHidden = isHiddenInternal(); | ||
2083 | 2084 | | |||
2084 | m_edgeRemoveConnection = connect(this, &Client::geometryChanged, this, [this](){ | 2085 | m_edgeGeometryTrackingConnection = connect(this, &Client::geometryChanged, this, [this, border](){ | ||
2085 | ScreenEdges::self()->reserve(this, ElectricNone); | 2086 | hideClient(true); | ||
luebking: and if the geometry changes while it's (intentionally) not hidden? | |||||
i added a disconnect when it's back to electricnone, that should fix it? mart: i added a disconnect when it's back to electricnone, that should fix it? | |||||
2087 | ScreenEdges::self()->reserve(this, border); | ||||
2086 | }); | 2088 | }); | ||
2087 | } | 2089 | } | ||
2088 | 2090 | | |||
2089 | if (successfullyHidden) { | 2091 | if (successfullyHidden) { | ||
2090 | ScreenEdges::self()->reserve(this, border); | 2092 | ScreenEdges::self()->reserve(this, border); | ||
2091 | } else { | 2093 | } else { | ||
2092 | ScreenEdges::self()->reserve(this, ElectricNone); | 2094 | ScreenEdges::self()->reserve(this, ElectricNone); | ||
2093 | } | 2095 | } | ||
2094 | } else if (!property.isNull() && property->type != XCB_ATOM_NONE) { | 2096 | } else if (!property.isNull() && property->type != XCB_ATOM_NONE) { | ||
2095 | // property value is incorrect, delete the property | 2097 | // property value is incorrect, delete the property | ||
2096 | // so that the client knows that it is not hidden | 2098 | // so that the client knows that it is not hidden | ||
2097 | xcb_delete_property(connection(), window(), atoms->kde_screen_edge_show); | 2099 | xcb_delete_property(connection(), window(), atoms->kde_screen_edge_show); | ||
2098 | } else { | 2100 | } else { | ||
2099 | // restore | 2101 | // restore | ||
2100 | // TODO: add proper unreserve | 2102 | // TODO: add proper unreserve | ||
2101 | 2103 | | |||
2102 | //this will call showOnScreenEdge to reset the state | 2104 | //this will call showOnScreenEdge to reset the state | ||
2105 | disconnect(m_edgeGeometryTrackingConnection); | ||||
2103 | ScreenEdges::self()->reserve(this, ElectricNone); | 2106 | ScreenEdges::self()->reserve(this, ElectricNone); | ||
2104 | } | 2107 | } | ||
2105 | } | 2108 | } | ||
2106 | 2109 | | |||
2107 | void Client::updateShowOnScreenEdge() | 2110 | void Client::updateShowOnScreenEdge() | ||
2108 | { | 2111 | { | ||
2109 | Xcb::Property property = fetchShowOnScreenEdge(); | 2112 | Xcb::Property property = fetchShowOnScreenEdge(); | ||
2110 | readShowOnScreenEdge(property); | 2113 | readShowOnScreenEdge(property); | ||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
and if the geometry changes while it's (intentionally) not hidden?