Commit b7130442 authored by Nicolas Fella's avatar Nicolas Fella

[kcm/effects] Clip ListView

Summary:
Otherwise the content overflows the frame when scrolling.

QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true"

Test Plan:
Before:
{F8121150}

After:
{F8121152}

Reviewers: #kwin, #plasma, ngraham

Reviewed By: ngraham

Subscribers: ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27558
parent cdc5ea19
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(KWIN)
set(PROJECT_VERSION "5.18.1")
project(KWin)
set(PROJECT_VERSION "5.18.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.12.0")
......@@ -70,7 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
I18n
IconThemes
IdleTime
Init
Notifications
Package
Plasma
......@@ -312,7 +311,6 @@ cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kacti
set(KWIN_NAME "kwin")
set(KWIN_INTERNAL_NAME_X11 "kwin_x11")
set(KWIN_INTERNAL_NAME_WAYLAND "kwin_wayland")
set(KWIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# KWIN_HAVE_XRENDER_COMPOSITING - whether XRender-based compositing support is available: may be disabled
if (KWIN_BUILD_XRENDER_COMPOSITING)
......@@ -392,7 +390,7 @@ add_subdirectory(helpers)
########### next target ###############
set(kwin_KDEINIT_SRCS
set(kwin_SRCS
abstract_client.cpp
abstract_opengl_context_attribute_builder.cpp
abstract_output.cpp
......@@ -504,14 +502,14 @@ set(kwin_KDEINIT_SRCS
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(kwin_KDEINIT_SRCS
${kwin_KDEINIT_SRCS}
set(kwin_SRCS
${kwin_SRCS}
colorcorrection/clockskewnotifierengine_linux.cpp
)
endif()
include(ECMQtDeclareLoggingCategory)
ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS
ecm_qt_declare_logging_category(kwin_SRCS
HEADER
colorcorrect_logging.h
IDENTIFIER
......@@ -524,7 +522,7 @@ ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS
if (KWIN_BUILD_TABBOX)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
set(kwin_SRCS ${kwin_SRCS}
tabbox/clientmodel.cpp
tabbox/desktopchain.cpp
tabbox/desktopmodel.cpp
......@@ -538,33 +536,33 @@ if (KWIN_BUILD_TABBOX)
endif()
if (KWIN_BUILD_ACTIVITIES)
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
set(kwin_SRCS ${kwin_SRCS}
activities.cpp
)
endif()
if (HAVE_LINUX_VT_H)
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
set(kwin_SRCS ${kwin_SRCS}
virtual_terminal.cpp
)
endif()
kconfig_add_kcfg_files(kwin_KDEINIT_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_KDEINIT_SRCS colorcorrection/colorcorrect_settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS colorcorrection/colorcorrect_settings.kcfgc)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.OrientationSensor.xml orientation_sensor.h KWin::OrientationSensor)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.OrientationSensor.xml orientation_sensor.h KWin::OrientationSensor)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
qt5_add_dbus_interface(kwin_KDEINIT_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface)
qt5_add_dbus_interface(kwin_KDEINIT_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface)
qt5_add_dbus_interface(kwin_KDEINIT_SRCS org.kde.kappmenu.xml appmenu_interface)
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface)
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface)
qt5_add_dbus_interface(kwin_SRCS org.kde.kappmenu.xml appmenu_interface)
ki18n_wrap_ui(kwin_KDEINIT_SRCS
ki18n_wrap_ui(kwin_SRCS
debug_console.ui
shortcutdialog.ui
)
......@@ -647,7 +645,7 @@ set(kwinLibs
Libinput::Libinput
)
add_library(kwin SHARED ${kwin_KDEINIT_SRCS})
add_library(kwin SHARED ${kwin_SRCS})
set_target_properties(kwin PROPERTIES
VERSION ${PROJECT_VERSION}
......@@ -659,11 +657,10 @@ generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
target_link_libraries(kwin kwinglutils ${epoxy_LIBRARY})
kf5_add_kdeinit_executable(kwin_x11 main_x11.cpp)
target_link_libraries(kdeinit_kwin_x11 kwin KF5::Crash Qt5::X11Extras)
add_executable(kwin_x11 main_x11.cpp)
target_link_libraries(kwin_x11 kwin KF5::Crash Qt5::X11Extras)
install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS kdeinit_kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS})
set(kwin_XWAYLAND_SRCS
......
......@@ -91,5 +91,8 @@ KWin uses [KDE's phabricator instance](https://phabricator.kde.org) for code rev
More complete documentation can be found in [KDE's wiki](https://community.kde.org/Infrastructure/Phabricator). Please add "#KWin" as reviewers. Please run KWin's automated test suite prior to uploading a patch to ensure that the change does not break existing code.
# Coding conventions
KWin's coding conventions are explained in document [coding-conventions.md](doc/coding-conventions.md).
# Coding style
KWin code follows the [Frameworks coding style](https://techbase.kde.org/Policies/Frameworks_Coding_Style).
......@@ -64,10 +64,6 @@ AbstractClient::AbstractClient()
#endif
, m_colorScheme(QStringLiteral("kdeglobals"))
{
connect(this, &AbstractClient::geometryShapeChanged, this, &AbstractClient::geometryChanged);
auto signalMaximizeChanged = static_cast<void (AbstractClient::*)(KWin::AbstractClient*, MaximizeMode)>(&AbstractClient::clientMaximizedStateChanged);
connect(this, signalMaximizeChanged, this, &AbstractClient::geometryChanged);
connect(this, &AbstractClient::clientStepUserMovedResized, this, &AbstractClient::geometryChanged);
connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::moveResizedChanged);
connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::moveResizedChanged);
connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::removeCheckScreenConnection);
......@@ -89,7 +85,7 @@ AbstractClient::AbstractClient()
});
// replace on-screen-display on size changes
connect(this, &AbstractClient::geometryShapeChanged, this,
connect(this, &AbstractClient::frameGeometryChanged, this,
[this] (Toplevel *c, const QRect &old) {
Q_UNUSED(c)
if (isOnScreenDisplay() && !frameGeometry().isEmpty() && old.size() != frameGeometry().size() && !isInitialPositionSet()) {
......@@ -135,11 +131,6 @@ void AbstractClient::setClientShown(bool shown)
Q_UNUSED(shown)
}
MaximizeMode AbstractClient::requestedMaximizeMode() const
{
return maximizeMode();
}
xcb_timestamp_t AbstractClient::userTime() const
{
return XCB_TIME_CURRENT_TIME;
......@@ -326,19 +317,13 @@ void AbstractClient::setKeepAbove(bool b)
if (b && !rules()->checkKeepBelow(false))
setKeepBelow(false);
if (b == keepAbove()) {
// force hint change if different
if (info && bool(info->state() & NET::KeepAbove) != keepAbove())
info->setState(keepAbove() ? NET::KeepAbove : NET::States(), NET::KeepAbove);
return;
}
m_keepAbove = b;
if (info) {
info->setState(keepAbove() ? NET::KeepAbove : NET::States(), NET::KeepAbove);
}
doSetKeepAbove();
workspace()->updateClientLayer(this);
updateWindowRules(Rules::Above);
doSetKeepAbove();
emit keepAboveChanged(m_keepAbove);
}
......@@ -352,19 +337,13 @@ void AbstractClient::setKeepBelow(bool b)
if (b && !rules()->checkKeepAbove(false))
setKeepAbove(false);
if (b == keepBelow()) {
// force hint change if different
if (info && bool(info->state() & NET::KeepBelow) != keepBelow())
info->setState(keepBelow() ? NET::KeepBelow : NET::States(), NET::KeepBelow);
return;
}
m_keepBelow = b;
if (info) {
info->setState(keepBelow() ? NET::KeepBelow : NET::States(), NET::KeepBelow);
}
doSetKeepBelow();
workspace()->updateClientLayer(this);
updateWindowRules(Rules::Below);
doSetKeepBelow();
emit keepBelowChanged(m_keepBelow);
}
......@@ -411,13 +390,15 @@ void AbstractClient::demandAttention(bool set)
if (m_demandsAttention == set)
return;
m_demandsAttention = set;
if (info) {
info->setState(set ? NET::DemandsAttention : NET::States(), NET::DemandsAttention);
}
doSetDemandsAttention();
workspace()->clientAttentionChanged(this, set);
emit demandsAttentionChanged();
}
void AbstractClient::doSetDemandsAttention()
{
}
void AbstractClient::setDesktop(int desktop)
{
const int numberOfDesktops = VirtualDesktopManager::self()->count();
......@@ -489,7 +470,7 @@ void AbstractClient::setDesktops(QVector<VirtualDesktop*> desktops)
c2->setDesktops(desktops);
}
doSetDesktop(desktop(), was_desk);
doSetDesktop();
FocusChain::self()->update(this, FocusChain::MakeFirst);
updateWindowRules(Rules::Desktop);
......@@ -500,10 +481,8 @@ void AbstractClient::setDesktops(QVector<VirtualDesktop*> desktops)
emit x11DesktopIdsChanged();
}
void AbstractClient::doSetDesktop(int desktop, int was_desk)
void AbstractClient::doSetDesktop()
{
Q_UNUSED(desktop)
Q_UNUSED(was_desk)
}
void AbstractClient::enterDesktop(VirtualDesktop *virtualDesktop)
......@@ -619,11 +598,7 @@ void AbstractClient::minimize(bool avoid_animation)
if (!isMinimizable() || isMinimized())
return;
if (isShade() && info) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded
info->setState(NET::States(), NET::Shaded);
m_minimized = true;
doMinimize();
updateWindowRules(Rules::Minimize);
......@@ -643,11 +618,7 @@ void AbstractClient::unminimize(bool avoid_animation)
return;
}
if (isShade() && info) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded
info->setState(NET::Shaded, NET::Shaded);
m_minimized = false;
doMinimize();
updateWindowRules(Rules::Minimize);
......@@ -822,9 +793,9 @@ void AbstractClient::move(int x, int y, ForceGeometry_t force)
screens()->setCurrent(this);
workspace()->updateStackingOrder();
// client itself is not damaged
emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking());
addRepaintDuringGeometryUpdates();
updateGeometryBeforeUpdateBlocking();
emit geometryChanged();
}
bool AbstractClient::startMoveResize()
......@@ -1081,8 +1052,8 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
bool update = false;
if (isResize()) {
QRect orig = initialMoveResizeGeometry();
Sizemode sizemode = SizemodeAny;
auto calculateMoveResizeGeom = [this, &topleft, &bottomright, &orig, &sizemode, &mode]() {
SizeMode sizeMode = SizeModeAny;
auto calculateMoveResizeGeom = [this, &topleft, &bottomright, &orig, &sizeMode, &mode]() {
switch(mode) {
case PositionTopLeft:
setMoveResizeGeometry(QRect(topleft, orig.bottomRight()));
......@@ -1098,19 +1069,19 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
break;
case PositionTop:
setMoveResizeGeometry(QRect(QPoint(orig.left(), topleft.y()), orig.bottomRight()));
sizemode = SizemodeFixedH; // try not to affect height
sizeMode = SizeModeFixedH; // try not to affect height
break;
case PositionBottom:
setMoveResizeGeometry(QRect(orig.topLeft(), QPoint(orig.right(), bottomright.y())));
sizemode = SizemodeFixedH;
sizeMode = SizeModeFixedH;
break;
case PositionLeft:
setMoveResizeGeometry(QRect(QPoint(topleft.x(), orig.top()), orig.bottomRight()));
sizemode = SizemodeFixedW;
sizeMode = SizeModeFixedW;
break;
case PositionRight:
setMoveResizeGeometry(QRect(orig.topLeft(), QPoint(bottomright.x(), orig.bottom())));
sizemode = SizemodeFixedW;
sizeMode = SizeModeFixedW;
break;
case PositionCenter:
default:
......@@ -1211,7 +1182,7 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
}
// Always obey size hints, even when in "unrestricted" mode
QSize size = adjustedSize(moveResizeGeometry().size(), sizemode);
QSize size = adjustedSize(moveResizeGeometry().size(), sizeMode);
// the new topleft and bottomright corners (after checking size constrains), if they'll be needed
topleft = QPoint(moveResizeGeometry().right() - size.width() + 1, moveResizeGeometry().bottom() - size.height() + 1);
bottomright = QPoint(moveResizeGeometry().left() + size.width() - 1, moveResizeGeometry().top() + size.height() - 1);
......@@ -1220,9 +1191,9 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
// if aspect ratios are specified, both dimensions may change.
// Therefore grow to the right/bottom if needed.
// TODO it should probably obey gravity rather than always using right/bottom ?
if (sizemode == SizemodeFixedH)
if (sizeMode == SizeModeFixedH)
orig.setRight(bottomright.x());
else if (sizemode == SizemodeFixedW)
else if (sizeMode == SizeModeFixedW)
orig.setBottom(bottomright.y());
calculateMoveResizeGeom();
......@@ -1238,7 +1209,7 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
setMoveResizeGeometry(workspace()->clientArea(FullScreenArea, screen, 0));
else {
QRect moveResizeGeom = workspace()->clientArea(MaximizeArea, screen, 0);
QSize adjSize = adjustedSize(moveResizeGeom.size(), SizemodeMax);
QSize adjSize = adjustedSize(moveResizeGeom.size(), SizeModeMax);
if (adjSize != moveResizeGeom.size()) {
QRect r(moveResizeGeom);
moveResizeGeom.setSize(adjSize);
......@@ -1342,8 +1313,6 @@ void AbstractClient::performMoveResize()
setFrameGeometry(moveResizeGeom);
}
doPerformMoveResize();
if (isResize())
addRepaintFull();
positionGeometryTip();
emit clientStepUserMovedResized(this, moveResizeGeom);
}
......@@ -1433,7 +1402,7 @@ void AbstractClient::setupWindowManagementInterface()
w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr);
}
);
connect(this, &AbstractClient::geometryChanged, w,
connect(this, &AbstractClient::frameGeometryChanged, w,
[w, this] {
w->setGeometry(frameGeometry());
}
......@@ -1882,7 +1851,7 @@ BORDER(Right)
BORDER(Top)
#undef BORDER
QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool noframe) const
QSize AbstractClient::sizeForClientSize(const QSize &wsize, SizeMode mode, bool noframe) const
{
Q_UNUSED(mode)
Q_UNUSED(noframe)
......@@ -3126,7 +3095,7 @@ void AbstractClient::checkOffscreenPosition(QRect* geom, const QRect& screenArea
}
}
QSize AbstractClient::adjustedSize(const QSize& frame, Sizemode mode) const
QSize AbstractClient::adjustedSize(const QSize& frame, SizeMode mode) const
{
// first, get the window size for the given frame size s
QSize wsize = frameSizeToClientSize(frame);
......@@ -3143,4 +3112,122 @@ QSize AbstractClient::adjustedSize() const
return sizeForClientSize(clientSize());
}
/**
* Returns @c true if the AbstractClient can be shown in full screen mode; otherwise @c false.
*
* Default implementation returns @c false.
*/
bool AbstractClient::isFullScreenable() const
{
return false;
}
/**
* Returns @c true if the AbstractClient is currently being shown in full screen mode; otherwise @c false.
*
* A client in full screen mode occupies the entire screen with no window frame around it.
*
* Default implementation returns @c false.
*/
bool AbstractClient::isFullScreen() const
{
return false;
}
/**
* Returns whether requests initiated by the user to enter or leave full screen mode are honored.
*
* Default implementation returns @c false.
*/
bool AbstractClient::userCanSetFullScreen() const
{
return false;
}
/**
* Asks the AbstractClient to enter or leave full screen mode.
*
* Default implementation does nothing.
*
* @param set @c true if the AbstractClient has to be shown in full screen mode, otherwise @c false
* @param user @c true if the request is initiated by the user, otherwise @c false
*/
void AbstractClient::setFullScreen(bool set, bool user)
{
Q_UNUSED(set)
Q_UNUSED(user)
}
/**
* Returns @c true if the AbstractClient can be minimized; otherwise @c false.
*
* Default implementation returns @c false.
*/
bool AbstractClient::isMinimizable() const
{
return false;
}
/**
* Returns @c true if the AbstractClient can be maximized; otherwise @c false.
*
* Default implementation returns @c false.
*/
bool AbstractClient::isMaximizable() const
{
return false;
}
/**
* Returns the currently applied maximize mode.
*
* Default implementation returns MaximizeRestore.
*/
MaximizeMode AbstractClient::maximizeMode() const
{
return MaximizeRestore;
}
/**
* Returns the last requested maximize mode.
*
* On X11, this method always matches maximizeMode(). On Wayland, it is asynchronous.
*
* Default implementation matches maximizeMode().
*/
MaximizeMode AbstractClient::requestedMaximizeMode() const
{
return maximizeMode();
}
/**
* Returns the geometry of the AbstractClient before it was maximized or quick tiled.
*/
QRect AbstractClient::geometryRestore() const
{
return m_maximizeGeometryRestore;
}
/**
* Sets the geometry of the AbstractClient before it was maximized or quick tiled to @p rect.
*/
void AbstractClient::setGeometryRestore(const QRect &rect)
{
m_maximizeGeometryRestore = rect;
}
/**
* Toggles the maximized state along specified dimensions @p horizontal and @p vertical.
*
* If @p adjust is @c true, only frame geometry will be updated to match requestedMaximizeMode().
*
* Default implementation does nothing.
*/
void AbstractClient::changeMaximize(bool horizontal, bool vertical, bool adjust)
{
Q_UNUSED(horizontal)
Q_UNUSED(vertical)
Q_UNUSED(adjust)
}
}
......@@ -220,8 +220,8 @@ class KWIN_EXPORT AbstractClient : public Toplevel
Q_PROPERTY(bool modal READ isModal NOTIFY modalChanged)
/**
* The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal
* might be emitted at each resize step or only at the end of the resize operation.
* The geometry of this Client. Be aware that depending on resize mode the frameGeometryChanged
* signal might be emitted at each resize step or only at the end of the resize operation.
*/
Q_PROPERTY(QRect geometry READ frameGeometry WRITE setFrameGeometry)
......@@ -416,8 +416,8 @@ public:
virtual bool isHiddenInternal() const = 0;
// TODO: remove boolean trap
virtual void hideClient(bool hide) = 0;
virtual bool isFullScreenable() const = 0;
virtual bool isFullScreen() const = 0;
virtual bool isFullScreenable() const;
virtual bool isFullScreen() const;
// TODO: remove boolean trap
virtual AbstractClient *findModal(bool allow_itself = false) = 0;
virtual bool isTransient() const;
......@@ -484,20 +484,12 @@ public:
bool isMinimized() const {
return m_minimized;
}
virtual void setFullScreen(bool set, bool user = true) = 0;
virtual void setFullScreen(bool set, bool user = true);
virtual void setClientShown(bool shown);
virtual QRect geometryRestore() const = 0;
/**
* The currently applied maximize mode
*/
virtual MaximizeMode maximizeMode() const = 0;
/**
* The maximise mode requested by the server.
* For X this always matches maximizeMode, for wayland clients it
* is asynchronous
*/
QRect geometryRestore() const;
virtual MaximizeMode maximizeMode() const;
virtual MaximizeMode requestedMaximizeMode() const;
void maximize(MaximizeMode);
/**
......@@ -540,13 +532,10 @@ public:
* Whether the Client can be shaded. Default implementation returns @c false.
*/
virtual bool isShadeable() const;
/**
* Returns whether the window is maximizable or not.
*/
virtual bool isMaximizable() const = 0;
virtual bool isMinimizable() const = 0;
virtual bool isMaximizable() const;
virtual bool isMinimizable() const;
virtual QRect iconGeometry() const;
virtual bool userCanSetFullScreen() const = 0;
virtual bool userCanSetFullScreen() const;
virtual bool userCanSetNoBorder() const = 0;
virtual void checkNoBorder();
virtual void setOnActivities(QStringList newActivitiesList);
......@@ -634,12 +623,15 @@ public:
virtual QSize maxSize() const;
virtual void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0;
void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet);
/// How to resize the window in order to obey constains (mainly aspect ratios)
enum Sizemode {
SizemodeAny,
SizemodeFixedW, ///< Try not to affect width
SizemodeFixedH, ///< Try not to affect height
SizemodeMax ///< Try not to make it larger in either direction
/**
* How to resize the window in order to obey constraints (mainly aspect ratios).
*/
enum SizeMode {
SizeModeAny,
SizeModeFixedW, ///< Try not to affect width
SizeModeFixedH, ///< Try not to affect height
SizeModeMax ///< Try not to make it larger in either direction
};
/**
* Calculates the appropriate frame size for the given client size @p wsize.
......@@ -648,12 +640,12 @@ public: