Merge Window::userCanSetFullscreen() with Window::isFullscreenable()

master
Vlad Zahorodnii 2 years ago
parent 346d4413a1
commit d25574e7c6

@ -438,7 +438,7 @@ void TestXdgShellWindow::testUserCanSetFullscreen()
QVERIFY(window);
QVERIFY(window->isActive());
QVERIFY(!window->isFullScreen());
QVERIFY(window->userCanSetFullScreen());
QVERIFY(window->isFullScreenable());
}
void TestXdgShellWindow::testSendFullScreenWindowToAnotherOutput()

@ -336,7 +336,7 @@ void UserActionsMenu::menuAboutToShow()
m_shadeOperation->setChecked(m_window->shadeMode() != ShadeNone);
m_keepAboveOperation->setChecked(m_window->keepAbove());
m_keepBelowOperation->setChecked(m_window->keepBelow());
m_fullScreenOperation->setEnabled(m_window->userCanSetFullScreen());
m_fullScreenOperation->setEnabled(m_window->isFullScreenable());
m_fullScreenOperation->setChecked(m_window->isFullScreen());
m_noBorderOperation->setEnabled(m_window->userCanSetNoBorder());
m_noBorderOperation->setChecked(m_window->noBorder());
@ -750,7 +750,7 @@ void UserActionsMenu::slotWindowOperation(QAction *action)
QString type;
switch (op) {
case Options::FullScreenOp:
if (!c->isFullScreen() && c->userCanSetFullScreen()) {
if (!c->isFullScreen() && c->isFullScreenable()) {
type = QStringLiteral("fullscreenaltf3");
}
break;

@ -3934,16 +3934,6 @@ bool Window::isRequestedFullScreen() const
return isFullScreen();
}
/**
* Returns whether requests initiated by the user to enter or leave full screen mode are honored.
*
* Default implementation returns @c false.
*/
bool Window::userCanSetFullScreen() const
{
return false;
}
/**
* Asks the Window to enter or leave full screen mode.
*

@ -995,7 +995,6 @@ public:
virtual bool isFullScreenable() const;
virtual bool isFullScreen() const;
virtual bool isRequestedFullScreen() const;
virtual bool userCanSetFullScreen() const;
virtual void setFullScreen(bool set);
QRectF geometryRestore() const;

@ -1475,7 +1475,7 @@ bool X11Window::isFullScreenable() const
}
}
// don't check size constrains - some apps request fullscreen despite requesting fixed size
return !isSpecialWindow(); // also better disallow only weird types to go fullscreen
return isNormalWindow() || isDialog(); // also better disallow only weird types to go fullscreen
}
bool X11Window::noBorder() const
@ -2615,7 +2615,7 @@ void X11Window::updateAllowedActions(bool force)
if (isMaximizable()) {
allowed_actions |= NET::ActionMax;
}
if (userCanSetFullScreen()) {
if (isFullScreenable()) {
allowed_actions |= NET::ActionFullScreen;
}
allowed_actions |= NET::ActionChangeDesktop; // Always (Pagers shouldn't show Docks etc.)
@ -4651,17 +4651,6 @@ void X11Window::maximize(MaximizeMode mode)
}
}
bool X11Window::userCanSetFullScreen() const
{
if (isUnmanaged()) {
return false;
}
if (!isFullScreenable()) {
return false;
}
return isNormalWindow() || isDialog();
}
void X11Window::setFullScreen(bool set)
{
set = rules()->checkFullScreen(set);
@ -4670,7 +4659,7 @@ void X11Window::setFullScreen(bool set)
if (wasFullscreen == set) {
return;
}
if (!userCanSetFullScreen()) {
if (!isFullScreenable()) {
return;
}

@ -154,7 +154,6 @@ public:
bool isFullScreenable() const override;
void setFullScreen(bool set) override;
bool isFullScreen() const override;
bool userCanSetFullScreen() const override;
int fullScreenMode() const
{
return m_fullscreenMode; // only for session saving

@ -606,11 +606,6 @@ bool XdgToplevelWindow::isTransient() const
return m_isTransient;
}
bool XdgToplevelWindow::userCanSetFullScreen() const
{
return true;
}
bool XdgToplevelWindow::userCanSetNoBorder() const
{
return (m_serverDecoration || m_xdgDecoration) && !isFullScreen() && !isShade();
@ -1432,14 +1427,12 @@ void XdgToplevelWindow::installPalette(ServerSideDecorationPaletteInterface *pal
void XdgToplevelWindow::setFullScreen(bool set)
{
set = rules()->checkFullScreen(set);
if (m_isRequestedFullScreen == set) {
if (!isFullScreenable()) {
return;
}
if (isSpecialWindow()) {
return;
}
if (!userCanSetFullScreen()) {
set = rules()->checkFullScreen(set);
if (m_isRequestedFullScreen == set) {
return;
}

@ -143,7 +143,6 @@ public:
bool isMinimizable() const override;
bool isPlaceable() const override;
bool isTransient() const override;
bool userCanSetFullScreen() const override;
bool userCanSetNoBorder() const override;
bool noBorder() const override;
void setNoBorder(bool set) override;

Loading…
Cancel
Save