Remove Client fullscreen hack
Summary: This hack seems to be deactivated by default nowadays and I did not find an option in the KCMs to activate it. Git blame shows some last commits from around 2012 to the functions, but they only deal with code style. Also even if it would be enabled, in light of Wayland we don't want some roque XWayland client go bonkers via this hack. This patch removes the code path in order to decrease complexity and ease future changes to the fullscreen handling overall. Test Plan: Manually and autotests pass. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, graesslin, kwin Tags: #kwin Maniphest Tasks: T11098 Differential Revision: https://phabricator.kde.org/D18157
This commit is contained in:
parent
4f2a8711a4
commit
b0d1689722
7 changed files with 8 additions and 111 deletions
|
@ -596,18 +596,10 @@ bool Client::userNoBorder() const
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::isFullScreenable() const
|
bool Client::isFullScreenable() const
|
||||||
{
|
|
||||||
return isFullScreenable(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Client::isFullScreenable(bool fullscreenHack) const
|
|
||||||
{
|
{
|
||||||
if (!rules()->checkFullScreen(true)) {
|
if (!rules()->checkFullScreen(true)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (fullscreenHack) {
|
|
||||||
return isNormalWindow();
|
|
||||||
}
|
|
||||||
if (rules()->checkStrictGeometry(true)) {
|
if (rules()->checkStrictGeometry(true)) {
|
||||||
// check geometry constraints (rule to obey is set)
|
// check geometry constraints (rule to obey is set)
|
||||||
const QRect fsarea = workspace()->clientArea(FullScreenArea, this);
|
const QRect fsarea = workspace()->clientArea(FullScreenArea, this);
|
||||||
|
|
13
client.h
13
client.h
|
@ -348,8 +348,6 @@ private:
|
||||||
|
|
||||||
Client* findAutogroupCandidate() const;
|
Client* findAutogroupCandidate() const;
|
||||||
|
|
||||||
bool isFullScreenable(bool fullscreenHack) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void debug(QDebug& stream) const;
|
virtual void debug(QDebug& stream) const;
|
||||||
void addDamage(const QRegion &damage) override;
|
void addDamage(const QRegion &damage) override;
|
||||||
|
@ -410,8 +408,6 @@ private:
|
||||||
void updateAllowedActions(bool force = false);
|
void updateAllowedActions(bool force = false);
|
||||||
QRect fullscreenMonitorsArea(NETFullscreenMonitors topology) const;
|
QRect fullscreenMonitorsArea(NETFullscreenMonitors topology) const;
|
||||||
void changeMaximize(bool horizontal, bool vertical, bool adjust) override;
|
void changeMaximize(bool horizontal, bool vertical, bool adjust) override;
|
||||||
int checkFullScreenHack(const QRect& geom) const; // 0 - None, 1 - One xinerama screen, 2 - Full area
|
|
||||||
void updateFullScreenHack(const QRect& geom);
|
|
||||||
void getWmNormalHints();
|
void getWmNormalHints();
|
||||||
void getMotifHints();
|
void getMotifHints();
|
||||||
void getIcons();
|
void getIcons();
|
||||||
|
@ -514,13 +510,12 @@ private:
|
||||||
uint app_noborder : 1; ///< App requested no border via window type, shape extension, etc.
|
uint app_noborder : 1; ///< App requested no border via window type, shape extension, etc.
|
||||||
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
|
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
|
||||||
bool blocks_compositing;
|
bool blocks_compositing;
|
||||||
// DON'T reorder - Saved to config files !!!
|
|
||||||
enum FullScreenMode {
|
enum FullScreenMode {
|
||||||
FullScreenNone,
|
FullScreenNone,
|
||||||
FullScreenNormal,
|
FullScreenNormal
|
||||||
FullScreenHack ///< Non-NETWM fullscreen (noborder and size of desktop)
|
} m_fullscreenMode;
|
||||||
};
|
|
||||||
FullScreenMode m_fullscreenMode;
|
|
||||||
MaximizeMode max_mode;
|
MaximizeMode max_mode;
|
||||||
QRect geom_restore;
|
QRect geom_restore;
|
||||||
QRect geom_fs_restore;
|
QRect geom_fs_restore;
|
||||||
|
|
50
geometry.cpp
50
geometry.cpp
|
@ -1736,7 +1736,6 @@ void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, in
|
||||||
move(new_pos);
|
move(new_pos);
|
||||||
plainResize(ns);
|
plainResize(ns);
|
||||||
setGeometry(QRect(calculateGravitation(false, gravity), size()));
|
setGeometry(QRect(calculateGravitation(false, gravity), size()));
|
||||||
updateFullScreenHack(QRect(new_pos, QSize(nw, nh)));
|
|
||||||
QRect area = workspace()->clientArea(WorkArea, this);
|
QRect area = workspace()->clientArea(WorkArea, this);
|
||||||
if (!from_tool && (!isSpecialWindow() || isToolbar()) && !isFullScreen()
|
if (!from_tool && (!isSpecialWindow() || isToolbar()) && !isFullScreen()
|
||||||
&& area.contains(origClientGeometry))
|
&& area.contains(origClientGeometry))
|
||||||
|
@ -1764,7 +1763,6 @@ void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, in
|
||||||
QRect origClientGeometry(pos() + clientPos(), clientSize());
|
QRect origClientGeometry(pos() + clientPos(), clientSize());
|
||||||
GeometryUpdatesBlocker blocker(this);
|
GeometryUpdatesBlocker blocker(this);
|
||||||
resizeWithChecks(ns, xcb_gravity_t(gravity));
|
resizeWithChecks(ns, xcb_gravity_t(gravity));
|
||||||
updateFullScreenHack(QRect(calculateGravitation(true, m_geometryHints.windowGravity()), QSize(nw, nh)));
|
|
||||||
if (!from_tool && (!isSpecialWindow() || isToolbar()) && !isFullScreen()) {
|
if (!from_tool && (!isSpecialWindow() || isToolbar()) && !isFullScreen()) {
|
||||||
// try to keep the window in its xinerama screen if possible,
|
// try to keep the window in its xinerama screen if possible,
|
||||||
// if that fails at least keep it visible somewhere
|
// if that fails at least keep it visible somewhere
|
||||||
|
@ -2448,10 +2446,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
|
||||||
|
|
||||||
bool Client::userCanSetFullScreen() const
|
bool Client::userCanSetFullScreen() const
|
||||||
{
|
{
|
||||||
if (m_fullscreenMode == FullScreenHack) {
|
if (!isFullScreenable()) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!isFullScreenable(false)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isNormalWindow() || isDialog();
|
return isNormalWindow() || isDialog();
|
||||||
|
@ -2463,9 +2458,6 @@ void Client::setFullScreen(bool set, bool user)
|
||||||
if (!wasFullscreen && !set) {
|
if (!wasFullscreen && !set) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_fullscreenMode == FullScreenHack) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (user && !userCanSetFullScreen()) {
|
if (user && !userCanSetFullScreen()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2565,46 +2557,6 @@ QRect Client::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) co
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Client::checkFullScreenHack(const QRect& geom) const
|
|
||||||
{
|
|
||||||
if (!options->isLegacyFullscreenSupport())
|
|
||||||
return 0;
|
|
||||||
// if it's noborder window, and has size of one screen or the whole desktop geometry, it's fullscreen hack
|
|
||||||
if (noBorder() && app_noborder && isFullScreenable(true)) {
|
|
||||||
if (geom.size() == workspace()->clientArea(FullArea, geom.center(), desktop()).size())
|
|
||||||
return 2; // full area fullscreen hack
|
|
||||||
if (geom.size() == workspace()->clientArea(ScreenArea, geom.center(), desktop()).size())
|
|
||||||
return 1; // xinerama-aware fullscreen hack
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Client::updateFullScreenHack(const QRect& geom)
|
|
||||||
{
|
|
||||||
int type = checkFullScreenHack(geom);
|
|
||||||
if (m_fullscreenMode == FullScreenNone && type != 0) {
|
|
||||||
m_fullscreenMode = FullScreenHack;
|
|
||||||
updateDecoration(false, false);
|
|
||||||
QRect geom;
|
|
||||||
if (rules()->checkStrictGeometry(false)) {
|
|
||||||
geom = type == 2 // 1 - it's xinerama-aware fullscreen hack, 2 - it's full area
|
|
||||||
? workspace()->clientArea(FullArea, geom.center(), desktop())
|
|
||||||
: workspace()->clientArea(ScreenArea, geom.center(), desktop());
|
|
||||||
} else
|
|
||||||
geom = workspace()->clientArea(FullScreenArea, geom.center(), desktop());
|
|
||||||
setGeometry(geom);
|
|
||||||
emit fullScreenChanged();
|
|
||||||
} else if (m_fullscreenMode == FullScreenHack && type == 0) {
|
|
||||||
m_fullscreenMode = FullScreenNone;
|
|
||||||
updateDecoration(false, false);
|
|
||||||
// whoever called this must setup correct geometry
|
|
||||||
emit fullScreenChanged();
|
|
||||||
}
|
|
||||||
StackingUpdatesBlocker blocker(workspace());
|
|
||||||
workspace()->updateClientLayer(this); // active fullscreens get different layer
|
|
||||||
}
|
|
||||||
|
|
||||||
static GeometryTip* geometryTip = 0;
|
static GeometryTip* geometryTip = 0;
|
||||||
|
|
||||||
void Client::positionGeometryTip()
|
void Client::positionGeometryTip()
|
||||||
|
|
|
@ -108,9 +108,6 @@
|
||||||
<entry name="RollOverDesktops" type="Bool">
|
<entry name="RollOverDesktops" type="Bool">
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
</entry>
|
</entry>
|
||||||
<entry name="LegacyFullscreenSupport" type="Bool">
|
|
||||||
<default>false</default>
|
|
||||||
</entry>
|
|
||||||
<entry name="FocusStealingPreventionLevel" type="Int">
|
<entry name="FocusStealingPreventionLevel" type="Int">
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
<min>0</min>
|
<min>0</min>
|
||||||
|
|
20
manage.cpp
20
manage.cpp
|
@ -280,17 +280,6 @@ bool Client::manage(xcb_window_t w, bool isMapped)
|
||||||
area = workspace()->clientArea(PlacementArea, screens()->geometry(screen).center(), desktop());
|
area = workspace()->clientArea(PlacementArea, screens()->geometry(screen).center(), desktop());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (int type = checkFullScreenHack(geom)) {
|
|
||||||
m_fullscreenMode = FullScreenHack;
|
|
||||||
if (rules()->checkStrictGeometry(false)) {
|
|
||||||
geom = type == 2 // 1 = It's xinerama-aware fullscreen hack, 2 = It's full area
|
|
||||||
? workspace()->clientArea(FullArea, geom.center(), desktop())
|
|
||||||
: workspace()->clientArea(ScreenArea, geom.center(), desktop());
|
|
||||||
} else
|
|
||||||
geom = workspace()->clientArea(FullScreenArea, geom.center(), desktop());
|
|
||||||
placementDone = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDesktop())
|
if (isDesktop())
|
||||||
// KWin doesn't manage desktop windows
|
// KWin doesn't manage desktop windows
|
||||||
placementDone = true;
|
placementDone = true;
|
||||||
|
@ -532,9 +521,7 @@ bool Client::manage(xcb_window_t w, bool isMapped)
|
||||||
if (session->maximized != MaximizeRestore) {
|
if (session->maximized != MaximizeRestore) {
|
||||||
maximize(MaximizeMode(session->maximized));
|
maximize(MaximizeMode(session->maximized));
|
||||||
}
|
}
|
||||||
if (session->fullscreen == FullScreenHack)
|
if (session->fullscreen != FullScreenNone) {
|
||||||
; // Nothing, this should be already set again above
|
|
||||||
else if (session->fullscreen != FullScreenNone) {
|
|
||||||
setFullScreen(true, false);
|
setFullScreen(true, false);
|
||||||
geom_fs_restore = session->fsrestore;
|
geom_fs_restore = session->fsrestore;
|
||||||
}
|
}
|
||||||
|
@ -566,9 +553,8 @@ bool Client::manage(xcb_window_t w, bool isMapped)
|
||||||
demandAttention();
|
demandAttention();
|
||||||
if (info->state() & NET::Modal)
|
if (info->state() & NET::Modal)
|
||||||
setModal(true);
|
setModal(true);
|
||||||
if (m_fullscreenMode != FullScreenHack) {
|
|
||||||
setFullScreen(rules()->checkFullScreen(info->state() & NET::FullScreen, !isMapped), false);
|
setFullScreen(rules()->checkFullScreen(info->state() & NET::FullScreen, !isMapped), false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAllowedActions(true);
|
updateAllowedActions(true);
|
||||||
|
|
11
options.cpp
11
options.cpp
|
@ -104,7 +104,6 @@ Options::Options(QObject *parent)
|
||||||
, m_snapOnlyWhenOverlapping(false)
|
, m_snapOnlyWhenOverlapping(false)
|
||||||
, m_rollOverDesktops(false)
|
, m_rollOverDesktops(false)
|
||||||
, m_focusStealingPreventionLevel(0)
|
, m_focusStealingPreventionLevel(0)
|
||||||
, m_legacyFullscreenSupport(false)
|
|
||||||
, m_killPingTimeout(0)
|
, m_killPingTimeout(0)
|
||||||
, m_hideUtilityWindowsForInactive(false)
|
, m_hideUtilityWindowsForInactive(false)
|
||||||
, m_inactiveTabsSkipTaskbar(false)
|
, m_inactiveTabsSkipTaskbar(false)
|
||||||
|
@ -326,15 +325,6 @@ void Options::setFocusStealingPreventionLevel(int focusStealingPreventionLevel)
|
||||||
emit focusStealingPreventionLevelChanged();
|
emit focusStealingPreventionLevelChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Options::setLegacyFullscreenSupport(bool legacyFullscreenSupport)
|
|
||||||
{
|
|
||||||
if (m_legacyFullscreenSupport == legacyFullscreenSupport) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_legacyFullscreenSupport = legacyFullscreenSupport;
|
|
||||||
emit legacyFullscreenSupportChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Options::setOperationTitlebarDblClick(WindowOperation operationTitlebarDblClick)
|
void Options::setOperationTitlebarDblClick(WindowOperation operationTitlebarDblClick)
|
||||||
{
|
{
|
||||||
if (OpTitlebarDblClick == operationTitlebarDblClick) {
|
if (OpTitlebarDblClick == operationTitlebarDblClick) {
|
||||||
|
@ -847,7 +837,6 @@ void Options::syncFromKcfgc()
|
||||||
setNextFocusPrefersMouse(m_settings->nextFocusPrefersMouse());
|
setNextFocusPrefersMouse(m_settings->nextFocusPrefersMouse());
|
||||||
setSeparateScreenFocus(m_settings->separateScreenFocus());
|
setSeparateScreenFocus(m_settings->separateScreenFocus());
|
||||||
setRollOverDesktops(m_settings->rollOverDesktops());
|
setRollOverDesktops(m_settings->rollOverDesktops());
|
||||||
setLegacyFullscreenSupport(m_settings->legacyFullscreenSupport());
|
|
||||||
setFocusStealingPreventionLevel(m_settings->focusStealingPreventionLevel());
|
setFocusStealingPreventionLevel(m_settings->focusStealingPreventionLevel());
|
||||||
|
|
||||||
#ifdef KWIN_BUILD_DECORATIONS
|
#ifdef KWIN_BUILD_DECORATIONS
|
||||||
|
|
14
options.h
14
options.h
|
@ -111,10 +111,6 @@ class KWIN_EXPORT Options : public QObject
|
||||||
* 0 - 4 , see Workspace::allowClientActivation()
|
* 0 - 4 , see Workspace::allowClientActivation()
|
||||||
**/
|
**/
|
||||||
Q_PROPERTY(int focusStealingPreventionLevel READ focusStealingPreventionLevel WRITE setFocusStealingPreventionLevel NOTIFY focusStealingPreventionLevelChanged)
|
Q_PROPERTY(int focusStealingPreventionLevel READ focusStealingPreventionLevel WRITE setFocusStealingPreventionLevel NOTIFY focusStealingPreventionLevelChanged)
|
||||||
/**
|
|
||||||
* Support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry.
|
|
||||||
**/
|
|
||||||
Q_PROPERTY(bool legacyFullscreenSupport READ isLegacyFullscreenSupport WRITE setLegacyFullscreenSupport NOTIFY legacyFullscreenSupportChanged)
|
|
||||||
Q_PROPERTY(KWin::Options::WindowOperation operationTitlebarDblClick READ operationTitlebarDblClick WRITE setOperationTitlebarDblClick NOTIFY operationTitlebarDblClickChanged)
|
Q_PROPERTY(KWin::Options::WindowOperation operationTitlebarDblClick READ operationTitlebarDblClick WRITE setOperationTitlebarDblClick NOTIFY operationTitlebarDblClickChanged)
|
||||||
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonLeftClick READ operationMaxButtonLeftClick WRITE setOperationMaxButtonLeftClick NOTIFY operationMaxButtonLeftClickChanged)
|
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonLeftClick READ operationMaxButtonLeftClick WRITE setOperationMaxButtonLeftClick NOTIFY operationMaxButtonLeftClickChanged)
|
||||||
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonMiddleClick READ operationMaxButtonMiddleClick WRITE setOperationMaxButtonMiddleClick NOTIFY operationMaxButtonMiddleClickChanged)
|
Q_PROPERTY(KWin::Options::WindowOperation operationMaxButtonMiddleClick READ operationMaxButtonMiddleClick WRITE setOperationMaxButtonMiddleClick NOTIFY operationMaxButtonMiddleClickChanged)
|
||||||
|
@ -342,13 +338,6 @@ public:
|
||||||
return m_focusStealingPreventionLevel;
|
return m_focusStealingPreventionLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry.
|
|
||||||
**/
|
|
||||||
bool isLegacyFullscreenSupport() const {
|
|
||||||
return m_legacyFullscreenSupport;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum WindowOperation {
|
enum WindowOperation {
|
||||||
MaximizeOp = 5000,
|
MaximizeOp = 5000,
|
||||||
RestoreOp,
|
RestoreOp,
|
||||||
|
@ -626,7 +615,6 @@ public:
|
||||||
void setSnapOnlyWhenOverlapping(bool snapOnlyWhenOverlapping);
|
void setSnapOnlyWhenOverlapping(bool snapOnlyWhenOverlapping);
|
||||||
void setRollOverDesktops(bool rollOverDesktops);
|
void setRollOverDesktops(bool rollOverDesktops);
|
||||||
void setFocusStealingPreventionLevel(int focusStealingPreventionLevel);
|
void setFocusStealingPreventionLevel(int focusStealingPreventionLevel);
|
||||||
void setLegacyFullscreenSupport(bool legacyFullscreenSupport);
|
|
||||||
void setOperationTitlebarDblClick(WindowOperation operationTitlebarDblClick);
|
void setOperationTitlebarDblClick(WindowOperation operationTitlebarDblClick);
|
||||||
void setOperationMaxButtonLeftClick(WindowOperation op);
|
void setOperationMaxButtonLeftClick(WindowOperation op);
|
||||||
void setOperationMaxButtonRightClick(WindowOperation op);
|
void setOperationMaxButtonRightClick(WindowOperation op);
|
||||||
|
@ -813,7 +801,6 @@ Q_SIGNALS:
|
||||||
void snapOnlyWhenOverlappingChanged();
|
void snapOnlyWhenOverlappingChanged();
|
||||||
void rollOverDesktopsChanged(bool enabled);
|
void rollOverDesktopsChanged(bool enabled);
|
||||||
void focusStealingPreventionLevelChanged();
|
void focusStealingPreventionLevelChanged();
|
||||||
void legacyFullscreenSupportChanged();
|
|
||||||
void operationTitlebarDblClickChanged();
|
void operationTitlebarDblClickChanged();
|
||||||
void operationMaxButtonLeftClickChanged();
|
void operationMaxButtonLeftClickChanged();
|
||||||
void operationMaxButtonRightClickChanged();
|
void operationMaxButtonRightClickChanged();
|
||||||
|
@ -880,7 +867,6 @@ private:
|
||||||
bool m_snapOnlyWhenOverlapping;
|
bool m_snapOnlyWhenOverlapping;
|
||||||
bool m_rollOverDesktops;
|
bool m_rollOverDesktops;
|
||||||
int m_focusStealingPreventionLevel;
|
int m_focusStealingPreventionLevel;
|
||||||
bool m_legacyFullscreenSupport;
|
|
||||||
int m_killPingTimeout;
|
int m_killPingTimeout;
|
||||||
bool m_hideUtilityWindowsForInactive;
|
bool m_hideUtilityWindowsForInactive;
|
||||||
bool m_inactiveTabsSkipTaskbar;
|
bool m_inactiveTabsSkipTaskbar;
|
||||||
|
|
Loading…
Reference in a new issue