Revert "[kcm/effects] Clip ListView"

Bad merge

This reverts commit 5babf52df4.
master
Nicolas Fella 2020-02-22 11:50:30 +01:00
parent 5babf52df4
commit cdc5ea19ab
112 changed files with 1200 additions and 1440 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(KWin)
set(PROJECT_VERSION "5.18.80")
project(KWIN)
set(PROJECT_VERSION "5.18.1")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.12.0")
@ -70,6 +70,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
I18n
IconThemes
IdleTime
Init
Notifications
Package
Plasma
@ -311,6 +312,7 @@ 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)
@ -390,7 +392,7 @@ add_subdirectory(helpers)
########### next target ###############
set(kwin_SRCS
set(kwin_KDEINIT_SRCS
abstract_client.cpp
abstract_opengl_context_attribute_builder.cpp
abstract_output.cpp
@ -502,14 +504,14 @@ set(kwin_SRCS
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(kwin_SRCS
${kwin_SRCS}
set(kwin_KDEINIT_SRCS
${kwin_KDEINIT_SRCS}
colorcorrection/clockskewnotifierengine_linux.cpp
)
endif()
include(ECMQtDeclareLoggingCategory)
ecm_qt_declare_logging_category(kwin_SRCS
ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS
HEADER
colorcorrect_logging.h
IDENTIFIER
@ -522,7 +524,7 @@ ecm_qt_declare_logging_category(kwin_SRCS
if (KWIN_BUILD_TABBOX)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
set(kwin_SRCS ${kwin_SRCS}
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
tabbox/clientmodel.cpp
tabbox/desktopchain.cpp
tabbox/desktopmodel.cpp
@ -536,33 +538,33 @@ if (KWIN_BUILD_TABBOX)
endif()
if (KWIN_BUILD_ACTIVITIES)
set(kwin_SRCS ${kwin_SRCS}
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
activities.cpp
)
endif()
if (HAVE_LINUX_VT_H)
set(kwin_SRCS ${kwin_SRCS}
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
virtual_terminal.cpp
)
endif()
kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_SRCS colorcorrection/colorcorrect_settings.kcfgc)
kconfig_add_kcfg_files(kwin_KDEINIT_SRCS settings.kcfgc)
kconfig_add_kcfg_files(kwin_KDEINIT_SRCS colorcorrection/colorcorrect_settings.kcfgc)
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_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_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)
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)
ki18n_wrap_ui(kwin_SRCS
ki18n_wrap_ui(kwin_KDEINIT_SRCS
debug_console.ui
shortcutdialog.ui
)
@ -645,7 +647,7 @@ set(kwinLibs
Libinput::Libinput
)
add_library(kwin SHARED ${kwin_SRCS})
add_library(kwin SHARED ${kwin_KDEINIT_SRCS})
set_target_properties(kwin PROPERTIES
VERSION ${PROJECT_VERSION}
@ -657,10 +659,11 @@ generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
target_link_libraries(kwin kwinglutils ${epoxy_LIBRARY})
add_executable(kwin_x11 main_x11.cpp)
target_link_libraries(kwin_x11 kwin KF5::Crash Qt5::X11Extras)
kf5_add_kdeinit_executable(kwin_x11 main_x11.cpp)
target_link_libraries(kdeinit_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

View File

@ -91,8 +91,5 @@ 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).

View File

@ -64,6 +64,10 @@ 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);
@ -85,7 +89,7 @@ AbstractClient::AbstractClient()
});
// replace on-screen-display on size changes
connect(this, &AbstractClient::frameGeometryChanged, this,
connect(this, &AbstractClient::geometryShapeChanged, this,
[this] (Toplevel *c, const QRect &old) {
Q_UNUSED(c)
if (isOnScreenDisplay() && !frameGeometry().isEmpty() && old.size() != frameGeometry().size() && !isInitialPositionSet()) {
@ -131,6 +135,11 @@ 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;
@ -317,13 +326,19 @@ 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;
doSetKeepAbove();
if (info) {
info->setState(keepAbove() ? NET::KeepAbove : NET::States(), NET::KeepAbove);
}
workspace()->updateClientLayer(this);
updateWindowRules(Rules::Above);
doSetKeepAbove();
emit keepAboveChanged(m_keepAbove);
}
@ -337,13 +352,19 @@ 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;
doSetKeepBelow();
if (info) {
info->setState(keepBelow() ? NET::KeepBelow : NET::States(), NET::KeepBelow);
}
workspace()->updateClientLayer(this);
updateWindowRules(Rules::Below);
doSetKeepBelow();
emit keepBelowChanged(m_keepBelow);
}
@ -390,15 +411,13 @@ void AbstractClient::demandAttention(bool set)
if (m_demandsAttention == set)
return;
m_demandsAttention = set;
doSetDemandsAttention();
if (info) {
info->setState(set ? NET::DemandsAttention : NET::States(), NET::DemandsAttention);
}
workspace()->clientAttentionChanged(this, set);
emit demandsAttentionChanged();
}
void AbstractClient::doSetDemandsAttention()
{
}
void AbstractClient::setDesktop(int desktop)
{
const int numberOfDesktops = VirtualDesktopManager::self()->count();
@ -470,7 +489,7 @@ void AbstractClient::setDesktops(QVector<VirtualDesktop*> desktops)
c2->setDesktops(desktops);
}
doSetDesktop();
doSetDesktop(desktop(), was_desk);
FocusChain::self()->update(this, FocusChain::MakeFirst);
updateWindowRules(Rules::Desktop);
@ -481,8 +500,10 @@ void AbstractClient::setDesktops(QVector<VirtualDesktop*> desktops)
emit x11DesktopIdsChanged();
}
void AbstractClient::doSetDesktop()
void AbstractClient::doSetDesktop(int desktop, int was_desk)
{
Q_UNUSED(desktop)
Q_UNUSED(was_desk)
}
void AbstractClient::enterDesktop(VirtualDesktop *virtualDesktop)
@ -598,7 +619,11 @@ 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);
@ -618,7 +643,11 @@ 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);
@ -793,9 +822,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()
@ -1052,8 +1081,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()));
@ -1069,19 +1098,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:
@ -1182,7 +1211,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);
@ -1191,9 +1220,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();
@ -1209,7 +1238,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);
@ -1313,6 +1342,8 @@ void AbstractClient::performMoveResize()
setFrameGeometry(moveResizeGeom);
}
doPerformMoveResize();
if (isResize())
addRepaintFull();
positionGeometryTip();
emit clientStepUserMovedResized(this, moveResizeGeom);
}
@ -1402,7 +1433,7 @@ void AbstractClient::setupWindowManagementInterface()
w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr);
}
);
connect(this, &AbstractClient::frameGeometryChanged, w,
connect(this, &AbstractClient::geometryChanged, w,
[w, this] {
w->setGeometry(frameGeometry());
}
@ -1851,7 +1882,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)
@ -3095,7 +3126,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);
@ -3112,122 +3143,4 @@ 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)
}
}

View File

@ -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 frameGeometryChanged
* 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 geometryChanged 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;
virtual bool isFullScreen() const;
virtual bool isFullScreenable() const = 0;
virtual bool isFullScreen() const = 0;
// TODO: remove boolean trap
virtual AbstractClient *findModal(bool allow_itself = false) = 0;
virtual bool isTransient() const;
@ -484,12 +484,20 @@ public:
bool isMinimized() const {
return m_minimized;
}
virtual void setFullScreen(bool set, bool user = true);
virtual void setFullScreen(bool set, bool user = true) = 0;
virtual void setClientShown(bool shown);
QRect geometryRestore() const;
virtual MaximizeMode maximizeMode() const;
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
*/
virtual MaximizeMode requestedMaximizeMode() const;
void maximize(MaximizeMode);
/**
@ -532,10 +540,13 @@ public:
* Whether the Client can be shaded. Default implementation returns @c false.
*/
virtual bool isShadeable() const;
virtual bool isMaximizable() const;
virtual bool isMinimizable() const;
/**
* Returns whether the window is maximizable or not.
*/
virtual bool isMaximizable() const = 0;
virtual bool isMinimizable() const = 0;
virtual QRect iconGeometry() const;
virtual bool userCanSetFullScreen() const;
virtual bool userCanSetFullScreen() const = 0;
virtual bool userCanSetNoBorder() const = 0;
virtual void checkNoBorder();
virtual void setOnActivities(QStringList newActivitiesList);
@ -623,15 +634,12 @@ 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 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
/// 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
};
/**
* Calculates the appropriate frame size for the given client size @p wsize.
@ -640,12 +648,12 @@ public:
*
* Default implementation returns the passed in @p wsize.
*/
virtual QSize sizeForClientSize(const QSize &wsize, SizeMode mode = SizeModeAny, bool noframe = false) const;
virtual QSize sizeForClientSize(const QSize &wsize, Sizemode mode = SizemodeAny, bool noframe = false) const;
/**
* Adjust the frame size @p frame according to the window's size hints.
*/
QSize adjustedSize(const QSize&, SizeMode mode = SizeModeAny) const;
QSize adjustedSize(const QSize&, Sizemode mode = SizemodeAny) const;
QSize adjustedSize() const;
/**
@ -957,8 +965,10 @@ protected:
* is emitted.
*
* Default implementation does nothing.
* @param desktop The new desktop the Client is on
* @param was_desk The desktop the Client was on before
*/
virtual void doSetDesktop();
virtual void doSetDesktop(int desktop, int was_desk);
/**
* Called from @ref minimize and @ref unminimize once the minimized value got updated, but before the
* changed signal is emitted.
@ -971,7 +981,6 @@ protected:
virtual void doSetSkipTaskbar();
virtual void doSetSkipPager();
virtual void doSetSkipSwitcher();
virtual void doSetDemandsAttention();
void setupWindowManagementInterface();
void destroyWindowManagementInterface();
@ -1016,8 +1025,8 @@ protected:
int borderRight() const;
int borderTop() const;
int borderBottom() const;
virtual void changeMaximize(bool horizontal, bool vertical, bool adjust);
void setGeometryRestore(const QRect &rect);
virtual void changeMaximize(bool horizontal, bool vertical, bool adjust) = 0;
virtual void setGeometryRestore(const QRect &geo) = 0;
/**
* Called from move after updating the geometry. Can be reimplemented to perform specific tasks.
@ -1258,7 +1267,6 @@ private:
QRect m_frameGeometryBeforeUpdateBlocking;
QRect m_virtualKeyboardGeometry;
QRect m_keyboardGeometryRestore;
QRect m_maximizeGeometryRestore;
struct {
bool enabled = false;

View File

@ -164,7 +164,7 @@ ecm_mark_as_test(testBuiltInEffectLoader)
########################################################
# Test ScriptedEffectLoader
########################################################
include_directories(${KWin_SOURCE_DIR})
include_directories(${KWIN_SOURCE_DIR})
set(testScriptedEffectLoader_SRCS
../effectloader.cpp
../orientation_sensor.cpp

View File

@ -381,11 +381,11 @@ void ActivationTest::testSwitchToWindowMaximized()
QVERIFY(configureRequestedSpy1.wait());
workspace()->slotWindowMaximize();
QVERIFY(configureRequestedSpy1.wait());
QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy1.isValid());
QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy1.isValid());
shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>());
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy1.wait());
QVERIFY(geometryChangedSpy1.wait());
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data()));
@ -396,11 +396,11 @@ void ActivationTest::testSwitchToWindowMaximized()
QVERIFY(configureRequestedSpy2.wait());
workspace()->slotWindowMaximize();
QVERIFY(configureRequestedSpy2.wait());
QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy2.isValid());
QSignalSpy geometryChangedSpy2(client2, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy2.isValid());
shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>());
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy2.wait());
QVERIFY(geometryChangedSpy2.wait());
const QList<Toplevel *> stackingOrder = workspace()->stackingOrder();
QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2));
@ -466,11 +466,11 @@ void ActivationTest::testSwitchToWindowFullScreen()
QVERIFY(configureRequestedSpy1.wait());
workspace()->slotWindowFullScreen();
QVERIFY(configureRequestedSpy1.wait());
QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy1.isValid());
QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy1.isValid());
shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>());
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy1.wait());
QVERIFY(geometryChangedSpy1.wait());
QScopedPointer<Surface> surface2(Test::createSurface());
QScopedPointer<XdgShellSurface> shellSurface2(Test::createXdgShellStableSurface(surface2.data()));
@ -481,11 +481,11 @@ void ActivationTest::testSwitchToWindowFullScreen()
QVERIFY(configureRequestedSpy2.wait());
workspace()->slotWindowFullScreen();
QVERIFY(configureRequestedSpy2.wait());
QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy2.isValid());
QSignalSpy geometryChangedSpy2(client2, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy2.isValid());
shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>());
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy2.wait());
QVERIFY(geometryChangedSpy2.wait());
const QList<Toplevel *> stackingOrder = workspace()->stackingOrder();
QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2));

View File

@ -157,8 +157,8 @@ void MaximizeAnimationTest::testMaximizeRestore()
QVERIFY(!effect->isActive());
// Maximize the client.
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy maximizeChangedSpy(client, qOverload<AbstractClient *, bool, bool>(&XdgShellClient::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy.isValid());
@ -173,8 +173,8 @@ void MaximizeAnimationTest::testMaximizeRestore()
// Draw contents of the maximized client.
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(1280, 1024), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(geometryChangedSpy.count(), 2);
QCOMPARE(maximizeChangedSpy.count(), 1);
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull);
QVERIFY(effect->isActive());
@ -194,8 +194,8 @@ void MaximizeAnimationTest::testMaximizeRestore()
// Draw contents of the restored client.
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 2);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(geometryChangedSpy.count(), 4);
QCOMPARE(maximizeChangedSpy.count(), 2);
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
QVERIFY(effect->isActive());

View File

@ -133,8 +133,8 @@ void TestMaximized::testMaximizedPassedToDeco()
QVERIFY(bordersChangedSpy.isValid());
QSignalSpy maximizedChangedSpy(decoration->client().data(), &KDecoration2::DecoratedClient::maximizedChanged);
QVERIFY(maximizedChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryShapeChangedSpy(client, &AbstractClient::geometryShapeChanged);
QVERIFY(geometryShapeChangedSpy.isValid());
workspace()->slotWindowMaximize();
QVERIFY(configureRequestedSpy.wait());
@ -142,10 +142,10 @@ void TestMaximized::testMaximizedPassedToDeco()
QCOMPARE(configureRequestedSpy.last().at(0).toSize(), QSize(1280, 1024 - decoration->borderTop()));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), configureRequestedSpy.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryShapeChangedSpy.wait());
// If no borders, there is only the initial geometry shape change, but none through border resizing.
QCOMPARE(frameGeometryChangedSpy.count(), hasBorders ? 2 : 1);
QCOMPARE(geometryShapeChangedSpy.count(), hasBorders ? 2 : 1);
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull);
QCOMPARE(maximizedChangedSpy.count(), 1);
QCOMPARE(maximizedChangedSpy.last().first().toBool(), true);
@ -163,8 +163,8 @@ void TestMaximized::testMaximizedPassedToDeco()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), hasBorders ? 4 : 2);
QVERIFY(geometryShapeChangedSpy.wait());
QCOMPARE(geometryShapeChangedSpy.count(), hasBorders ? 4 : 2);
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
QCOMPARE(maximizedChangedSpy.count(), 2);
QCOMPARE(maximizedChangedSpy.last().first().toBool(), false);
@ -273,11 +273,11 @@ void TestMaximized::testBorderlessMaximizedWindow()
QVERIFY(states.testFlag(XdgShellSurface::State::Activated));
QVERIFY(states.testFlag(XdgShellSurface::State::Maximized));
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull);
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
@ -294,7 +294,7 @@ void TestMaximized::testBorderlessMaximizedWindow()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), maximizeRestoreGeometry);
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
@ -326,8 +326,8 @@ void TestMaximized::testBorderlessMaximizedWindowNoClientSideDecoration()
auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy sizeChangeRequestedSpy(xdgShellSurface.data(), &XdgShellSurface::sizeChanged);
QVERIFY(sizeChangeRequestedSpy.isValid());
QSignalSpy configureRequestedSpy(xdgShellSurface.data(), &XdgShellSurface::configureRequested);
@ -348,7 +348,7 @@ void TestMaximized::testBorderlessMaximizedWindowNoClientSideDecoration()
xdgShellSurface->ackConfigure(it[2].toInt());
}
Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
// no deco
QVERIFY(!client->isDecorated());
@ -365,7 +365,7 @@ void TestMaximized::testBorderlessMaximizedWindowNoClientSideDecoration()
xdgShellSurface->ackConfigure(it[2].toInt());
}
Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QVERIFY(client->isDecorated());
QVERIFY(!client->noBorder());

View File

@ -138,6 +138,8 @@ void MoveResizeWindowTest::testMove()
QVERIFY(c);
QCOMPARE(workspace()->activeClient(), c);
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged);
@ -241,8 +243,8 @@ void MoveResizeWindowTest::testResize()
QVERIFY(c);
QCOMPARE(workspace()->activeClient(), c);
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged);
@ -287,7 +289,7 @@ void MoveResizeWindowTest::testResize()
// Now render new size.
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(108, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 50));
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
@ -308,7 +310,7 @@ void MoveResizeWindowTest::testResize()
// Now render new size.
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(108, 58), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 58));
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
@ -485,10 +487,10 @@ void MoveResizeWindowTest::testGrowShrink()
QVERIFY(sizeChangeSpy.wait());
Test::render(surface.data(), shellSurface->size(), Qt::red);
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
m_connection->flush();
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QTEST(c->frameGeometry(), "expectedGeometry");
}
@ -918,8 +920,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard()
QVERIFY(configureRequestedSpy.wait());
client->move(100, 300);
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
@ -928,7 +930,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard()
shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt());
// render at the new size
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101));
client->setVirtualKeyboardGeometry(QRect());
@ -937,7 +939,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard()
shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt());
// render at the new size
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
}
@ -961,8 +963,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
QVERIFY(configureRequestedSpy.wait());
client->move(100, 300);
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
@ -971,14 +973,14 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt());
// render at the new size
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101));
client->setMaximize(true, true);
QVERIFY(configureRequestedSpy.wait());
shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt());
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
client->setVirtualKeyboardGeometry(QRect());
@ -986,7 +988,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
// render at the size of the configureRequested.. it won't have changed
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(!frameGeometryChangedSpy.wait(10));
QVERIFY(!geometryChangedSpy.wait(10));
// Size will NOT be restored
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
@ -1012,8 +1014,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
QVERIFY(configureRequestedSpy.wait());
client->move(100, 300);
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
@ -1022,14 +1024,14 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt());
// render at the new size
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101));
client->setFullScreen(true, true);
QVERIFY(configureRequestedSpy.wait());
shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt());
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
client->setVirtualKeyboardGeometry(QRect());
@ -1037,7 +1039,7 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
// render at the size of the configureRequested.. it won't have changed
Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue);
QVERIFY(!frameGeometryChangedSpy.wait(10));
QVERIFY(!geometryChangedSpy.wait(10));
// Size will NOT be restored
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
}

View File

@ -241,10 +241,10 @@ void PlasmaSurfaceTest::testOSDPlacement()
QCOMPARE(c->frameGeometry(), QRect(590, 649, 100, 50));
// change size of window
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryShapeChanged);
QVERIFY(geometryChangedSpy.isValid());
Test::render(surface.data(), QSize(200, 100), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(c->frameGeometry(), QRect(540, 616, 200, 100));
}

View File

@ -180,8 +180,8 @@ void QuickTilingTest::testQuickTiling()
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QFETCH(QuickTileMode, mode);
QFETCH(QRect, expectedGeometry);
@ -202,8 +202,9 @@ void QuickTilingTest::testQuickTiling()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), expectedGeometry.size(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QVERIFY(geometryChangedSpy.wait());
QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue);
QCOMPARE(geometryChangedSpy.count(), 1);
QCOMPARE(c->frameGeometry(), expectedGeometry);
// send window to other screen
@ -256,8 +257,8 @@ void QuickTilingTest::testQuickMaximizing()
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy maximizeChangedSpy1(c, qOverload<AbstractClient *, MaximizeMode>(&AbstractClient::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy1.isValid());
QSignalSpy maximizeChangedSpy2(c, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged));
@ -282,8 +283,8 @@ void QuickTilingTest::testQuickMaximizing()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(1280, 1024), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(geometryChangedSpy.count(), 2);
QCOMPARE(c->frameGeometry(), QRect(0, 0, 1280, 1024));
QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50));
@ -315,8 +316,8 @@ void QuickTilingTest::testQuickMaximizing()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::yellow);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 2);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(geometryChangedSpy.count(), 4);
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50));
QCOMPARE(maximizeChangedSpy1.count(), 2);
@ -781,14 +782,14 @@ void QuickTilingTest::testShortcut()
QCOMPARE(configureRequestedSpy.last().at(0).toSize(), expectedGeometry.size());
// attach a new image
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), expectedGeometry.size(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue);
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QCOMPARE(geometryChangedSpy.count(), 1);
QCOMPARE(c->frameGeometry(), expectedGeometry);
}
@ -836,8 +837,8 @@ void QuickTilingTest::testScript()
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QVERIFY(Scripting::self());
QTemporaryFile tmpFile;
@ -880,9 +881,9 @@ void QuickTilingTest::testScript()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), expectedGeometry.size(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue);
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QCOMPARE(geometryChangedSpy.count(), 1);
QCOMPARE(c->frameGeometry(), expectedGeometry);
}

View File

@ -246,10 +246,10 @@ void StrutsTest::testMoveWaylandPanel()
QCOMPARE(workspace()->clientArea(MaximizeArea, 1, 1), QRect(1280, 0, 1280, 1024));
QCOMPARE(workspace()->clientArea(WorkArea, 0, 1), QRect(0, 0, 2560, 1000));
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryShapeChanged);
QVERIFY(geometryChangedSpy.isValid());
plasmaSurface->setPosition(QPoint(1280, 1000));
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(c->frameGeometry(), QRect(1280, 1000, 1280, 24));
QCOMPARE(workspace()->clientArea(PlacementArea, 0, 1), QRect(0, 0, 1280, 1024));
QCOMPARE(workspace()->clientArea(MaximizeArea, 0, 1), QRect(0, 0, 1280, 1024));

View File

@ -209,27 +209,6 @@ void TransientPlacementTest::testXdgPopup_data()
positioner.setGravity(Qt::TopEdge);
positioner.setInitialSize(QSize(300, 200));
QTest::newRow("constraintFlipRightNoGravity") << QSize(500, 500) << QPoint(700, 80) << positioner << QRect(700 + 50 - 150, 130, 300, 200);
// ----------------------------------------------------------------
// resize
positioner.setConstraints(XdgPositioner::Constraint::ResizeX | XdgPositioner::Constraint::ResizeY);
positioner.setInitialSize(QSize(200, 200));
positioner.setAnchorEdge(Qt::TopEdge);
positioner.setGravity(Qt::TopEdge);
QTest::newRow("resizeTop") << QSize(500, 500) << QPoint(80, 80) << positioner << QRect(80 + 250 - 100, 0, 200, 130);
positioner.setAnchorEdge(Qt::LeftEdge);
positioner.setGravity(Qt::LeftEdge);
QTest::newRow("resizeLeft") << QSize(500, 500) << QPoint(80, 80) << positioner << QRect(0, 80 + 250 - 100, 130, 200);
positioner.setAnchorEdge(Qt::RightEdge);
positioner.setGravity(Qt::RightEdge);
QTest::newRow("resizeRight") << QSize(500, 500) << QPoint(700, 80) << positioner << QRect(700 + 50 + 400, 80 + 250 - 100, 130, 200);
positioner.setAnchorEdge(Qt::BottomEdge);
positioner.setGravity(Qt::BottomEdge);
QTest::newRow("resizeBottom") << QSize(500, 500) << QPoint(80, 500) << positioner << QRect(80 + 250 - 100, 500 + 50 + 400, 200, 74);
}
void TransientPlacementTest::testXdgPopup()
@ -270,7 +249,7 @@ void TransientPlacementTest::testXdgPopup()
QCOMPARE(configureRequestedSpy.first()[0].value<QRect>(), expectedRelativeGeometry);
popup->ackConfigure(configureRequestedSpy.first()[1].toUInt());
auto transient = Test::renderAndWaitForShown(transientSurface, expectedRelativeGeometry.size(), Qt::red);
auto transient = Test::renderAndWaitForShown(transientSurface, positioner.initialSize(), Qt::red);
QVERIFY(transient);
QVERIFY(!transient->isDecorated());
@ -340,10 +319,10 @@ void TransientPlacementTest::testXdgPopupWithPanel()
parent->setFullScreen(true);
QVERIFY(fullscreenSpy.wait());
parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>());
QSignalSpy frameGeometryChangedSpy{parent, &XdgShellClient::frameGeometryChanged};
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryShapeChangedSpy{parent, &XdgShellClient::geometryShapeChanged};
QVERIFY(geometryShapeChangedSpy.isValid());
Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryShapeChangedSpy.wait());
QCOMPARE(parent->frameGeometry(), screens()->geometry(0));
QVERIFY(parent->isFullScreen());

View File

@ -579,10 +579,10 @@ void TestXdgShellClientRules::testPositionApplyNow()
RuleBook::self()->setConfig(config);
// The client should be moved to the position specified by the rule.
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
workspace()->slotReconfigure();
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QCOMPARE(geometryChangedSpy.count(), 1);
QCOMPARE(client->pos(), QPoint(42, 42));
// We still have to be able to move the client around.
@ -792,8 +792,8 @@ void TestXdgShellClientRules::testSizeApply()
QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing));
// One still should be able to resize the client.
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized);
@ -832,7 +832,7 @@ void TestXdgShellClientRules::testSizeApply()
QCOMPARE(clientStepUserMovedResizedSpy.count(), 0);
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(488, 640), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(488, 640));
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
@ -930,8 +930,8 @@ void TestXdgShellClientRules::testSizeRemember()
QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing));
// One should still be able to resize the client.
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized);
@ -970,7 +970,7 @@ void TestXdgShellClientRules::testSizeRemember()
QCOMPARE(clientStepUserMovedResizedSpy.count(), 0);
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(488, 640), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(488, 640));
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
@ -1154,11 +1154,11 @@ void TestXdgShellClientRules::testSizeApplyNow()
QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640));
// Draw the surface with the new size.
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(480, 640), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(480, 640));
QVERIFY(!configureRequestedSpy->wait(100));
@ -1387,11 +1387,11 @@ void TestXdgShellClientRules::testMaximizeApply()
QVERIFY(states.testFlag(XdgShellSurface::State::Activated));
QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized));
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(100, 50));
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
@ -1499,11 +1499,11 @@ void TestXdgShellClientRules::testMaximizeRemember()
QVERIFY(states.testFlag(XdgShellSurface::State::Activated));
QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized));
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(100, 50));
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
@ -1713,11 +1713,11 @@ void TestXdgShellClientRules::testMaximizeApplyNow()
QVERIFY(states.testFlag(XdgShellSurface::State::Maximized));
// Draw contents of the maximized client.
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(1280, 1024));
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull);
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
@ -1736,7 +1736,7 @@ void TestXdgShellClientRules::testMaximizeApplyNow()
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->size(), QSize(100, 50));
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);

View File

@ -461,8 +461,8 @@ void TestXdgShellClient::testFullscreen()
QCOMPARE(c->sizeForClientSize(c->clientSize()), c->frameGeometry().size());
QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged);
QVERIFY(sizeChangeRequestedSpy.isValid());
QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested);
@ -476,12 +476,12 @@ void TestXdgShellClient::testFullscreen()
// TODO: should switch to fullscreen once it's updated
QVERIFY(c->isFullScreen());
QCOMPARE(c->clientSize(), QSize(100, 50));
QVERIFY(frameGeometryChangedSpy.isEmpty());
QVERIFY(geometryChangedSpy.isEmpty());
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), sizeChangeRequestedSpy.first().first().toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(geometryChangedSpy.count(), 1);
QVERIFY(c->isFullScreen());
QVERIFY(!c->isDecorated());
QCOMPARE(c->frameGeometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.first().first().toSize()));
@ -537,8 +537,8 @@ void TestXdgShellClient::testFullscreenRestore()
QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
// swap back to normal
configureRequestedSpy.clear();
@ -554,8 +554,8 @@ void TestXdgShellClient::testFullscreenRestore()
}
Test::render(surface.data(), QSize(100, 50), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(geometryChangedSpy.count(), 1);
QVERIFY(!c->isFullScreen());
QCOMPARE(c->frameGeometry().size(), QSize(100, 50));
}
@ -680,8 +680,8 @@ void TestXdgShellClient::testMaximizedToFullscreen()
QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server);
QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged);
QVERIFY(sizeChangeRequestedSpy.isValid());
QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested);
@ -692,11 +692,11 @@ void TestXdgShellClient::testMaximizedToFullscreen()
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(c->maximizeMode(), MaximizeFull);
QCOMPARE(frameGeometryChangedSpy.isEmpty(), false);
frameGeometryChangedSpy.clear();
QCOMPARE(geometryChangedSpy.isEmpty(), false);
geometryChangedSpy.clear();
// fullscreen the window
shellSurface->setFullscreen(true);
@ -1318,10 +1318,10 @@ void TestXdgShellClient::testXdgWindowGeometryIsntSet()
const QPoint oldPosition = client->pos();
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(100, 50));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition);
@ -1333,7 +1333,7 @@ void TestXdgShellClient::testXdgWindowGeometryIsntSet()
subSurface->setPosition(QPoint(-20, -10));
Test::render(childSurface.data(), QSize(100, 50), Qt::blue);
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(120, 60));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition + QPoint(20, 10));
@ -1356,29 +1356,27 @@ void TestXdgShellClient::testXdgWindowGeometryAttachBuffer()
const QPoint oldPosition = client->pos();
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 1);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10));
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
Test::render(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 2);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(100, 50));
QEXPECT_FAIL("", "Ask on wayland-devel what effective window geometry should be here", Continue);
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10));
QCOMPARE(client->bufferGeometry().size(), QSize(100, 50));
shellSurface->setWindowGeometry(QRect(5, 5, 90, 40));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(frameGeometryChangedSpy.count(), 3);
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(90, 40));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(5, 5));
@ -1403,11 +1401,11 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface()
const QPoint oldPosition = client->pos();
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10));
@ -1426,7 +1424,7 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface()
shellSurface->setWindowGeometry(QRect(-15, -15, 50, 40));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
QCOMPARE(client->frameGeometry().size(), QSize(50, 40));
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(-15, -15));
@ -1451,11 +1449,11 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize()
QVERIFY(configureRequestedSpy.wait());
QCOMPARE(configureRequestedSpy.count(), 1);
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
@ -1489,7 +1487,7 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize()
shellSurface->setWindowGeometry(QRect(10, 10, 188, 80));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(208, 100), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
QCOMPARE(client->bufferGeometry().size(), QSize(208, 100));
QCOMPARE(client->frameGeometry().size(), QSize(188, 80));
@ -1507,7 +1505,7 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize()
shellSurface->setWindowGeometry(QRect(10, 10, 188, 88));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(208, 108), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
QCOMPARE(client->bufferGeometry().size(), QSize(208, 108));
QCOMPARE(client->frameGeometry().size(), QSize(188, 88));
@ -1546,11 +1544,11 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen()
QVERIFY(configureRequestedSpy.wait());
QCOMPARE(configureRequestedSpy.count(), 1);
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
@ -1563,7 +1561,7 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen()
shellSurface->setWindowGeometry(QRect(0, 0, 1280, 1024));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(1280, 1024));
QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024));
@ -1576,7 +1574,7 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen()
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(200, 100), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
@ -1602,11 +1600,11 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize()
QVERIFY(configureRequestedSpy.wait());
QCOMPARE(configureRequestedSpy.count(), 1);
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
surface->commit(Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
@ -1619,7 +1617,7 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize()
shellSurface->setWindowGeometry(QRect(0, 0, 1280, 1024));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(1280, 1024));
QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024));
@ -1632,7 +1630,7 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize()
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
Test::render(surface.data(), QSize(200, 100), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QVERIFY(geometryChangedSpy.wait());
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));

View File

@ -1,4 +1,4 @@
include_directories(${KWin_SOURCE_DIR})
include_directories(${KWIN_SOURCE_DIR})
add_definitions(-DKWIN_UNIT_TEST)
########################################################
# Test TabBox::ClientModel

View File

@ -283,7 +283,7 @@ private:
ClockSkewNotifier *m_skewNotifier;
// Specifies whether Night Color is enabled.
bool m_active = false;
bool m_active;
// Specifies whether Night Color is currently running.
bool m_running = false;

View File

@ -54,7 +54,7 @@ DecoratedClientImpl::DecoratedClientImpl(AbstractClient *client, KDecoration2::D
emit decoratedClient->activeChanged(client->isActive());
}
);
connect(client, &AbstractClient::frameGeometryChanged, this,
connect(client, &AbstractClient::geometryChanged, this,
[decoratedClient, this]() {
if (m_client->clientSize() == m_clientSize) {
return;

View File

@ -1,86 +0,0 @@
# Coding Conventions
This document describes some of the recommended coding conventions that should be followed in KWin.
For KWin, it is recommended to follow the KDE Frameworks Coding Style.
## `auto` Keyword
Optionally, you can use the `auto` keyword in the following cases. If in doubt, for example if using
`auto` could make the code less readable, do not use `auto`. Keep in mind that code is read much more
often than written.
* When it avoids repetition of a type in the same statement.
```
auto something = new MyCustomType;
auto keyEvent = static_cast<QKeyEvent *>(event);
auto myList = QStringList({ "FooThing", "BarThing" });
```
* When assigning iterator types.
```
auto it = myList.const_iterator();
```
## `QRect::right()` and `QRect::bottom()`
For historical reasons, the `QRect::right()` and `QRect::bottom()` functions deviate from the true
bottom-right corner of the rectangle. Note that this is not the case for the `QRectF` class.
As a general rule, avoid using `QRect::right()` and `QRect::bottom()` as well methods that operate
on them. There are exceptions, though.
Exception 1: you can use `QRect::moveRight()` and `QRect::moveBottom()` to snap a `QRect` to
another `QRect` as long as the corresponding borders match, for example
```
// Ok
rect.moveRight(anotherRect.right());
rect.moveBottom(anotherRect.bottom());
rect.moveBottomRight(anotherRect.bottomRight());
// Bad
rect.moveRight(anotherRect.left() - 1); // must be rect.moveLeft(anotherRect.left() - rect.width());
rect.moveBottom(anotherRect.top() - 1); // must be rect.moveTop(anotherRect.top() - rect.height());
rect.moveBottomRight(anotherRect.topLeft() - QPoint(1, 1));
```
Exception 2: you can use `QRect::setRight()` and `QRect::setBottom()` to clip a `QRect` by another
`QRect` as long as the corresponding borders match, for example
```
// Ok
rect.setRight(anotherRect.right());
rect.setBottom(anotherRect.bottom());
rect.setBottomRight(anotherRect.bottomRight());
// Bad
rect.setRight(anotherRect.left());
rect.setBottom(anotherRect.top());
rect.setBottomRight(anotherRect.topLeft());
```
Exception 3: you can use `QRect::right()` and `QRect::bottom()` in conditional statements as long
as the compared borders are the same, for example
```
// Ok
if (rect.right() > anotherRect.right()) {
return;
}
if (rect.bottom() > anotherRect.bottom()) {
return;
}
// Bad
if (rect.right() > anotherRect.left()) {
return;
}
if (rect.bottom() > anotherRect.top()) {
return;
}
```

View File

@ -334,7 +334,6 @@ void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c)
);
connect(c, &AbstractClient::modalChanged, this, &EffectsHandlerImpl::slotClientModalityChanged);
connect(c, &AbstractClient::geometryShapeChanged, this, &EffectsHandlerImpl::slotGeometryShapeChanged);
connect(c, &AbstractClient::frameGeometryChanged, this, &EffectsHandlerImpl::slotFrameGeometryChanged);
connect(c, &AbstractClient::damaged, this, &EffectsHandlerImpl::slotWindowDamaged);
connect(c, &AbstractClient::unresponsiveChanged, this,
[this, c](bool unresponsive) {
@ -381,7 +380,6 @@ void EffectsHandlerImpl::setupUnmanagedConnections(Unmanaged* u)
connect(u, &Unmanaged::windowClosed, this, &EffectsHandlerImpl::slotWindowClosed);
connect(u, &Unmanaged::opacityChanged, this, &EffectsHandlerImpl::slotOpacityChanged);
connect(u, &Unmanaged::geometryShapeChanged, this, &EffectsHandlerImpl::slotGeometryShapeChanged);
connect(u, &Unmanaged::frameGeometryChanged, this, &EffectsHandlerImpl::slotFrameGeometryChanged);
connect(u, &Unmanaged::paddingChanged, this, &EffectsHandlerImpl::slotPaddingChanged);
connect(u, &Unmanaged::damaged, this, &EffectsHandlerImpl::slotWindowDamaged);
}
@ -639,14 +637,6 @@ void EffectsHandlerImpl::slotGeometryShapeChanged(Toplevel* t, const QRect& old)
emit windowGeometryShapeChanged(t->effectWindow(), old);
}
void EffectsHandlerImpl::slotFrameGeometryChanged(Toplevel *toplevel, const QRect &oldGeometry)
{
// effectWindow() might be nullptr during tear down of the client.
if (toplevel->effectWindow()) {
emit windowFrameGeometryChanged(toplevel->effectWindow(), oldGeometry);
}
}
void EffectsHandlerImpl::slotPaddingChanged(Toplevel* t, const QRect& old)
{
// during late cleanup effectWindow() may be already NULL

View File

@ -303,7 +303,6 @@ protected Q_SLOTS:
void slotOpacityChanged(KWin::Toplevel *t, qreal oldOpacity);
void slotClientModalityChanged();
void slotGeometryShapeChanged(KWin::Toplevel *t, const QRect &old);
void slotFrameGeometryChanged(Toplevel *toplevel, const QRect &oldGeometry);
void slotPaddingChanged(KWin::Toplevel *t, const QRect &old);
void slotWindowDamaged(KWin::Toplevel *t, const QRect& r);

View File

@ -1,7 +1,7 @@
# KI18N Translation Domain for this library
add_definitions(-DTRANSLATION_DOMAIN=\"kwin_effects\" -DEFFECT_BUILTINS)
include_directories(${KWin_SOURCE_DIR}) # for xcbutils.h
include_directories(${KWIN_SOURCE_DIR}) # for xcbutils.h
set(kwin_effect_OWN_LIBS
kwineffects

View File

@ -1,4 +1,4 @@
#! /usr/bin/env bash
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT `find . -name \*.cpp -o -name \*.h` -o $podir/kwin_effects.pot
$XGETTEXT `find . -name \*.cpp` -o $podir/kwin_effects.pot
rm -f rc.cpp

View File

@ -36,10 +36,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMouseEvent>
#include <QTimer>
#include <QVector2D>
#include <QMatrix4x4>
#include <QQuickItem>
#include <QQmlContext>
#include <QQmlEngine>
#include <QQuickItem>
#include <KWayland/Server/surface_interface.h>
#include <cmath>
@ -85,7 +85,7 @@ DesktopGridEffect::DesktopGridEffect()
connect(effects, &EffectsHandler::windowClosed, this, &DesktopGridEffect::slotWindowClosed);
connect(effects, &EffectsHandler::windowDeleted, this, &DesktopGridEffect::slotWindowDeleted);
connect(effects, &EffectsHandler::numberDesktopsChanged, this, &DesktopGridEffect::slotNumberDesktopsChanged);
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &DesktopGridEffect::slotWindowFrameGeometryChanged);
connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &DesktopGridEffect::slotWindowGeometryShapeChanged);
connect(effects, &EffectsHandler::numberScreensChanged, this, &DesktopGridEffect::setup);
connect(effects, &EffectsHandler::screenAboutToLock, this, [this]() {
@ -102,6 +102,9 @@ DesktopGridEffect::DesktopGridEffect()
DesktopGridEffect::~DesktopGridEffect()
{
foreach (DesktopButtonsView *view, m_desktopButtonsViews)
view->deleteLater();
m_desktopButtonsViews.clear();
}
void DesktopGridEffect::reconfigure(ReconfigureFlags)
@ -191,9 +194,19 @@ void DesktopGridEffect::paintScreen(int mask, const QRegion &region, ScreenPaint
}
// paint the add desktop button
for (EffectQuickScene *view : m_desktopButtons) {
view->rootItem()->setOpacity(timeline.currentValue());
effects->renderEffectQuickView(view);
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
if (!view->effectWindow) {
EffectWindow *viewWindow = effects->findWindow(view->winId());
if (viewWindow) {
viewWindow->setData(WindowForceBlurRole, QVariant(true));
view->effectWindow = viewWindow;
}
}
if (view->effectWindow) {
WindowPaintData d(view->effectWindow);
d.multiplyOpacity(timeline.currentValue());
effects->drawWindow(view->effectWindow, PAINT_WINDOW_TRANSLUCENT, infiniteRegion(), d);
}
}
if (isUsingPresentWindows() && windowMove && wasWindowMove) {
@ -300,6 +313,14 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
(sourceDesktop != highlightedDesktop && highlightedDesktop == paintingDesktop))) {
return; // will be painted on top of all other windows
}
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
if (view->effectWindow == w) {
if (!activated && timeline.currentValue() < 0.05) {
view->hide();
}
return; // will be painted on top of all other windows
}
}
qreal xScale = data.xScale();
qreal yScale = data.yScale();
@ -423,6 +444,12 @@ void DesktopGridEffect::slotWindowDeleted(EffectWindow* w)
{
if (w == windowMove)
windowMove = nullptr;
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
if (view->effectWindow && view->effectWindow == w) {
view->effectWindow = nullptr;
break;
}
}
if (isUsingPresentWindows()) {
for (QList<WindowMotionManager>::iterator it = m_managers.begin(),
end = m_managers.end(); it != end; ++it) {
@ -431,7 +458,7 @@ void DesktopGridEffect::slotWindowDeleted(EffectWindow* w)
}
}
void DesktopGridEffect::slotWindowFrameGeometryChanged(EffectWindow* w, const QRect& old)
void DesktopGridEffect::slotWindowGeometryShapeChanged(EffectWindow* w, const QRect& old)
{
Q_UNUSED(old)
if (!activated)
@ -455,9 +482,11 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
return;
QMouseEvent* me = static_cast< QMouseEvent* >(e);
if (!(wasWindowMove || wasDesktopMove)) {
for (EffectQuickScene *view : m_desktopButtons) {
view->forwardMouseEvent(me);
if (e->isAccepted()) {
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
if (view->geometry().contains(me->pos())) {
const QPoint widgetPos = view->mapFromGlobal(me->pos());
QMouseEvent event(me->type(), widgetPos, me->pos(), me->button(), me->buttons(), me->modifiers());
view->windowInputMouseEvent(&event);
return;
}
}
@ -1031,7 +1060,7 @@ void DesktopGridEffect::setActive(bool active)
[this] {
if (activated)
return;
for (EffectQuickScene *view : m_desktopButtons) {
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
view->hide();
}
}
@ -1096,46 +1125,33 @@ void DesktopGridEffect::setup()
}
}
}
bool enableAdd = effects->numberOfDesktops() < 20;
bool enableRemove = effects->numberOfDesktops() > 1;
auto it = m_desktopButtons.begin();
QVector<DesktopButtonsView*>::iterator it = m_desktopButtonsViews.begin();
const int n = DesktopGridConfig::showAddRemove() ? effects->numScreens() : 0;
for (int i = 0; i < n; ++i) {
EffectQuickScene *view;
QSize size;
if (it == m_desktopButtons.end()) {
view = new EffectQuickScene(this);
connect(view, &EffectQuickView::repaintNeeded, this, []() {
effects->addRepaintFull();
});
view->rootContext()->setContextProperty("effects", effects);
view->setSource(QUrl(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/effects/desktopgrid/main.qml"))));
QQuickItem *rootItem = view->rootItem();
if (!rootItem) {
delete view;
continue;
}
m_desktopButtons.append(view);
it = m_desktopButtons.end(); // changed through insert!
size = QSize(rootItem->implicitWidth(), rootItem->implicitHeight());
DesktopButtonsView *view;
if (it == m_desktopButtonsViews.end()) {
view = new DesktopButtonsView();
m_desktopButtonsViews.append(view);
it = m_desktopButtonsViews.end(); // changed through insert!
connect(view, &DesktopButtonsView::addDesktop, this, &DesktopGridEffect::slotAddDesktop);
connect(view, &DesktopButtonsView::removeDesktop, this, &DesktopGridEffect::slotRemoveDesktop);
} else {
view = *it;
++it;
size = view->size();
}
view->setAddDesktopEnabled(enableAdd);
view->setRemoveDesktopEnabled(enableRemove);
const QRect screenRect = effects->clientArea(FullScreenArea, i, 1);
view->show(); // pseudo show must happen before geometry changes
const QPoint position(screenRect.right() - border/3 - size.width(),
screenRect.bottom() - border/3 - size.height());
view->setGeometry(QRect(position, size));
view->setPosition(screenRect.right() - border/3 - view->width(),
screenRect.bottom() - border/3 - view->height());
}
while (it != m_desktopButtons.end()) {
while (it != m_desktopButtonsViews.end()) {
(*it)->deleteLater();
it = m_desktopButtons.erase(it);
it = m_desktopButtonsViews.erase(it);
}
}
@ -1281,6 +1297,12 @@ void DesktopGridEffect::slotNumberDesktopsChanged(uint old)
if (!activated)
return;
const uint desktop = effects->numberOfDesktops();
bool enableAdd = desktop < 20;
bool enableRemove = desktop > 1;
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
view->setAddDesktopEnabled(enableAdd);
view->setRemoveDesktopEnabled(enableRemove);
}
if (old < desktop)
desktopsAdded(old);
else
@ -1421,5 +1443,76 @@ bool DesktopGridEffect::isRelevantWithPresentWindows(EffectWindow *w) const
return true;
}
/************************************************
* DesktopButtonView
************************************************/
DesktopButtonsView::DesktopButtonsView(QWindow *parent)
: QQuickView(parent)
, effectWindow(nullptr)
, m_visible(false)
, m_posIsValid(false)
{
setFlags(Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint);
setColor(Qt::transparent);
rootContext()->setContextProperty(QStringLiteral("add"), QVariant(true));
rootContext()->setContextProperty(QStringLiteral("remove"), QVariant(true));
setSource(QUrl(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/effects/desktopgrid/main.qml"))));
if (QObject *item = rootObject()->findChild<QObject*>(QStringLiteral("addButton"))) {
connect(item, SIGNAL(clicked()), SIGNAL(addDesktop()));
}
if (QObject *item = rootObject()->findChild<QObject*>(QStringLiteral("removeButton"))) {
connect(item, SIGNAL(clicked()), SIGNAL(removeDesktop()));
}
}
void DesktopButtonsView::windowInputMouseEvent(QMouseEvent *e)
{
if (e->type() == QEvent::MouseMove) {
mouseMoveEvent(e);
} else if (e->type() == QEvent::MouseButtonPress) {
mousePressEvent(e);
} else if (e->type() == QEvent::MouseButtonDblClick) {
mouseDoubleClickEvent(e);
} else if (e->type() == QEvent::MouseButtonRelease) {
mouseReleaseEvent(e);
}
}
void DesktopButtonsView::setAddDesktopEnabled(bool enable)
{
rootContext()->setContextProperty(QStringLiteral("add"), QVariant(enable));
}
void DesktopButtonsView::setRemoveDesktopEnabled(bool enable)
{
rootContext()->setContextProperty(QStringLiteral("remove"), QVariant(enable));
}
bool DesktopButtonsView::isVisible() const
{
return m_visible;
}
void DesktopButtonsView::show()
{
if (!m_visible && m_posIsValid) {
setPosition(m_pos);
m_posIsValid = false;
}
m_visible = true;
QQuickView::show();
}
void DesktopButtonsView::hide()
{
if (!m_posIsValid) {
m_pos = position();
m_posIsValid = true;
setPosition(-width(), -height());
}
m_visible = false;
}
} // namespace

View File

@ -25,14 +25,35 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwineffects.h>
#include <QObject>
#include <QTimeLine>
#include "kwineffectquickview.h"
#include <QQuickView>
namespace KWin
{
class PresentWindowsEffectProxy;
class DesktopButtonsView : public QQuickView
{
Q_OBJECT
public:
explicit DesktopButtonsView(QWindow *parent = nullptr);
void windowInputMouseEvent(QMouseEvent* e);
void setAddDesktopEnabled(bool enable);
void setRemoveDesktopEnabled(bool enable);
bool isVisible() const;
void show();
void hide();
public:
EffectWindow *effectWindow;
Q_SIGNALS:
void addDesktop();
void removeDesktop();
private:
bool m_visible;
QPoint m_pos;
bool m_posIsValid;
};
class DesktopGridEffect
: public Effect
{
@ -94,7 +115,7 @@ private Q_SLOTS:
void slotWindowClosed(KWin::EffectWindow *w);
void slotWindowDeleted(KWin::EffectWindow *w);
void slotNumberDesktopsChanged(uint old);
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
private:
QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const;
@ -161,7 +182,7 @@ private:
QRect m_windowMoveGeometry;
QPoint m_windowMoveStartPoint;
QVector<EffectQuickScene*> m_desktopButtons;
QVector<DesktopButtonsView*> m_desktopButtonsViews;
QAction *m_activateAction;

View File

@ -18,20 +18,32 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
import QtQuick 2.0
import QtQuick.Layouts 1.2
import org.kde.plasma.components 3.0 as Plasma
import org.kde.plasma.components 2.0 as Plasma
RowLayout {
Plasma.Button {
objectName: "removeButton"
enabled: effects.desktops > 1
icon.name: "list-remove"
onClicked: effects.desktops--
}
Plasma.Button {
objectName: "addButton"
enabled: effects.desktops < 20
icon.name: "list-add"
onClicked: effects.desktops++
Item {
width: childrenRect.width
height: childrenRect.height
Plasma.ButtonRow {
exclusive: false
width: childrenRect.width
height: childrenRect.height
Plasma.Button {
id: removeButton
objectName: "removeButton"
enabled: remove
width: height
font.bold: true
font.pointSize: 20
text: "-"
}
Plasma.Button {
id: addButton
objectName: "addButton"
enabled: add
font.bold: true
font.pointSize: 20
width: height
text: "+"
}
}
}

View File

@ -62,7 +62,7 @@ InvertEffectConfig::InvertEffectConfig(QWidget* parent, const QVariantList& args
mShortcutEditor = new KShortcutsEditor(actionCollection, this,
KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed);
connect(mShortcutEditor, &KShortcutsEditor::keyChange, this, &InvertEffectConfig::markAsChanged);
connect(mShortcutEditor, &KShortcutsEditor::keyChange, this, qOverload<>(&InvertEffectConfig::changed));
layout->addWidget(mShortcutEditor);
load();

View File

@ -2,7 +2,6 @@
Name=Login
Name[af]=Aanteken
Name[ar]=ولوج
Name[ast]=Aniciu de sesión
Name[be]=Уваход
Name[be@latin]=Uvachod
Name[bg]=Вход

View File

@ -1,6 +1,5 @@
[Desktop Entry]
Name=Logout
Name[ast]=Zarru de sesión
Name[ca]=Sortida
Name[ca@valencia]=Eixida
Name[cs]=Odhlášení

View File

@ -61,7 +61,7 @@ LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVaria
LookingGlassConfig::instance(KWIN_CONFIG);
addConfig(LookingGlassConfig::self(), m_ui);
connect(m_ui->editor, &KShortcutsEditor::keyChange, this, &LookingGlassEffectConfig::markAsChanged);
connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&LookingGlassEffectConfig::changed));
// Shortcut config. The shortcut belongs to the component "kwin"!
m_actionCollection = new KActionCollection(this, QStringLiteral("kwin"));

View File

@ -7,7 +7,6 @@ X-KDE-ParentComponents=magiclamp
Name=Magic Lamp
Name[ar]=المصباح السحري
Name[ast]=Llámpara máxica
Name[be@latin]=Mahičnaja lampa
Name[bg]=Вълшебна лампа
Name[bs]=Magična lampa

View File

@ -61,7 +61,7 @@ MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList
MagnifierConfig::instance(KWIN_CONFIG);
addConfig(MagnifierConfig::self(), m_ui);
connect(m_ui->editor, &KShortcutsEditor::keyChange, this, &MagnifierEffectConfig::markAsChanged);
connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&MagnifierEffectConfig::changed));
// Shortcut config. The shortcut belongs to the component "kwin"!
m_actionCollection = new KActionCollection(this, QStringLiteral("kwin"));

View File

@ -93,7 +93,7 @@ var maximizeEffect = {
},
init: function () {
effect.configChanged.connect(maximizeEffect.loadConfig);
effects.windowFrameGeometryChanged.connect(maximizeEffect.geometryChange);
effects.windowGeometryShapeChanged.connect(maximizeEffect.geometryChange);
effects.windowMaximizedStateChanged.connect(maximizeEffect.maximizeChanged);
effect.animationEnded.connect(maximizeEffect.restoreForceBlurState);
}

View File

@ -47,7 +47,6 @@ Comment[zh_CN]=窗口最大化/从最大化恢复时显示动画
Comment[zh_TW]=視窗最大化/回復時的動畫
Icon=preferences-system-windows-effect-maximize
Name=Maximize
Name[ast]=Maximización
Name[bs]=Maksimiziraj
Name[ca]=Maximitza
Name[ca@valencia]=Maximitza

View File

@ -26,7 +26,7 @@ var morphingEffect = {
morphingEffect.duration = animationTime(150);
},
handleFrameGeometryChanged: function (window, oldGeometry) {
geometryChange: function (window, oldGeometry) {
//only tooltips and notifications
if (!window.tooltip && !window.notification && !window.criticalNotification) {
return;
@ -38,6 +38,13 @@ var morphingEffect = {
//don't cross the whole screen: ugly
var distance = Math.abs(oldGeometry.x - newGeometry.x) + Math.abs(oldGeometry.y - newGeometry.y);
if (newGeometry.x == oldGeometry.x &&
newGeometry.y == oldGeometry.y &&
newGeometry.width == oldGeometry.width &&
newGeometry.height == oldGeometry.height) {
return;
}
if (distance > (newGeometry.width + newGeometry.height) * 2) {
if (window.moveAnimation) {
delete window.moveAnimation;
@ -130,7 +137,7 @@ var morphingEffect = {
init: function () {
effect.configChanged.connect(morphingEffect.loadConfig);
effects.windowFrameGeometryChanged.connect(morphingEffect.handleFrameGeometryChanged);
effects.windowGeometryShapeChanged.connect(morphingEffect.geometryChange);
}
};
morphingEffect.init();

View File

@ -6,7 +6,6 @@ X-KDE-Library=kwin_mouseclick_config
X-KDE-ParentComponents=mouseclick
Name=Mouse Click Animation
Name[ast]=Animación al calcar col mur
Name[bs]=Animacija klika mišem
Name[ca]=Animació en fer clic amb el ratolí
Name[ca@valencia]=Animació de clic de ratolí

View File

@ -101,7 +101,7 @@ PresentWindowsEffect::PresentWindowsEffect()
connect(effects, &EffectsHandler::windowAdded, this, &PresentWindowsEffect::slotWindowAdded);
connect(effects, &EffectsHandler::windowClosed, this, &PresentWindowsEffect::slotWindowClosed);
connect(effects, &EffectsHandler::windowDeleted, this, &PresentWindowsEffect::slotWindowDeleted);
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &PresentWindowsEffect::slotWindowFrameGeometryChanged);
connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &PresentWindowsEffect::slotWindowGeometryShapeChanged);
connect(effects, &EffectsHandler::propertyNotify, this, &PresentWindowsEffect::slotPropertyNotify);
connect(effects, &EffectsHandler::numberScreensChanged, this,
[this] {
@ -497,7 +497,7 @@ void PresentWindowsEffect::slotWindowDeleted(EffectWindow *w)
m_motionManager.unmanage(w);
}
void PresentWindowsEffect::slotWindowFrameGeometryChanged(EffectWindow* w, const QRect& old)
void PresentWindowsEffect::slotWindowGeometryShapeChanged(EffectWindow* w, const QRect& old)
{
Q_UNUSED(old)
if (!m_activated)

View File

@ -208,7 +208,7 @@ public Q_SLOTS:
void slotWindowAdded(KWin::EffectWindow *w);
void slotWindowClosed(KWin::EffectWindow *w);
void slotWindowDeleted(KWin::EffectWindow *w);
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
// atoms
void slotPropertyNotify(KWin::EffectWindow* w, long atom);

View File

@ -8,7 +8,6 @@ X-KDE-ParentComponents=presentwindows
Name=Present Windows
Name[af]=Wys vensters
Name[ar]=النوافذ الحاضرة
Name[ast]=Presentación de ventanes
Name[be]=Існуючыя вокны
Name[be@latin]=Najaŭnyja vokny
Name[bg]=Представяне на прозорци

View File

@ -7,7 +7,6 @@ X-KDE-ParentComponents=resize
Name=Resize Window
Name[ar]=غير حجم النافذة
Name[ast]=Redimensión de ventanes
Name[bg]=Преоразмеряване на прозорци
Name[bs]=Preuveličanje prozora
Name[ca]=Redimensionament de les finestres

View File

@ -57,7 +57,7 @@ ShowPaintEffectConfig::ShowPaintEffectConfig(QWidget *parent, const QVariantList
m_ui->shortcutsEditor->addCollection(actionCollection);
connect(m_ui->shortcutsEditor, &KShortcutsEditor::keyChange,
this, &ShowPaintEffectConfig::markAsChanged);
this, qOverload<>(&ShowPaintEffectConfig::changed));
load();
}

View File

@ -40,7 +40,7 @@ Name[km]=ស្លាយ
Name[kn]=ಜಾರು
Name[ko]=슬라이드
Name[ku]=Xîş Bike
Name[lt]=Slydimas
Name[lt]=Slidimas
Name[lv]=Slīdēt
Name[mai]=स्लाइड
Name[ml]=തെന്നിമാറുക

View File

@ -81,7 +81,7 @@ SnapHelperEffect::SnapHelperEffect()
connect(effects, &EffectsHandler::windowClosed, this, &SnapHelperEffect::slotWindowClosed);
connect(effects, &EffectsHandler::windowStartUserMovedResized, this, &SnapHelperEffect::slotWindowStartUserMovedResized);
connect(effects, &EffectsHandler::windowFinishUserMovedResized, this, &SnapHelperEffect::slotWindowFinishUserMovedResized);
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &SnapHelperEffect::slotWindowFrameGeometryChanged);
connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &SnapHelperEffect::slotWindowGeometryShapeChanged);
}
SnapHelperEffect::~SnapHelperEffect()
@ -316,7 +316,7 @@ void SnapHelperEffect::slotWindowFinishUserMovedResized(EffectWindow *w)
effects->addRepaint(computeDirtyRegion(m_geometry));
}
void SnapHelperEffect::slotWindowFrameGeometryChanged(EffectWindow *w, const QRect &old)
void SnapHelperEffect::slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old)
{
if (w != m_window) {
return;

View File

@ -47,7 +47,7 @@ private Q_SLOTS:
void slotWindowClosed(EffectWindow *w);
void slotWindowStartUserMovedResized(EffectWindow *w);
void slotWindowFinishUserMovedResized(EffectWindow *w);
void slotWindowFrameGeometryChanged(EffectWindow *w, const QRect &old);
void slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old);
private:
QRect m_geometry;

View File

@ -44,7 +44,7 @@ ThumbnailAsideEffect::ThumbnailAsideEffect()
connect(a, &QAction::triggered, this, &ThumbnailAsideEffect::toggleCurrentThumbnail);
connect(effects, &EffectsHandler::windowClosed, this, &ThumbnailAsideEffect::slotWindowClosed);
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &ThumbnailAsideEffect::slotWindowFrameGeometryChanged);
connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &ThumbnailAsideEffect::slotWindowGeometryShapeChanged);
connect(effects, &EffectsHandler::windowDamaged, this, &ThumbnailAsideEffect::slotWindowDamaged);
connect(effects, &EffectsHandler::screenLockingChanged, this, &ThumbnailAsideEffect::repaintAll);
reconfigure(ReconfigureAll);
@ -92,7 +92,7 @@ void ThumbnailAsideEffect::slotWindowDamaged(EffectWindow* w, const QRect&)
}
}
void ThumbnailAsideEffect::slotWindowFrameGeometryChanged(EffectWindow* w, const QRect& old)
void ThumbnailAsideEffect::slotWindowGeometryShapeChanged(EffectWindow* w, const QRect& old)
{
foreach (const Data & d, windows) {
if (d.window == w) {

View File

@ -65,7 +65,7 @@ public:
private Q_SLOTS:
void toggleCurrentThumbnail();
void slotWindowClosed(KWin::EffectWindow *w);
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
void slotWindowDamaged(KWin::EffectWindow* w, const QRect& damage);
bool isActive() const override;
void repaintAll();

View File

@ -1,6 +1,5 @@
[Desktop Entry]
Name=Window Aperture
Name[ast]=Apertura de ventanes
Name[ca]=Obertura de la finestra
Name[ca@valencia]=Obertura de la finestra
Name[cs]=Mřížka oken

View File

@ -62,7 +62,7 @@ WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList&
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::SHIFT + Qt::Key_F11);
myUi->shortcuts->addCollection(myActionCollection);
connect(myUi->shortcuts, &KShortcutsEditor::keyChange, this, &WindowGeometryConfig::markAsChanged);
connect(myUi->shortcuts, &KShortcutsEditor::keyChange, this, qOverload<>(&WindowGeometryConfig::changed));
addConfig(WindowGeometryConfiguration::self(), myUi);

View File

@ -8,7 +8,6 @@ X-KDE-ParentComponents=wobblywindows
Name=Wobbly Windows
Name[af]=Wobbly Windows
Name[ar]=نوافذ متذبذبة
Name[ast]=Ventanes cimblantes
Name[be@latin]=Skryŭleńnie akon
Name[bg]=Желирани прозорци
Name[bs]=Lelujavi prozori

View File

@ -9,7 +9,6 @@ Name=Zoom
Name[af]=Zoem
Name[ar]=تكبير
Name[as]=ডাঙৰকৈ প্ৰদৰ্শন
Name[ast]=Zoom
Name[be]=Маштабаванне
Name[be@latin]=Maštab
Name[bg]=Мащабиране

View File

@ -1312,7 +1312,7 @@ void Unmanaged::configureNotifyEvent(xcb_configure_notify_event_t *e)
addWorkspaceRepaint(visibleRect()); // damage old area
QRect old = m_frameGeometry;
m_frameGeometry = newgeom;
emit frameGeometryChanged(this, old); // update shadow region
emit geometryChanged(); // update shadow region
addRepaintFull();
if (old.size() != m_frameGeometry.size())
discardWindowPixmap();

View File

@ -759,16 +759,7 @@ public:
return input()->shortcuts()->processAxis(event->modifiers(), direction);
}
bool keyEvent(QKeyEvent *event) override {
if (event->key() == Qt::Key_PowerOff) {
if (event->type() == QEvent::KeyPress) {
m_powerOffPress = event->timestamp();
} else if (event->type() == QEvent::KeyRelease) {
const uint duration = (event->timestamp() - m_powerOffPress);
const Qt::Key key = duration > 1000 ? Qt::Key_PowerDown : Qt::Key_PowerOff;
const auto shortcuts = static_cast<KeyEvent*>(event)->modifiersRelevantForGlobalShortcuts();
return input()->shortcuts()->processKey(shortcuts, key | (event->key() & ~Qt::KeyboardModifierMask));
}
} else if (event->type() == QEvent::KeyPress) {
if (event->type() == QEvent::KeyPress) {
return input()->shortcuts()->processKey(static_cast<KeyEvent*>(event)->modifiersRelevantForGlobalShortcuts(), event->key());
}
return false;
@ -793,9 +784,6 @@ public:
input()->shortcuts()->processSwipeEnd();
return false;
}
private:
uint m_powerOffPress;
};

View File

@ -31,7 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Q_DECLARE_METATYPE(NET::WindowType)
static const QByteArray s_skipClosePropertyName = QByteArrayLiteral("KWIN_SKIP_CLOSE_ANIMATION");
static const QByteArray s_shadowEnabledPropertyName = QByteArrayLiteral("kwin_shadow_enabled");
namespace KWin
{
@ -63,7 +62,6 @@ InternalClient::InternalClient(QWindow *window)
setOpacity(m_internalWindow->opacity());
setSkipCloseAnimation(m_internalWindow->property(s_skipClosePropertyName).toBool());
// Create scene window, effect window, and update server-side shadow.
setupCompositing();
updateColorScheme();
@ -88,9 +86,6 @@ bool InternalClient::eventFilter(QObject *watched, QEvent *event)
if (pe->propertyName() == s_skipClosePropertyName) {
setSkipCloseAnimation(m_internalWindow->property(s_skipClosePropertyName).toBool());
}
if (pe->propertyName() == s_shadowEnabledPropertyName) {
updateShadow();
}
if (pe->propertyName() == "kwin_windowType") {
m_windowType = m_internalWindow->property("kwin_windowType").value<NET::WindowType>();
workspace()->updateClientArea();
@ -208,6 +203,26 @@ bool InternalClient::isCloseable() const
return true;
}
bool InternalClient::isFullScreenable() const
{
return false;
}
bool InternalClient::isFullScreen() const
{
return false;
}
bool InternalClient::isMaximizable() const
{
return false;
}
bool InternalClient::isMinimizable() const
{
return false;
}
bool InternalClient::isMovable() const
{
return true;
@ -272,6 +287,16 @@ quint32 InternalClient::windowId() const
return m_windowId;
}
MaximizeMode InternalClient::maximizeMode() const
{
return MaximizeRestore;
}
QRect InternalClient::geometryRestore() const
{
return m_maximizeRestoreGeometry;
}
bool InternalClient::isShown(bool shaded_is_shown) const
{
Q_UNUSED(shaded_is_shown)
@ -340,6 +365,11 @@ void InternalClient::setFrameGeometry(int x, int y, int w, int h, ForceGeometry_
}
}
void InternalClient::setGeometryRestore(const QRect &rect)
{
m_maximizeRestoreGeometry = rect;
}
bool InternalClient::supportsWindowRules() const
{
return false;
@ -362,6 +392,17 @@ void InternalClient::takeFocus()
{
}
bool InternalClient::userCanSetFullScreen() const
{
return false;
}
void InternalClient::setFullScreen(bool set, bool user)
{
Q_UNUSED(set)
Q_UNUSED(user)
}
void InternalClient::setNoBorder(bool set)
{
if (!userCanSetNoBorder()) {
@ -486,6 +527,15 @@ bool InternalClient::belongsToSameApplication(const AbstractClient *other, SameA
return qobject_cast<const InternalClient *>(other) != nullptr;
}
void InternalClient::changeMaximize(bool horizontal, bool vertical, bool adjust)
{
Q_UNUSED(horizontal)
Q_UNUSED(vertical)
Q_UNUSED(adjust)
// Internal clients are not maximizable.
}
void InternalClient::destroyDecoration()
{
if (!isDecorated()) {
@ -573,11 +623,9 @@ void InternalClient::commitGeometry(const QRect &rect)
addWorkspaceRepaint(visibleRect());
syncGeometryToInternalWindow();
if (frameGeometryBeforeUpdateBlocking() != frameGeometry()) {
emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking());
}
emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking());
const QRect oldGeometry = frameGeometryBeforeUpdateBlocking();
updateGeometryBeforeUpdateBlocking();
emit geometryShapeChanged(this, oldGeometry);
if (isResize()) {
performMoveResize();

View File

@ -53,6 +53,10 @@ public:
QByteArray windowRole() const override;
void closeWindow() override;
bool isCloseable() const override;
bool isFullScreenable() const override;
bool isFullScreen() const override;
bool isMaximizable() const override;
bool isMinimizable() const override;
bool isMovable() const override;
bool isMovableAcrossScreens() const override;
bool isResizable() const override;
@ -64,6 +68,8 @@ public:
bool isInputMethod() const override;
bool isOutline() const override;
quint32 windowId() const override;
MaximizeMode maximizeMode() const override;
QRect geometryRestore() const override;
bool isShown(bool shaded_is_shown) const override;
bool isHiddenInternal() const override;
void hideClient(bool hide) override;
@ -71,10 +77,13 @@ public:
void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
using AbstractClient::setFrameGeometry;
void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) override;
void setGeometryRestore(const QRect &rect) override;
bool supportsWindowRules() const override;
AbstractClient *findModal(bool allow_itself = false) override;
void setOnAllActivities(bool set) override;
void takeFocus() override;
bool userCanSetFullScreen() const override;
void setFullScreen(bool set, bool user = true) override;
void setNoBorder(bool set) override;
void updateDecoration(bool check_workspace_pos, bool force = false) override;
void updateColorScheme() override;
@ -88,6 +97,7 @@ public:
protected:
bool acceptsFocus() const override;
bool belongsToSameApplication(const AbstractClient *other, SameApplicationChecks checks) const override;
void changeMaximize(bool horizontal, bool vertical, bool adjust) override;
void destroyDecoration() override;
void doMove(int x, int y) override;
void doResizeSync() override;
@ -103,6 +113,7 @@ private:
void updateInternalWindowGeometry();
QWindow *m_internalWindow = nullptr;
QRect m_maximizeRestoreGeometry;
QSize m_clientSize = QSize(0, 0);
QString m_captionNormal;
QString m_captionSuffix;

View File

@ -1,14 +1,14 @@
# KI18N Translation Domain for this library
add_definitions(-DTRANSLATION_DOMAIN=\"kcmkwincommon\")
include_directories(${KWin_SOURCE_DIR}/effects)
include_directories(${KWIN_SOURCE_DIR}/effects)
set(kcmkwincommon_SRC
effectsmodel.cpp
)
qt5_add_dbus_interface(kcmkwincommon_SRC
${KWin_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface
${KWIN_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface
)
add_library(kcmkwincommon SHARED ${kcmkwincommon_SRC})

View File

@ -14,7 +14,7 @@ set(kwincomposing_SRC
)
qt5_add_dbus_interface(kwincomposing_SRC
${KWin_SOURCE_DIR}/org.kde.kwin.Compositing.xml kwin_compositing_interface
${KWIN_SOURCE_DIR}/org.kde.kwin.Compositing.xml kwin_compositing_interface
)
ki18n_wrap_ui(kwincomposing_SRC compositing.ui)

View File

@ -13,7 +13,6 @@ X-KDE-System-Settings-Parent-Category=display
X-KDE-Weight=60
Name=Compositor
Name[ast]=Compositor
Name[bs]=Compositor
Name[ca]=Compositor
Name[ca@valencia]=Compositor
@ -111,6 +110,7 @@ X-KDE-Keywords[et]=kwin,aken,haldur,komposiit,komposiitor,efekt,3D efektid,ruumi
X-KDE-Keywords[eu]=kwin,leihoa,kudeatzailea,konposatzailea,efektua,3Dtako efektuak,2Dtako efektuak,OpenGL,XRender,bideo ezarpenak,efektu grafikoak,mahaigaineko efektuak
X-KDE-Keywords[fi]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,ikkunointiohjelma,ikkunaohjelma,ikkunanhallinta,tehoste,3D-tehosteet,2D-tehosteet,videoasetukset,graafiset tehosteet,työpöytätehosteet
X-KDE-Keywords[fr]=Gestionnaire de fenêtres KWin, kwin,window,manager,compositeur, effet, effets 3D,effets 2D,OpenGL,XRender,paramétrage video,effets graphiques ,effects du bureau
X-KDE-Keywords[ia]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects
X-KDE-Keywords[it]=kwin,finestra,gestore,composizione,effetto,effetti 3D,effetti 2D,OpenGL,XRender,impostazioni video,effetti grafici,effetti del desktop
X-KDE-Keywords[ko]=kwin,window,manager,compositing,effect,3D effects,2D effects,OpenGL,XRender,video settings,graphical effects,desktop effects,3D 효과,2D 효과,비디오 설정,그래픽 설정,그래픽 효과,데스크톱 효과
X-KDE-Keywords[lt]=kwin,langas,langai,tvarkytuvė,tvarkytuve,komponavimas,kompozicionavimas,efektas,efektai,3D efektai,2D efektai,trimačiai efektai,trimaciai efektai,dvimačiai efektai,dvimaciai efektai,OpenGL,XRender,vaizdo nustatymai,vaizdo nuostatos,video nustatymai,video nuostatos,grafiniai efektai,grafikos efektai,darbalaukio efektai,darbastalio efektai

2
kcmkwin/kwindecoration/Messages.sh Normal file → Executable file
View File

@ -1,2 +1,4 @@
#! /usr/bin/env bash
$EXTRACTRC `find . -name "*.ui"` >> rc.cpp || exit 11
$XGETTEXT `find . -name "*.cpp" -o -name "*.qml"` -o $podir/kcm_kwindecoration.pot
rm -f rc.cpp

View File

@ -14,7 +14,6 @@ X-KDE-Weight=60
Name=Virtual Desktops
Name[ar]=أسطح المكتب الافتراضية
Name[ast]=Escritorios virtuales
Name[bg]=Виртуални работни плотове
Name[bs]=Virtuelne površi
Name[ca]=Escriptoris virtuals

View File

@ -1,7 +1,6 @@
[Desktop Entry]
Name=Virtual Desktops
Name[ar]=أسطح المكتب الافتراضية
Name[ast]=Escritorios virtuales
Name[bg]=Виртуални работни плотове
Name[bs]=Virtuelne površi
Name[ca]=Escriptoris virtuals

View File

@ -107,7 +107,7 @@ X-KDE-Keywords[hu]=kwin,ablak,kezelő,hatás,3D hatás,2D hatás,grafikai hatás
X-KDE-Keywords[id]=kwin,window,pengelola,efek,efek 3D,efek 2D,efek grafik,efek desktop,animasi,beragam animasi,efek pengelola window,efek beralih window,efek beralih desktop,animasi,animasi desktop,driver,pengaturan driver,rendering,render,efek kebalikan,efek seperti gelas,efek kaca pembesar,efek penunjang jepret,efek lacak mouse,efek pembesaran,efek buram,efek lesap,efek desktop lesap,efek hancur,efek petak,efek window sorot,efek login,efek logout,efek lampu ajaib,efek animasi minimalkan,efek tanda mouse,efek skala,efek cuplikan layar,efek lembar,efek geser,efek sembul geser,efek gambar-mini disamping,translusensi,efek translusensi,transparan,efek geometri window,efek window goyang,efek feedback pemulaian,efek induk dialog,efek layar suram,efek geser mundur,eye candy,candy,efek tampilkan FPS,efek tampilkan lukisan,efek alih kotak,efek alih sampul,efek kubus desktop,efek animasi kubus desktop,efek kisi desktop,efek alih lipat,efek window hadir,efek ubah ukuran window,efek kontras latarbelakang
X-KDE-Keywords[it]=kwin,finestra,gestore,effetto,effetti 3D,effetti 2D,effetti grafici,effetti del desktop,animazioni,animazioni varie, effetti del gestore delle finestre,effetto dello scambiafinestre,effetto dello scambiatore di desktop,animazioni,animazioni del desktop,driver,impostazioni driver,rendering,render,effetto invertito,effetto vetro,effetto lente,effetto snap helper,effetto traccia mouse,effetto ingrandimento, effetto sfocatura,effetto dissolvenza,effetto dissolvenza desktop,effetto caduta,effetto planatura,effetto evidenziazione finestra,effetto schermata di accesso, effetto disconnessione,effetto lampada magica,effetto animazione di minimizzazione,effetto marcatura mouse, effetto scalatura,effetto schermata,effetto foglio,effetto diapositiva,effetto scivolamento,effetto miniature nella barra delle applicazioni,effetto miniatura su un lato,translucenza,effetto translucenza, trasparenza,effetto geometria finestra,effetto finestre tremolanti,effetto segnale di avvio,effetto finestra madre,effetto oscura finestra inattiva,effetto oscura schermo,effetto scivola all'indietro,gradevole,effetto gradevole,effetto mostra FPS,effetto ridisegno,effetto scambio cubi,effetto scambio copertina,effetto cubi del desktop,effetto animazione cubi del desktop,effetto griglia desktop,effetto scambiatore con inversione,effetto riquadro,effetto finestra presente,effetto ridimensionamento finestra,effetto contrasto dello sfondo
X-KDE-Keywords[ko]=kwin,window,manager,effect,3D effects,2D effects,graphical effects,desktop effects,animations,various animations,window management effects,window switching effect,desktop switching effect,animations,desktop animations,drivers,driver settings,rendering,render,invert effect,looking glass effect,magnifier effect,snap helper effect,track mouse effect,zoom effect,blur effect,dashboard effect,explosion effect,fade effect,fade desktop effect,fall apart effect,glide effect,highlight window effect,login effect,logout effect,magic lamp effect,minimize animation effect,mouse mark effect,scale in effect,screenshot effect,sheet effect,slide effect,sliding popups effect,taskbar thumbnails effect,thumbnail aside effect,translucency,translucency effect,transparency,window geometry effect,wobbly windows effect,startup feedback effect,dialog parent effect,dim inactive effect,dim screen effect,slide back effect,eye candy,candy,show FPS effect,show paint effect,box switch effect,cover switch effect,desktop cube effect,desktop cube animation effect,desktop grid effect,flip switch effect,outline effect,present windows effect,resize window effect,창,관리자,효과,3D 효과,2D 효과,그래픽 효과,데스크톱 효과,애니메이션,창 관리자,창 관리자 효과,데스크톱 전환,데스크톱 전환 효과,드라이버,드라이버 설정,렌더링,렌더링 설정,애니메이션 속도,투명 유리 효과,확대 축소 효과,흐림 효과,대시보드 효과,페이드 효과,로그인 효과,창 강조 효과,글라이드 효과,로그아웃 효과,램프 효과,시트 효과,최소화 효과,최대화 효과,팝업 효과
X-KDE-Keywords[lt]=kwin,langas,langai,langų,langu,tvarkytuvė,tvarkytuve,efektas,efektai,3D efektai,2D efektai,trimačiai efektai,trimaciai efektai,dvimačiai efektai,dvimaciai efektai,grafiniai efektai,grafikos efektai,darbalaukio efektai,darbastalio efektai,animacijos,įvairios animacijos,ivairios animacijos,langų tvarkymo efektai,langu tvarkymo efektai,langų valdymo efektai,langu valdymo efektai,langų perjungimo efektai,langu perjungimo efektai,langų perjungiklio efektai,langu perjungiklio efektai,darbalaukio perjungimo efektai,darbastalio perjungimo efektai,darbalaukio perjungiklio efektai,darbastalio perjungiklio efektai,animacijos,darbalaukio animacijos,darbastalio animacijos,tvarkyklės,tvarkykles,tvarkyklė,tvarkykle,tvarkyklės nustatymai,tvarkykles nustatymai,tvarkyklės nuostatos,tvarkykles nuostatos,vaizdavimas,atvaizdavimas,invertavimo efektas,invertavimas,didinamojo stiklo efektas,didinamasis stiklas,didintuvo efektas,didintuvas,pritraukimo pagelbiklio efektas,traukimo pagelbiklio efektas,pritraukimo pagelbiklis,traukimo pagelbiklis,sekti pelę,sekti pele,pelės sekimas,peles sekimas,didinimo efektas,didinimas,suliejimo efektas,suliejimas,išblukimo efektas,išblukimas,isblukimo efektas,isblukimas,atsiradimo efektas,atsiradimas,išnykimo efektas,isnykimo efektas,išnykimas,isnykimas,darbalaukio išblukimo efektas,darbalaukio isblukimo efektas,darbastalio išblukimo efektas,darbastalio isblukimo efektas,subyrėjimo efektas,subyrejimo efektas,subyrėjimas,subyrejimas,byrėjimas,byrejimas,sklandymo efektas,sklandymas,lango paryškinimo efektas,lango paryskinimo efektas,langų paryškinimo efektas,langu paryskinimo efektas,lango paryškinimas,lango paryskinimas,langų paryškinimas,langu paryskinimas,prisijungimo efektas,atsijungimo efektas,magiškos lempos efektas,magiskos lempos efektas,magiška lempa,magiska lempa,suskleidimo animacijos efektas,sumažinimo animacijos efektas,sumazinimo animacijos efektas,suskleidimas,sumažinimas,sumazinimas,žymėjimo pele efektas,zymejimo pele efektas,žymėjimas pele,zymejimas pele,mastelio keitimo efektas,mastelio keitimas,ekrano kopijos efektas,ekrano kopija,ekranvaizdžio efektas,ekranvaizdzio efektas,lapo efektas,lapas,slydimo efektas,slydimas,slidimas,slystančių iškylančiųjų langų efektas,slystanciu iskylanciuju langu efektas,slystantys iškylantieji langai,slystantys iskylantieji langai,miniatiūros šone efektas,miniatiuros sone efektas,dalinis permatomumas,dalinio permatomumo efektas,permatomumas,skaidrumas,lango geometrijos efektas,lango geometrija,svirduliuojančių langų efektas,svirduliuojanciu langu efektas,svirduliuojantys langai,paleidimo grįžtamojo ryšio efektas,paleidimo griztamojo rysio efektas,paleidimo grįžtamasis ryšys,paleidimo griztamasis rysys,paleisties grįžtamasis ryšys,paleisties griztamasis rysys,dialogo viršesnio efektas,dialogo virsesnio efektas,dialogo viršesnis,dialogo virsesnis,pasyviųjų pritemdymo efektas,pasyviuju pritemdymo efektas,pasyviųjų pritemdymas,pasyviuju pritemdymas,pasyvių pritemdymo efektas,pasyviu pritemdymo efektas,pasyvių pritemdymas,pasyviu pritemdymas,ekrano pritemdymo efektas,ekrano pritemdymas,slydimo atgal efektas,slydimas atgal,grožybės,grozybes,gražu,grazu,FPS rodymo efektas,FPS rodymas,kadr./sek.,kadr/sek,kadr./s,kadr/s,kadr./sek. rodymas,piešimo rodymo efektas,piesimo rodymo efektas,piešimo rodymas,piesimo rodymas,viršelių perjungiklio efektas,viršelio perjungiklio efektas,virseliu perjungiklio efektas,viršelių perjungiklis,virseliu perjungiklis,višelių perjungimas,virseliu perjungimas,darbalaukio kubo efektas,darbastalio kubo efektas,darbalaukio kubas,darbastalio kubas,darbalaukio kubo animacijos efektas,darbastalio kubo animacijos efektas,darbalaukio kubo animacija,darbastalio kubo animacija,darbalaukio tinklelio efektas,darbastalio tinklelio efektas,darbalaukio tinklelis,darbastalio tinklelis,kartotekos pavidalo langų perjungiklio efektas,kartotekos pavidalo langu perjungiklio efektas,kartotekos pavidalo langų perjungiklis,kartotekos pavidalo langu perjungiklis,langų pateikimo efektas,langu pateikimo efektas,langų pateikimas,langu pateikimas,langų dydžio keitimo efektas,lango dydžio keitimo efektas,langu dydzio keitimo efektas,lango dydzio keitimo efektas,fono kontrasto efektas,fono kontrastas
X-KDE-Keywords[lt]=kwin,langas,langai,langų,langu,tvarkytuvė,tvarkytuve,efektas,efektai,3D efektai,2D efektai,trimačiai efektai,trimaciai efektai,dvimačiai efektai,dvimaciai efektai,grafiniai efektai,grafikos efektai,darbalaukio efektai,darbastalio efektai,animacijos,įvairios animacijos,ivairios animacijos,langų tvarkymo efektai,langu tvarkymo efektai,langų valdymo efektai,langu valdymo efektai,langų perjungimo efektai,langu perjungimo efektai,langų perjungiklio efektai,langu perjungiklio efektai,darbalaukio perjungimo efektai,darbastalio perjungimo efektai,darbalaukio perjungiklio efektai,darbastalio perjungiklio efektai,animacijos,darbalaukio animacijos,darbastalio animacijos,tvarkyklės,tvarkykles,tvarkyklė,tvarkykle,tvarkyklės nustatymai,tvarkykles nustatymai,tvarkyklės nuostatos,tvarkykles nuostatos,vaizdavimas,atvaizdavimas,invertavimo efektas,invertavimas,didinamojo stiklo efektas,didinamasis stiklas,didintuvo efektas,didintuvas,pritraukimo pagelbiklio efektas,traukimo pagelbiklio efektas,pritraukimo pagelbiklis,traukimo pagelbiklis,sekti pelę,sekti pele,pelės sekimas,peles sekimas,didinimo efektas,didinimas,suliejimo efektas,suliejimas,išblukimo efektas,išblukimas,isblukimo efektas,isblukimas,atsiradimo efektas,atsiradimas,išnykimo efektas,isnykimo efektas,išnykimas,isnykimas,darbalaukio išblukimo efektas,darbalaukio isblukimo efektas,darbastalio išblukimo efektas,darbastalio isblukimo efektas,subyrėjimo efektas,subyrejimo efektas,subyrėjimas,subyrejimas,byrėjimas,byrejimas,sklandymo efektas,sklandymas,lango paryškinimo efektas,lango paryskinimo efektas,langų paryškinimo efektas,langu paryskinimo efektas,lango paryškinimas,lango paryskinimas,langų paryškinimas,langu paryskinimas,prisijungimo efektas,atsijungimo efektas,magiškos lempos efektas,magiskos lempos efektas,magiška lempa,magiska lempa,suskleidimo animacijos efektas,sumažinimo animacijos efektas,sumazinimo animacijos efektas,suskleidimas,sumažinimas,sumazinimas,žymėjimo pele efektas,zymejimo pele efektas,žymėjimas pele,zymejimas pele,mastelio keitimo efektas,mastelio keitimas,ekrano kopijos efektas,ekrano kopija,ekranvaizdžio efektas,ekranvaizdzio efektas,lapo efektas,lapas,slidimo efektas,slidimas,slystančių iškylančiųjų langų efektas,slystanciu iskylanciuju langu efektas,slystantys iškylantieji langai,slystantys iskylantieji langai,miniatiūros šone efektas,miniatiuros sone efektas,dalinis permatomumas,dalinio permatomumo efektas,permatomumas,skaidrumas,lango geometrijos efektas,lango geometrija,svirduliuojančių langų efektas,svirduliuojanciu langu efektas,svirduliuojantys langai,paleidimo grįžtamojo ryšio efektas,paleidimo griztamojo rysio efektas,paleidimo grįžtamasis ryšys,paleidimo griztamasis rysys,paleisties grįžtamasis ryšys,paleisties griztamasis rysys,dialogo viršesnio efektas,dialogo virsesnio efektas,dialogo viršesnis,dialogo virsesnis,pasyviųjų pritemdymo efektas,pasyviuju pritemdymo efektas,pasyviųjų pritemdymas,pasyviuju pritemdymas,pasyvių pritemdymo efektas,pasyviu pritemdymo efektas,pasyvių pritemdymas,pasyviu pritemdymas,ekrano pritemdymo efektas,ekrano pritemdymas,slydimo atgal efektas,slydimas atgal,grožybės,grozybes,gražu,grazu,FPS rodymo efektas,FPS rodymas,kadr./sek.,kadr/sek,kadr./s,kadr/s,kadr./sek. rodymas,piešimo rodymo efektas,piesimo rodymo efektas,piešimo rodymas,piesimo rodymas,viršelių perjungiklio efektas,viršelio perjungiklio efektas,virseliu perjungiklio efektas,viršelių perjungiklis,virseliu perjungiklis,višelių perjungimas,virseliu perjungimas,darbalaukio kubo efektas,darbastalio kubo efektas,darbalaukio kubas,darbastalio kubas,darbalaukio kubo animacijos efektas,darbastalio kubo animacijos efektas,darbalaukio kubo animacija,darbastalio kubo animacija,darbalaukio tinklelio efektas,darbastalio tinklelio efektas,darbalaukio tinklelis,darbastalio tinklelis,kartotekos pavidalo langų perjungiklio efektas,kartotekos pavidalo langu perjungiklio efektas,kartotekos pavidalo langų perjungiklis,kartotekos pavidalo langu perjungiklis,langų pateikimo efektas,langu pateikimo efektas,langų pateikimas,langu pateikimas,langų dydžio keitimo efektas,lango dydžio keitimo efektas,langu dydzio keitimo efektas,lango dydzio keitimo efektas,fono kontrasto efektas,fono kontrastas
X-KDE-Keywords[nl]=kwin,venster,beheerder,effect,3D effecten,2D effecten,grafische effecten,bureaubladeffecten,animaties,verrschillende animaties,vensterbeheereffecten,vensteromschakeleffect,bureaublad-omschakeleffect,animaties,bureaubladanimaties,stuurprogramma's,stuurprogramma-instellingen,rendering,render,inversieeffect,vergrootglaseffect,vergrotingseffect,snaphelpereffect,trackmuiseffect,zoomeffect,vervagingseffect,uitvaageffect,uitvaagbureaubladeffect,uiteenvaleffect,glijeffect,vensteraccentueringseffect,aanmeldeffect,afmeldeffect,magische lampeffect,animatie-effect minimaliseren,muismarkeringseffect,schaaleffect,schermafdrukeffect,bladeneffect,dia-effect,glijdende pop-upseffect,miniatuur-opzijeffect,doorzichtigheid,doorzichtigheidseffect,transparantie,vensterafmetingeneffect,wiebelende vensterseffect,opstartterugkoppeleffect,dialoogoudereffect,dim bij inactiviteitseffect,dim het schermeffect,schuif terugeffect,oogstrelend,snoepgoed,FPS toneneffect,verf toneneffect,vak deksel schakelaareffect,bureaublad kubuseffect,bureaublad kubus animatie-effect,bureaubladrastereffect,omschakeleffect,huidig venstereffect, wijzig grootte van venstereffect, achtergrondcontrasteffect
X-KDE-Keywords[nn]=kwin,vindauge,handsamar,vindaugshandsamar,effekt,3D-effektar,2D-effektar,grafiske effektar,skrivebordeffektar,animasjonar,ymse animasjonar,vindaugsbyteeffektar,effektar ved skrivebordbyte,animasjonar,skrivebordsanimasjonar,drivarar,drivarinnstillingar,oppteikning,oppteiknar,inverteringseffekt,spegeleffekt,lupeeffekt,gripehjelpareffekt,musmerkeeffekt,forstørringseffekt,zoomeffekt,sløringseffekt,uklar-effekt,kontrollpulteffekt,uttoningseffekt,skrivebordtoningseffekt,gå-i-knas-effekt,glidareffekt,framhev vindauge-effekt,innloggingseffekt,utloggingsefffekt,magisk lampe-effekt,animasjonseffekt ved vindaugsminimering,musmerkeeffekt,skaleringseffekt,skjermdumpeffekt,ark-effekt,lysbileteffekt,glidande sprettopp-effekt,effekt for minibilete på sida,gjennomsiktseffekt,gjennomsikt,vindaugsgeometri-effekt,vaklande vindauge-effekt,effekt for oppstartsmelding,effekt for forelderdialog,effekt for mørk inaktiv,effekt for mørk skjerm,gli tilbake-effekt,augesnop,vis FPS-effekt,vis målingseffekt,omslagsbyteeffekt,skrivebordskube-effekt,effekt for animert skrivebordskube,effekt for skrivebordrutenett,effekt for flipp-byte,presenter vindauge-effekt,vindaugsskaleringseffekt,bakgrunnskontrast-effekt
X-KDE-Keywords[pl]=kwin,okno,menadżer,efekt,efekty 3D,efekty 2D,efekty graficzne,efekty pulpitu,animacje,różne animacje,efekty zarządzania oknami,efekty przełączania okien,efekty przełączania pulpitów,animacje,animacje pulpitu,sterowniki,ustawienia sterowników,renderowania, efekt odwrócenia,szkło powiększające,efekt powiększenia,efekt pomocnika przyciągania, efekt śledzenia myszy,efekt przybliżenia,rozmycie,tablica,efekt eksplozji,efekt zanikania,efekt zanikania pulpitu,efekt rozpadania,efekt slajdu,efekt podświetlania okna, efekt logowania,efekt wylogowywania,efekt magicznej lampy,efekt animacji minimalizacji, efekt znacznika myszy,efekt skalowania,efekt zrzutu ekranu,efekt arkusza,efekt slajdu,efekt wysuwających się elementów wyskakujących,efekt prześwitywania,przezroczystość,efekt geometrii okna,efekt chwiejnych okien,efekt odczuć przy starcie,efekt okna rodzica,efekt przyciemniania nieaktywnych,efekt przyciemniania ekranu,efekt przesuwania do tył,efekt pokazania ilości klatek na sekundę

View File

@ -86,8 +86,6 @@ ScrollViewKCM {
property var _buttonGroups: []
clip: true
model: Private.EffectsFilterProxyModel {
id: searchModel

View File

@ -3,7 +3,7 @@
add_definitions(-DTRANSLATION_DOMAIN=\"kcmkwm\")
set(kcm_kwinoptions_PART_SRCS
${KWin_SOURCE_DIR}/effects/effect_builtins.cpp
${KWIN_SOURCE_DIR}/effects/effect_builtins.cpp
main.cpp
mouse.cpp
windows.cpp
@ -17,9 +17,7 @@ ki18n_wrap_ui(kcm_kwinoptions_PART_SRCS
moving.ui
)
kconfig_add_kcfg_files(kcm_kwinoptions_PART_SRCS kwinoptions_settings.kcfgc GENERATE_MOC)
qt5_add_dbus_interface(kcm_kwinoptions_PART_SRCS ${KWin_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
qt5_add_dbus_interface(kcm_kwinoptions_PART_SRCS ${KWIN_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
add_library(kcm_kwinoptions MODULE ${kcm_kwinoptions_PART_SRCS})
target_link_libraries(kcm_kwinoptions Qt5::DBus KF5::Completion KF5::I18n KF5::ConfigWidgets KF5::Service KF5::WindowSystem)
install(TARGETS kcm_kwinoptions DESTINATION ${PLUGIN_INSTALL_DIR})

View File

@ -20,14 +20,14 @@
<string>Window &amp;unshading:</string>
</property>
<property name="buddy">
<cstring>kcfg_ShadeHover</cstring>
<cstring>shadeHoverOn</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<widget class="QCheckBox" name="kcfg_ShadeHover">
<widget class="QCheckBox" name="shadeHoverOn">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If this option is enabled, a shaded window will unshade automatically when the mouse pointer has been over the titlebar for some time.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -37,7 +37,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="kcfg_ShadeHoverInterval">
<widget class="QSpinBox" name="shadeHover">
<property name="whatsThis">
<string>Sets the time in milliseconds before the window unshades when the mouse pointer goes over the shaded window.</string>
</property>
@ -66,12 +66,12 @@
<string>Window &amp;placement:</string>
</property>
<property name="buddy">
<cstring>kcfg_Placement</cstring>
<cstring>placementCombo</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="kcfg_Placement">
<widget class="KComboBox" name="placementCombo">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The placement policy determines where a new window will appear on the desktop.&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Smart&lt;/span&gt; will try to achieve a minimum overlap of windows&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Maximizing&lt;/span&gt; will try to maximize every window to fill the whole screen. It might be useful to selectively affect placement of some windows using the window-specific settings.&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Cascade&lt;/span&gt; will cascade the windows&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Random&lt;/span&gt; will use a random position&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Centered&lt;/span&gt; will place the window centered&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Zero-cornered&lt;/span&gt; will place the window in the top-left corner&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Under mouse&lt;/span&gt; will place the window under the pointer&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@ -118,12 +118,12 @@
<string>&amp;Special windows:</string>
</property>
<property name="buddy">
<cstring>kcfg_HideUtilityWindowsForInactive</cstring>
<cstring>hideUtilityWindowsForInactive</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="kcfg_HideUtilityWindowsForInactive">
<widget class="QCheckBox" name="hideUtilityWindowsForInactive">
<property name="whatsThis">
<string>When turned on, utility windows (tool windows, torn-off menus,...) of inactive applications will be hidden and will be shown only when the application becomes active. Note that applications have to mark the windows with the proper window type for this feature to work.</string>
</property>

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kwinrc"/>
<group name="Windows">
<entry key="GeometryTip" type="Bool">
<default>false</default>
</entry>
<entry key="BorderSnapZone" type="Int">
<default>10</default>
<min>0</min>
<max>100</max>
</entry>
<entry key="WindowSnapZone" type="Int">
<default>10</default>
<min>0</min>
<max>100</max>
</entry>
<entry key="CenterSnapZone" type="Int">
<default>0</default>
<min>0</min>
<max>100</max>
</entry>
<entry key="SnapOnlyWhenOverlapping" type="Bool">
<default>false</default>
</entry>
<entry key="ShadeHover" type="Bool">
<default>false</default>
</entry>
<entry key="ShadeHoverInterval" type="Int">
<default>250</default>
<min>0</min>
</entry>
<entry name="Placement" type="Enum">
<choices name="PlacementChoices">
<choice name="Smart"></choice>
<choice name="Maximizing"></choice>
<choice name="Cascade"></choice>
<choice name="Random"></choice>
<choice name="Centered"></choice>
<choice name="ZeroCornered"></choice>
<choice name="UnderMouse"></choice>
</choices>
<default>0</default>
</entry>
<entry key="HideUtilityWindowsForInactive" type="Bool">
<default>true</default>
</entry>
</group>
</kcfg>

View File

@ -1,6 +0,0 @@
File=kwinoptions_settings.kcfg
ClassName=KWinOptionsSettings
Mutators=true
DefaultValueGetters=true
ParentInConstructor=true
Singleton=true

View File

@ -50,7 +50,7 @@ class KMovingConfigStandalone : public KMovingConfig
Q_OBJECT
public:
KMovingConfigStandalone(QWidget* parent, const QVariantList &)
: KMovingConfig(true, parent)
: KMovingConfig(true, new KConfig("kwinrc"), parent)
{}
};
@ -59,7 +59,7 @@ class KAdvancedConfigStandalone : public KAdvancedConfig
Q_OBJECT
public:
KAdvancedConfigStandalone(QWidget* parent, const QVariantList &)
: KAdvancedConfig(true, parent)
: KAdvancedConfig(true, new KConfig("kwinrc"), parent)
{}
};
@ -76,29 +76,27 @@ KWinOptions::KWinOptions(QWidget *parent, const QVariantList &)
mFocus = new KFocusConfig(false, mConfig, this);
mFocus->setObjectName(QLatin1String("KWin Focus Config"));
tab->addTab(mFocus, i18n("&Focus"));
connect(mFocus, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mFocus, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this);
mTitleBarActions->setObjectName(QLatin1String("KWin TitleBar Actions"));
tab->addTab(mTitleBarActions, i18n("Titlebar A&ctions"));
connect(mTitleBarActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mWindowActions = new KWindowActionsConfig(false, mConfig, this);
mWindowActions->setObjectName(QLatin1String("KWin Window Actions"));
tab->addTab(mWindowActions, i18n("W&indow Actions"));
connect(mWindowActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mMoving = new KMovingConfig(false, this);
mMoving = new KMovingConfig(false, mConfig, this);
mMoving->setObjectName(QLatin1String("KWin Moving"));
tab->addTab(mMoving, i18n("Mo&vement"));
connect(mMoving, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mMoving, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
connect(mMoving, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mAdvanced = new KAdvancedConfig(false, this);
mAdvanced = new KAdvancedConfig(false, mConfig, this);
mAdvanced->setObjectName(QLatin1String("KWin Advanced"));
tab->addTab(mAdvanced, i18n("Adva&nced"));
connect(mAdvanced, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mAdvanced, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
KAboutData *about =
new KAboutData(QStringLiteral("kcmkwinoptions"), i18n("Window Behavior Configuration Module"),
@ -191,12 +189,12 @@ KActionsOptions::KActionsOptions(QWidget *parent, const QVariantList &)
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this);
mTitleBarActions->setObjectName(QLatin1String("KWin TitleBar Actions"));
tab->addTab(mTitleBarActions, i18n("&Titlebar Actions"));
connect(mTitleBarActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
mWindowActions = new KWindowActionsConfig(false, mConfig, this);
mWindowActions->setObjectName(QLatin1String("KWin Window Actions"));
tab->addTab(mWindowActions, i18n("Window Actio&ns"));
connect(mWindowActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
}
KActionsOptions::~KActionsOptions()
@ -232,8 +230,6 @@ void KActionsOptions::defaults()
{
mTitleBarActions->defaults();
mWindowActions->defaults();
emit defaulted(true);
}
void KActionsOptions::moduleChanged(bool state)

View File

@ -20,12 +20,12 @@
<string>Window &amp;geometry:</string>
</property>
<property name="buddy">
<cstring>kcfg_GeometryTip</cstring>
<cstring>geometryTipOn</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="kcfg_GeometryTip">
<widget class="QCheckBox" name="geometryTipOn">
<property name="whatsThis">
<string>Enable this option if you want a window's geometry to be displayed while it is being moved or resized. The window position relative to the top-left corner of the screen is displayed together with its size.</string>
</property>
@ -40,12 +40,12 @@
<string>Screen &amp;edge snap zone:</string>
</property>
<property name="buddy">
<cstring>kcfg_BorderSnapZone</cstring>
<cstring>borderSnap</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="kcfg_BorderSnapZone">
<widget class="QSpinBox" name="borderSnap">
<property name="whatsThis">
<string>Here you can set the snap zone for screen edges, i.e. the 'strength' of the magnetic field which will make windows snap to the border when moved near it.</string>
</property>
@ -67,7 +67,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="kcfg_WindowSnapZone">
<widget class="QSpinBox" name="windowSnap">
<property name="whatsThis">
<string>Here you can set the snap zone for windows, i.e. the 'strength' of the magnetic field which will make windows snap to each other when they are moved near another window.</string>
</property>
@ -89,7 +89,7 @@
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="kcfg_CenterSnapZone">
<widget class="QSpinBox" name="centerSnap">
<property name="whatsThis">
<string>Here you can set the snap zone for the screen center, i.e. the 'strength' of the magnetic field which will make windows snap to the center of the screen when moved near it.</string>
</property>
@ -108,7 +108,7 @@
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="kcfg_SnapOnlyWhenOverlapping">
<widget class="QCheckBox" name="OverlapSnap">
<property name="whatsThis">
<string>Here you can set that windows will be only snapped if you try to overlap them, i.e. they will not be snapped if the windows comes only near another window or border.</string>
</property>
@ -123,7 +123,7 @@
<string>&amp;Window snap zone:</string>
</property>
<property name="buddy">
<cstring>kcfg_WindowSnapZone</cstring>
<cstring>windowSnap</cstring>
</property>
</widget>
</item>
@ -133,7 +133,7 @@
<string>&amp;Center snap zone:</string>
</property>
<property name="buddy">
<cstring>kcfg_CenterSnapZone</cstring>
<cstring>centerSnap</cstring>
</property>
</widget>
</item>
@ -143,7 +143,7 @@
<string>&amp;Snap windows:</string>
</property>
<property name="buddy">
<cstring>kcfg_SnapOnlyWhenOverlapping</cstring>
<cstring>OverlapSnap</cstring>
</property>
</widget>
</item>

View File

@ -37,21 +37,38 @@
#include <KLocalizedString>
#include "windows.h"
#include "kwinoptions_settings.h"
#include <effect_builtins.h>
#include <kwin_effects_interface.h>
// kwin config keywords
#define KWIN_FOCUS "FocusPolicy"
#define KWIN_PLACEMENT "Placement"
#define KWIN_GEOMETRY "GeometryTip"
#define KWIN_AUTORAISE_INTERVAL "AutoRaiseInterval"
#define KWIN_AUTORAISE "AutoRaise"
#define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval"
#define KWIN_CLICKRAISE "ClickRaise"
#define KWIN_SHADEHOVER "ShadeHover"
#define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval"
#define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel"
#define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive"
#define KWIN_INACTIVE_SKIP_TASKBAR "InactiveTabsSkipTaskbar"
#define KWIN_SEPARATE_SCREEN_FOCUS "SeparateScreenFocus"
#define KWIN_ACTIVE_MOUSE_SCREEN "ActiveMouseScreen"
//CT 15mar 98 - magics
#define KWM_BRDR_SNAP_ZONE "BorderSnapZone"
#define KWM_BRDR_SNAP_ZONE_DEFAULT 10
#define KWM_WNDW_SNAP_ZONE "WindowSnapZone"
#define KWM_WNDW_SNAP_ZONE_DEFAULT 10
#define KWM_CNTR_SNAP_ZONE "CenterSnapZone"
#define KWM_CNTR_SNAP_ZONE_DEFAULT 0
#define MAX_BRDR_SNAP 100
#define MAX_WNDW_SNAP 100
#define MAX_CNTR_SNAP 100
#define MAX_EDGE_RES 1000
#define CLICK_TO_FOCUS 0
#define FOCUS_FOLLOWS_MOUSE 2
#define FOCUS_UNDER_MOUSE 4
@ -152,22 +169,22 @@ void KFocusConfig::focusPolicyChanged()
{
switch (m_ui->windowFocusPolicyCombo->currentIndex()) {
case 0:
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<em>Click to focus:</em> A window becomes active when you click into it. This behavior is common on other operating systems and likely what you want."));
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<html><head/><body><p><span style=\" font-style:italic;\">Click to focus:</span> A window becomes active when you click into it. This behavior is common on other operating systems and likely what you want.</p></body></html>"));
break;
case 1:
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<em>Click to focus (mouse precedence):</em> Mostly the same as <em>Click to focus</em>. If an active window has to be chosen by the system (eg. because the currently active one was closed) the window under the mouse is the preferred candidate. Unusual, but possible variant of <em>Click to focus</em>."));
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<html><head/><body><p><span style=\" font-style:italic;\">Click to focus (mouse precedence):</span> Mostly the same as <span style=\" font-style:italic;\">Click to focus</span>. If an active window has to be chosen by the system (eg. because the currently active one was closed) the window under the mouse is the preferred candidate. Unusual, but possible variant of <span style=\" font-style:italic;\">Click to focus</span>.</p></body></html>"));
break;
case 2:
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<em>Focus follows mouse:</em> Moving the mouse onto a window will activate it. Eg. windows randomly appearing under the mouse will not gain the focus. <em>Focus stealing prevention</em> takes place as usual. Think as <em>Click to focus</em> just without having to actually click."));
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<html><head/><body><p><span style=\" font-style:italic;\">Focus follows mouse:</span> Moving the mouse onto a window will activate it. Eg. windows randomly appearing under the mouse will not gain the focus. <span style=\" font-style:italic;\">Focus stealing prevention</span> takes place as usual. Think as <span style=\" font-style:italic;\">Click to focus</span> just without having to actually click.</p></body></html>"));
break;
case 3:
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("This is mostly the same as <em>Focus follows mouse</em>. If an active window has to be chosen by the system (eg. because the currently active one was closed) the window under the mouse is the preferred candidate. Choose this, if you want a hover controlled focus."));
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<html><head/><body><p>This is mostly the same as <span style=\" font-style:italic;\">Focus follows mouse</span>. If an active window has to be chosen by the system (eg. because the currently active one was closed) the window under the mouse is the preferred candidate. Choose this, if you want a hover controlled focus.</p></body></html>"));
break;
case 4:
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<em>Focus under mouse:</em> The focus always remains on the window under the mouse.<br/><strong>Warning:</strong> <em>Focus stealing prevention</em> and the <em>tabbox ('Alt+Tab')</em> contradict the activation policy and will not work. You very likely want to use <em>Focus follows mouse (mouse precedence)</em> instead!"));
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<html><head/><body><p><span style=\" font-style:italic;\">Focus under mouse:</span> The focus always remains on the window under the mouse.<br/><span style=\" font-weight:600;\">Warning: </span><span style=\" font-style:italic;\">Focus stealing prevention</span> and the <span style=\" font-style:italic;\">tabbox ('Alt+Tab') </span>contradict the activation policy and will not work. You very likely want to use <span style=\" font-style:italic;\">Focus follows mouse (mouse precedence)</span> instead!</p></body></html>"));
break;
case 5:
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<em>Focus strictly under mouse:</em> The focus is always on the window under the mouse (in doubt nowhere) very much like the focus behavior in an unmanaged legacy X11 environment.<br/><strong>Warning:</strong> <em>Focus stealing prevention</em> and the <em>tabbox ('Alt+Tab')</em> contradict the activation policy and will not work. You very likely want to use <em>Focus follows mouse (mouse precedence)</em> instead!"));
m_ui->windowFocusPolicyDescriptionLabel->setText(i18n("<html><head/><body><p><span style=\" font-style:italic;\">Focus strictly under mouse:</span> The focus is always on the window under the mouse (in doubt nowhere) very much like the focus behavior in an unmanaged legacy X11 environment.<br/><span style=\" font-weight:600;\">Warning: </span><span style=\" font-style:italic;\">Focus stealing prevention</span> and the <span style=\" font-style:italic;\">tabbox ('Alt+Tab') </span>contradict the activation policy and will not work. You very likely want to use <span style=\" font-style:italic;\">Focus follows mouse (mouse precedence)</span> instead!</p></body></html>"));
break;
}
@ -353,22 +370,51 @@ KWinAdvancedConfigForm::KWinAdvancedConfigForm(QWidget* parent)
KAdvancedConfig::~KAdvancedConfig()
{
if (standAlone)
delete config;
}
KAdvancedConfig::KAdvancedConfig(bool _standAlone, QWidget *parent)
: KCModule(parent), m_config(KWinOptionsSettings::self()), standAlone(_standAlone)
KAdvancedConfig::KAdvancedConfig(bool _standAlone, KConfig *_config, QWidget *parent)
: KCModule(parent), config(_config), standAlone(_standAlone)
, m_ui(new KWinAdvancedConfigForm(this))
{
addConfig(m_config, this);
m_ui->placementCombo->setItemData(0, "Smart");
m_ui->placementCombo->setItemData(1, "Maximizing");
m_ui->placementCombo->setItemData(2, "Cascade");
m_ui->placementCombo->setItemData(3, "Random");
m_ui->placementCombo->setItemData(4, "Centered");
m_ui->placementCombo->setItemData(5, "ZeroCornered");
m_ui->placementCombo->setItemData(6, "UnderMouse");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Smart, "Smart");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Maximizing, "Maximizing");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Cascade, "Cascade");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Random, "Random");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::Centered, "Centered");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::ZeroCornered, "ZeroCornered");
m_ui->kcfg_Placement->setItemData(KWinOptionsSettings::PlacementChoices::UnderMouse, "UnderMouse");
connect(m_ui->shadeHoverOn, SIGNAL(toggled(bool)), this, SLOT(shadeHoverChanged(bool)));
connect(m_ui->shadeHoverOn, SIGNAL(toggled(bool)), SLOT(changed()));
connect(m_ui->shadeHover, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(m_ui->placementCombo, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->hideUtilityWindowsForInactive, SIGNAL(toggled(bool)), SLOT(changed()));
load();
}
void KAdvancedConfig::setShadeHover(bool on)
{
m_ui->shadeHoverOn->setChecked(on);
m_ui->shadeHover->setEnabled(on);
}
void KAdvancedConfig::setShadeHoverInterval(int k)
{
m_ui->shadeHover->setValue(k);
}
int KAdvancedConfig::getShadeHoverInterval()
{
return m_ui->shadeHover->value();
}
void KAdvancedConfig::shadeHoverChanged(bool a)
{
m_ui->shadeHover->setEnabled(a);
}
void KAdvancedConfig::showEvent(QShowEvent *ev)
@ -380,17 +426,62 @@ void KAdvancedConfig::showEvent(QShowEvent *ev)
KCModule::showEvent(ev);
}
void KAdvancedConfig::load(void)
{
KConfigGroup cg(config, "Windows");
setShadeHover(cg.readEntry(KWIN_SHADEHOVER, false));
setShadeHoverInterval(cg.readEntry(KWIN_SHADEHOVER_INTERVAL, 250));
QString key;
key = cg.readEntry(KWIN_PLACEMENT);
int idx = m_ui->placementCombo->findData(key);
if (idx < 0)
idx = m_ui->placementCombo->findData("Smart");
m_ui->placementCombo->setCurrentIndex(idx);
setHideUtilityWindowsForInactive(cg.readEntry(KWIN_HIDE_UTILITY, true));
emit KCModule::changed(false);
}
void KAdvancedConfig::save(void)
{
KCModule::save();
int v;
KConfigGroup cg(config, "Windows");
cg.writeEntry(KWIN_SHADEHOVER, m_ui->shadeHoverOn->isChecked());
v = getShadeHoverInterval();
if (v < 0) v = 0;
cg.writeEntry(KWIN_SHADEHOVER_INTERVAL, v);
cg.writeEntry(KWIN_PLACEMENT, m_ui->placementCombo->itemData(m_ui->placementCombo->currentIndex()).toString());
cg.writeEntry(KWIN_HIDE_UTILITY, m_ui->hideUtilityWindowsForInactive->isChecked());
if (standAlone) {
config->sync();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
emit KCModule::changed(false);
}
void KAdvancedConfig::defaults()
{
setShadeHover(false);
setShadeHoverInterval(250);
m_ui->placementCombo->setCurrentIndex(0); // default to Smart
setHideUtilityWindowsForInactive(true);
emit KCModule::changed(true);
}
void KAdvancedConfig::setHideUtilityWindowsForInactive(bool s)
{
m_ui->hideUtilityWindowsForInactive->setChecked(s);
}
KWinMovingConfigForm::KWinMovingConfigForm(QWidget* parent)
@ -401,16 +492,34 @@ KWinMovingConfigForm::KWinMovingConfigForm(QWidget* parent)
KMovingConfig::~KMovingConfig()
{
if (standAlone)
delete config;
}
KMovingConfig::KMovingConfig(bool _standAlone, QWidget *parent)
: KCModule(parent), m_config(KWinOptionsSettings::self()), standAlone(_standAlone)
KMovingConfig::KMovingConfig(bool _standAlone, KConfig *_config, QWidget *parent)
: KCModule(parent), config(_config), standAlone(_standAlone)
, m_ui(new KWinMovingConfigForm(this))
{
addConfig(m_config, this);
// Any changes goes to slotChanged()
connect(m_ui->geometryTipOn, SIGNAL(clicked()), SLOT(changed()));
connect(m_ui->borderSnap, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(m_ui->windowSnap, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(m_ui->centerSnap, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(m_ui->OverlapSnap, SIGNAL(clicked()), SLOT(changed()));
load();
}
void KMovingConfig::setGeometryTip(bool showGeometryTip)
{
m_ui->geometryTipOn->setChecked(showGeometryTip);
}
bool KMovingConfig::getGeometryTip()
{
return m_ui->geometryTipOn->isChecked();
}
void KMovingConfig::showEvent(QShowEvent *ev)
{
if (!standAlone) {
@ -420,11 +529,54 @@ void KMovingConfig::showEvent(QShowEvent *ev)
KCModule::showEvent(ev);
}
void KMovingConfig::load(void)
{
QString key;
KConfigGroup cg(config, "Windows");
//KS 10Jan2003 - Geometry Tip during window move/resize
bool showGeomTip = cg.readEntry(KWIN_GEOMETRY, false);
setGeometryTip(showGeomTip);
int v;
v = cg.readEntry(KWM_BRDR_SNAP_ZONE, KWM_BRDR_SNAP_ZONE_DEFAULT);
if (v > MAX_BRDR_SNAP) setBorderSnapZone(MAX_BRDR_SNAP);
else if (v < 0) setBorderSnapZone(0);
else setBorderSnapZone(v);
v = cg.readEntry(KWM_WNDW_SNAP_ZONE, KWM_WNDW_SNAP_ZONE_DEFAULT);
if (v > MAX_WNDW_SNAP) setWindowSnapZone(MAX_WNDW_SNAP);
else if (v < 0) setWindowSnapZone(0);
else setWindowSnapZone(v);
v = cg.readEntry(KWM_CNTR_SNAP_ZONE, KWM_CNTR_SNAP_ZONE_DEFAULT);
if (v > MAX_CNTR_SNAP) setCenterSnapZone(MAX_CNTR_SNAP);
else if (v < 0) setCenterSnapZone(0);
else setCenterSnapZone(v);
m_ui->OverlapSnap->setChecked(cg.readEntry("SnapOnlyWhenOverlapping", false));
emit KCModule::changed(false);
}
void KMovingConfig::save(void)
{
m_config->save();
KConfigGroup cg(config, "Windows");
cg.writeEntry(KWIN_GEOMETRY, getGeometryTip());
cg.writeEntry(KWM_BRDR_SNAP_ZONE, getBorderSnapZone());
cg.writeEntry(KWM_WNDW_SNAP_ZONE, getWindowSnapZone());
cg.writeEntry(KWM_CNTR_SNAP_ZONE, getCenterSnapZone());
cg.writeEntry("SnapOnlyWhenOverlapping", m_ui->OverlapSnap->isChecked());
const bool geometryTip = getGeometryTip();
KConfigGroup(config, "Plugins").writeEntry("windowgeometryEnabled", geometryTip);
if (standAlone) {
config->sync();
// Send signal to all kwin instances
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
@ -434,9 +586,54 @@ void KMovingConfig::save(void)
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
QStringLiteral("/Effects"),
QDBusConnection::sessionBus());
if (m_config->geometryTip()) {
if (geometryTip) {
interface.loadEffect(KWin::BuiltInEffects::nameForEffect(KWin::BuiltInEffect::WindowGeometry));
} else {
interface.unloadEffect(KWin::BuiltInEffects::nameForEffect(KWin::BuiltInEffect::WindowGeometry));
}
emit KCModule::changed(false);
}
void KMovingConfig::defaults()
{
setGeometryTip(false);
//copied from kcontrol/konq/kwindesktop, aleXXX
setWindowSnapZone(KWM_WNDW_SNAP_ZONE_DEFAULT);
setBorderSnapZone(KWM_BRDR_SNAP_ZONE_DEFAULT);
setCenterSnapZone(KWM_CNTR_SNAP_ZONE_DEFAULT);
m_ui->OverlapSnap->setChecked(false);
emit KCModule::changed(true);
}
int KMovingConfig::getBorderSnapZone()
{
return m_ui->borderSnap->value();
}
void KMovingConfig::setBorderSnapZone(int pxls)
{
m_ui->borderSnap->setValue(pxls);
}
int KMovingConfig::getWindowSnapZone()
{
return m_ui->windowSnap->value();
}
void KMovingConfig::setWindowSnapZone(int pxls)
{
m_ui->windowSnap->setValue(pxls);
}
int KMovingConfig::getCenterSnapZone()
{
return m_ui->centerSnap->value();
}
void KMovingConfig::setCenterSnapZone(int pxls)
{
m_ui->centerSnap->setValue(pxls);
}

View File

@ -41,7 +41,6 @@ class QSpinBox;
class KColorButton;
class KWinOptionsSettings;
class KWinFocusConfigForm : public QWidget, public Ui::KWinFocusConfigForm
{
@ -119,37 +118,71 @@ class KMovingConfig : public KCModule
{
Q_OBJECT
public:
KMovingConfig(bool _standAlone, QWidget *parent);
KMovingConfig(bool _standAlone, KConfig *config, QWidget *parent);
~KMovingConfig() override;
void load() override;
void save() override;
void defaults() override;
protected:
void showEvent(QShowEvent *ev) override;
private Q_SLOTS:
void changed() {
emit KCModule::changed(true);
}
private:
KWinOptionsSettings *m_config;
bool getGeometryTip(void); //KS
void setGeometryTip(bool); //KS
KConfig *config;
bool standAlone;
KWinMovingConfigForm *m_ui;
int getBorderSnapZone();
void setBorderSnapZone(int);
int getWindowSnapZone();
void setWindowSnapZone(int);
int getCenterSnapZone();
void setCenterSnapZone(int);
};
class KAdvancedConfig : public KCModule
{
Q_OBJECT
public:
KAdvancedConfig(bool _standAlone, QWidget *parent);
KAdvancedConfig(bool _standAlone, KConfig *config, QWidget *parent);
~KAdvancedConfig() override;
void load() override;
void save() override;
void defaults() override;
protected:
void showEvent(QShowEvent *ev) override;
private Q_SLOTS:
void shadeHoverChanged(bool);
void changed() {
emit KCModule::changed(true);
}
private:
KWinOptionsSettings *m_config;
int getShadeHoverInterval(void);
void setShadeHover(bool);
void setShadeHoverInterval(int);
KConfig *config;
bool standAlone;
KWinAdvancedConfigForm *m_ui;
void setHideUtilityWindowsForInactive(bool);
};
#endif // KKWMWINDOWS_H

View File

@ -6,11 +6,13 @@ add_definitions(-DKCMRULES)
include_directories(../../)
set(kwinrules_MOC_HDRS yesnobox.h ../../cursor.h ../../plugins/platforms/x11/standalone/x11cursor.h)
qt5_wrap_cpp(kwinrules_MOC_SRCS ${kwinrules_MOC_HDRS})
set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp main.cpp ${kwinrules_MOC_SRCS})
set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp ${kwinrules_MOC_SRCS})
ki18n_wrap_ui(kwinrules_SRCS ruleslist.ui detectwidget.ui editshortcut.ui ruleswidgetbase.ui)
add_executable(kwin_rules_dialog ${kwinrules_SRCS})
set(kwin_rules_dialog_KDEINIT_SRCS main.cpp ${kwinrules_SRCS})
kf5_add_kdeinit_executable(kwin_rules_dialog ${kwin_rules_dialog_KDEINIT_SRCS})
set(kwin_kcm_rules_XCB_LIBS
XCB::CURSOR
@ -34,8 +36,9 @@ if (KWIN_BUILD_ACTIVITIES)
set(kcm_libs ${kcm_libs} KF5::Activities)
endif()
target_link_libraries(kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS})
target_link_libraries(kdeinit_kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS})
install(TARGETS kdeinit_kwin_rules_dialog ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kwin_rules_dialog DESTINATION ${LIBEXEC_INSTALL_DIR})
########### next target ###############

View File

@ -233,7 +233,8 @@ static void edit(const QVariantMap &data, bool whole_app)
} // namespace
int main(int argc, char* argv[])
extern "C"
KWIN_EXPORT int kdemain(int argc, char* argv[])
{
QApplication app(argc, argv);
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);

View File

@ -1,12 +1,12 @@
# KI18N Translation Domain for this library
add_definitions(-DTRANSLATION_DOMAIN=\"kcmkwinscreenedges\")
include_directories(${KWin_SOURCE_DIR}/effects)
include_directories(${KWIN_SOURCE_DIR}/effects)
set(kcm_screenedges_SRCS
monitor.cpp
screenpreviewwidget.cpp
)
qt5_add_dbus_interface(kcm_screenedges_SRCS ${KWin_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
qt5_add_dbus_interface(kcm_screenedges_SRCS ${KWIN_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
set(kcm_kwinscreenedges_PART_SRCS main.cpp ${kcm_screenedges_SRCS})
ki18n_wrap_ui(kcm_kwinscreenedges_PART_SRCS main.ui)

View File

@ -11,7 +11,6 @@ X-KDE-System-Settings-Parent-Category=desktopbehavior
X-KDE-Weight=50
Name=Touch Screen
Name[ast]=Pantalla táutil
Name[ca]=Pantalla tàctil
Name[ca@valencia]=Pantalla tàctil
Name[cs]=Dotyková obrazovka

View File

@ -1,21 +1,20 @@
# KI18N Translation Domain for this library
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_kwintabbox\")
include_directories(${KWin_SOURCE_DIR}/effects ${KWin_SOURCE_DIR}/tabbox ${KWin_SOURCE_DIR})
include_directories(${KWIN_SOURCE_DIR}/effects ${KWIN_SOURCE_DIR}/tabbox ${KWIN_SOURCE_DIR})
########### next target ###############
set(kcm_kwintabbox_PART_SRCS
${KWin_SOURCE_DIR}/tabbox/tabboxconfig.cpp
${KWIN_SOURCE_DIR}/tabbox/tabboxconfig.cpp
layoutpreview.cpp
main.cpp
thumbnailitem.cpp
)
ki18n_wrap_ui(kcm_kwintabbox_PART_SRCS main.ui)
qt5_add_dbus_interface(kcm_kwintabbox_PART_SRCS ${KWin_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
qt5_add_dbus_interface(kcm_kwintabbox_PART_SRCS ${KWIN_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
kconfig_add_kcfg_files(kcm_kwintabbox_PART_SRCS kwintabboxsettings.kcfgc kwinswitcheffectsettings.kcfgc kwinpluginssettings.kcfgc)
add_library(kcm_kwintabbox MODULE ${kcm_kwintabbox_PART_SRCS})
target_link_libraries(kcm_kwintabbox

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kwinrc" />
<group name="Plugins">
<entry key="coverswitchEnabled" type="Bool">
<default code="true">BuiltInEffects::enabledByDefault(BuiltInEffect::CoverSwitch)</default>
</entry>
<entry key="flipswitchEnabled" type="Bool">
<default code="true">BuiltInEffects::enabledByDefault(BuiltInEffect::FlipSwitch)</default>
</entry>
<entry key="highlightwindowEnabled" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>

View File

@ -1,7 +0,0 @@
File=kwinpluginssettings.kcfg
NameSpace=KWin::TabBox
ClassName=PluginsSettings
IncludeFiles=effect_builtins.h
Mutators=true
DefaultValueGetters=true
ParentInConstructor=true

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kwinrc">
<parameter name="EffectGroup"/>
</kcfgfile>
<group name="$(EffectGroup)">
<entry key="TabBox" type="Bool">
<default>false</default>
</entry>
<entry key="TabBoxAlternative" type="Bool">
<default>false</default>
</entry>
</group>
</kcfg>

View File

@ -1,6 +0,0 @@
File=kwinswitcheffectsettings.kcfg
NameSpace=KWin::TabBox
ClassName=SwitchEffectSettings
Mutators=true
DefaultValueGetters=true
ParentInConstructor=true

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="kwinrc">
<parameter name="TabBoxGroup"/>
</kcfgfile>
<group name="$(TabBoxGroup)">
<entry key="DesktopMode" type="Int">
<default code="true">TabBoxConfig::defaultDesktopMode()</default>
</entry>
<entry key="ActivitiesMode" type="Int">
<default code="true">TabBoxConfig::defaultActivitiesMode()</default>
</entry>
<entry key="ApplicationsMode" type="Int">
<default code="true">TabBoxConfig::defaultApplicationsMode()</default>
</entry>
<entry key="MinimizedMode" type="Int">
<default code="true">TabBoxConfig::defaultMinimizedMode()</default>
</entry>
<entry key="ShowDesktopMode" type="Int">
<default code="true">TabBoxConfig::defaultShowDesktopMode()</default>
</entry>
<entry key="MultiScreenMode" type="Int">
<default code="true">TabBoxConfig::defaultMultiScreenMode()</default>
</entry>
<entry key="SwitchingMode" type="Int">
<default code="true">TabBoxConfig::defaultSwitchingMode()</default>
</entry>
<entry key="LayoutName" type="String">
<default code="true">TabBoxConfig::defaultLayoutName()</default>
</entry>
<entry key="ShowTabBox" type="Bool">
<default code="true">TabBoxConfig::defaultShowTabBox()</default>
</entry>
<entry key="HighlightWindows" type="Bool">
<default code="true">TabBoxConfig::defaultHighlightWindow()</default>
</entry>
</group>
</kcfg>

View File

@ -1,7 +0,0 @@
File=kwintabboxsettings.kcfg
NameSpace=KWin::TabBox
ClassName=TabBoxSettings
IncludeFiles=\"tabboxconfig.h\"
Mutators=true
DefaultValueGetters=true
ParentInConstructor=true

View File

@ -3,7 +3,6 @@
This file is part of the KDE project.
Copyright (C) 2009 Martin Gräßlin <mgraesslin@kde.org>
Copyright (C) 2020 Cyril Rossi <cyril.rossi@enioka.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -49,10 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KPackage/PackageLoader>
// own
#include "tabboxconfig.h"
#include "layoutpreview.h"
#include "kwintabboxsettings.h"
#include "kwinswitcheffectsettings.h"
#include "kwinpluginssettings.h"
K_PLUGIN_FACTORY(KWinTabBoxConfigFactory, registerPlugin<KWin::KWinTabBoxConfig>();)
@ -70,11 +67,6 @@ KWinTabBoxConfigForm::KWinTabBoxConfigForm(QWidget* parent)
KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
: KCModule(parent, args)
, m_config(KSharedConfig::openConfig("kwinrc"))
, m_tabBoxConfig(new TabBoxSettings(QStringLiteral("TabBox"), this))
, m_tabBoxAlternativeConfig(new TabBoxSettings(QStringLiteral("TabBoxAlternative"), this))
, m_coverSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-CoverSwitch"), this))
, m_flipSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-FlipSwitch"), this))
, m_pluginsConfig(new PluginsSettings(this))
{
QTabWidget* tabWidget = new QTabWidget(this);
m_primaryTabBoxUi = new KWinTabBoxConfigForm(tabWidget);
@ -171,9 +163,8 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
if ((policy == "FocusUnderMouse") || (policy == "FocusStrictlyUnderMouse")) {
tabWidget->setEnabled(false);
infoLabel->show();
} else {
} else
infoLabel->hide();
}
}
KWinTabBoxConfig::~KWinTabBoxConfig()
@ -272,36 +263,22 @@ void KWinTabBoxConfig::load()
{
KCModule::load();
m_tabBoxConfig->load();
m_tabBoxAlternativeConfig->load();
m_coverSwitchConfig->load();
m_flipSwitchConfig->load();
m_pluginsConfig->load();
updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig);
updateUiFromConfig(m_alternativeTabBoxUi , m_tabBoxAlternativeConfig);
if (m_pluginsConfig->coverswitchEnabled()) {
if (m_coverSwitchConfig->tabBox()) {
m_primaryTabBoxUi->effectCombo->setCurrentIndex(CoverSwitch);
}
if (m_coverSwitchConfig->tabBoxAlternative()) {
m_alternativeTabBoxUi->effectCombo->setCurrentIndex(CoverSwitch);
}
}
if (m_pluginsConfig->flipswitchEnabled()) {
if (m_flipSwitchConfig->tabBox()) {
m_primaryTabBoxUi->effectCombo->setCurrentIndex(FlipSwitch);
}
if (m_flipSwitchConfig->tabBoxAlternative()) {
m_alternativeTabBoxUi->effectCombo->setCurrentIndex(FlipSwitch);
}
}
const QString group[2] = { "TabBox", "TabBoxAlternative" };
KWinTabBoxConfigForm* ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi };
TabBoxConfig *tabBoxConfig[2] = { &m_tabBoxConfig, &m_tabBoxAlternativeConfig };
for (int i = 0; i < 2; ++i) {
KConfigGroup config(m_config, group[i]);
loadConfig(config, *(tabBoxConfig[i]));
updateUiFromConfig(ui[i], *(tabBoxConfig[i]));
KConfigGroup effectconfig(m_config, "Plugins");
if (effectEnabled(BuiltInEffect::CoverSwitch, effectconfig) && KConfigGroup(m_config, "Effect-CoverSwitch").readEntry(group[i], false))
ui[i]->effectCombo->setCurrentIndex(CoverSwitch);
else if (effectEnabled(BuiltInEffect::FlipSwitch, effectconfig) && KConfigGroup(m_config, "Effect-FlipSwitch").readEntry(group[i], false))
ui[i]->effectCombo->setCurrentIndex(FlipSwitch);
QString action;
#define LOAD_SHORTCUT(_BTN_)\
action = ui[i]->_BTN_->property("shortcutAction").toString();\
@ -320,15 +297,59 @@ void KWinTabBoxConfig::load()
emit changed(false);
}
void KWinTabBoxConfig::loadConfig(const KConfigGroup& config, KWin::TabBox::TabBoxConfig& tabBoxConfig)
{
tabBoxConfig.setClientDesktopMode(TabBoxConfig::ClientDesktopMode(
config.readEntry<int>("DesktopMode", TabBoxConfig::defaultDesktopMode())));
tabBoxConfig.setClientActivitiesMode(TabBoxConfig::ClientActivitiesMode(
config.readEntry<int>("ActivitiesMode", TabBoxConfig::defaultActivitiesMode())));
tabBoxConfig.setClientApplicationsMode(TabBoxConfig::ClientApplicationsMode(
config.readEntry<int>("ApplicationsMode", TabBoxConfig::defaultApplicationsMode())));
tabBoxConfig.setClientMinimizedMode(TabBoxConfig::ClientMinimizedMode(
config.readEntry<int>("MinimizedMode", TabBoxConfig::defaultMinimizedMode())));
tabBoxConfig.setShowDesktopMode(TabBoxConfig::ShowDesktopMode(
config.readEntry<int>("ShowDesktopMode", TabBoxConfig::defaultShowDesktopMode())));
tabBoxConfig.setClientMultiScreenMode(TabBoxConfig::ClientMultiScreenMode(
config.readEntry<int>("MultiScreenMode", TabBoxConfig::defaultMultiScreenMode())));
tabBoxConfig.setClientSwitchingMode(TabBoxConfig::ClientSwitchingMode(
config.readEntry<int>("SwitchingMode", TabBoxConfig::defaultSwitchingMode())));
tabBoxConfig.setShowTabBox(config.readEntry<bool>("ShowTabBox", TabBoxConfig::defaultShowTabBox()));
tabBoxConfig.setHighlightWindows(config.readEntry<bool>("HighlightWindows", TabBoxConfig::defaultHighlightWindow()));
tabBoxConfig.setLayoutName(config.readEntry<QString>("LayoutName", TabBoxConfig::defaultLayoutName()));
}
void KWinTabBoxConfig::saveConfig(KConfigGroup& config, const KWin::TabBox::TabBoxConfig& tabBoxConfig)
{
// combo boxes
config.writeEntry("DesktopMode", int(tabBoxConfig.clientDesktopMode()));
config.writeEntry("ActivitiesMode", int(tabBoxConfig.clientActivitiesMode()));
config.writeEntry("ApplicationsMode", int(tabBoxConfig.clientApplicationsMode()));
config.writeEntry("MinimizedMode", int(tabBoxConfig.clientMinimizedMode()));
config.writeEntry("ShowDesktopMode", int(tabBoxConfig.showDesktopMode()));
config.writeEntry("MultiScreenMode", int(tabBoxConfig.clientMultiScreenMode()));
config.writeEntry("SwitchingMode", int(tabBoxConfig.clientSwitchingMode()));
config.writeEntry("LayoutName", tabBoxConfig.layoutName());
// check boxes
config.writeEntry("ShowTabBox", tabBoxConfig.isShowTabBox());
config.writeEntry("HighlightWindows", tabBoxConfig.isHighlightWindows());
config.sync();
}
void KWinTabBoxConfig::save()
{
KCModule::save();
KConfigGroup config(m_config, "TabBox");
// sync ui to config
updateConfigFromUi(m_primaryTabBoxUi, m_tabBoxConfig);
updateConfigFromUi(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig);
m_tabBoxConfig->save();
m_tabBoxAlternativeConfig->save();
saveConfig(config, m_tabBoxConfig);
config = KConfigGroup(m_config, "TabBoxAlternative");
saveConfig(config, m_tabBoxAlternativeConfig);
// effects
bool highlightWindows = m_primaryTabBoxUi->highlightWindowCheck->isChecked() ||
@ -343,24 +364,22 @@ void KWinTabBoxConfig::save()
m_alternativeTabBoxUi->effectCombo->currentIndex() == FlipSwitch;
// activate effects if not active
if (coverSwitch || coverSwitchAlternative) {
m_pluginsConfig->setCoverswitchEnabled(true);
}
if (flipSwitch || flipSwitchAlternative) {
m_pluginsConfig->setFlipswitchEnabled(true);
}
if (highlightWindows) {
m_pluginsConfig->setHighlightwindowEnabled(true);
}
m_pluginsConfig->save();
m_coverSwitchConfig->setTabBox(coverSwitch);
m_coverSwitchConfig->setTabBoxAlternative(coverSwitchAlternative);
m_coverSwitchConfig->save();
m_flipSwitchConfig->setTabBox(flipSwitch);
m_flipSwitchConfig->setTabBoxAlternative(flipSwitchAlternative);
m_flipSwitchConfig->save();
KConfigGroup effectconfig(m_config, "Plugins");
if (coverSwitch || coverSwitchAlternative)
effectconfig.writeEntry("coverswitchEnabled", true);
if (flipSwitch || flipSwitchAlternative)
effectconfig.writeEntry("flipswitchEnabled", true);
if (highlightWindows)
effectconfig.writeEntry("highlightwindowEnabled", true);
effectconfig.sync();
KConfigGroup coverswitchconfig(m_config, "Effect-CoverSwitch");
coverswitchconfig.writeEntry("TabBox", coverSwitch);
coverswitchconfig.writeEntry("TabBoxAlternative", coverSwitchAlternative);
coverswitchconfig.sync();
KConfigGroup flipswitchconfig(m_config, "Effect-FlipSwitch");
flipswitchconfig.writeEntry("TabBox", flipSwitch);
flipswitchconfig.writeEntry("TabBoxAlternative", flipSwitchAlternative);
flipswitchconfig.sync();
// Reload KWin.
QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
@ -377,17 +396,35 @@ void KWinTabBoxConfig::save()
void KWinTabBoxConfig::defaults()
{
KCModule::defaults();
const KWinTabBoxConfigForm* ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi};
for (int i = 0; i < 2; ++i) {
// combo boxes
#define CONFIGURE(SETTING, MODE, IS, VALUE) \
ui[i]->SETTING->setChecked(TabBoxConfig::default##MODE##Mode() IS TabBoxConfig::VALUE)
CONFIGURE(filterDesktops, Desktop, !=, AllDesktopsClients);
CONFIGURE(currentDesktop, Desktop, ==, OnlyCurrentDesktopClients);
CONFIGURE(otherDesktops, Desktop, ==, ExcludeCurrentDesktopClients);
CONFIGURE(filterActivities, Activities, !=, AllActivitiesClients);
CONFIGURE(currentActivity, Activities, ==, OnlyCurrentActivityClients);
CONFIGURE(otherActivities, Activities, ==, ExcludeCurrentActivityClients);
CONFIGURE(filterScreens, MultiScreen, !=, IgnoreMultiScreen);
CONFIGURE(currentScreen, MultiScreen, ==, OnlyCurrentScreenClients);
CONFIGURE(otherScreens, MultiScreen, ==, ExcludeCurrentScreenClients);
CONFIGURE(oneAppWindow, Applications, ==, OneWindowPerApplication);
CONFIGURE(filterMinimization, Minimized, !=, IgnoreMinimizedStatus);
CONFIGURE(visibleWindows, Minimized, ==, ExcludeMinimizedClients);
CONFIGURE(hiddenWindows, Minimized, ==, OnlyMinimizedClients);
m_tabBoxConfig->setDefaults();
m_tabBoxAlternativeConfig->setDefaults();
ui[i]->switchingModeCombo->setCurrentIndex(TabBoxConfig::defaultSwitchingMode());
m_pluginsConfig->setDefaults();
m_coverSwitchConfig->setDefaults();
m_flipSwitchConfig->setDefaults();
updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig);
updateUiFromConfig(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig);
// checkboxes
ui[i]->showTabBox->setChecked(TabBoxConfig::defaultShowTabBox());
ui[i]->highlightWindowCheck->setChecked(TabBoxConfig::defaultHighlightWindow());
CONFIGURE(showDesktop, ShowDesktop, ==, ShowDesktopClient);
#undef CONFIGURE
// effects
ui[i]->effectCombo->setCurrentIndex(ui[i]->effectCombo->findData("sidebar"));
}
QString action;
auto RESET_SHORTCUT = [this](KKeySequenceWidget *widget, const QKeySequence &sequence = QKeySequence()) {
@ -407,65 +444,66 @@ void KWinTabBoxConfig::defaults()
emit changed(true);
}
void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm *ui, const KWin::TabBox::TabBoxSettings *config)
bool KWinTabBoxConfig::effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const
{
#define CONFIGURE(SETTING, MODE, IS, VALUE) ui->SETTING->setChecked(config->MODE##Mode() IS TabBoxConfig::VALUE)
CONFIGURE(filterDesktops, desktop, !=, AllDesktopsClients);
CONFIGURE(currentDesktop, desktop, ==, OnlyCurrentDesktopClients);
CONFIGURE(otherDesktops, desktop, ==, ExcludeCurrentDesktopClients);
CONFIGURE(filterActivities, activities, !=, AllActivitiesClients);
CONFIGURE(currentActivity, activities, ==, OnlyCurrentActivityClients);
CONFIGURE(otherActivities, activities, ==, ExcludeCurrentActivityClients);
CONFIGURE(filterScreens, multiScreen, !=, IgnoreMultiScreen);
CONFIGURE(currentScreen, multiScreen, ==, OnlyCurrentScreenClients);
CONFIGURE(otherScreens, multiScreen, ==, ExcludeCurrentScreenClients);
CONFIGURE(oneAppWindow, applications, ==, OneWindowPerApplication);
CONFIGURE(filterMinimization, minimized, !=, IgnoreMinimizedStatus);
CONFIGURE(visibleWindows, minimized, ==, ExcludeMinimizedClients);
CONFIGURE(hiddenWindows, minimized, ==, OnlyMinimizedClients);
return cfg.readEntry(BuiltInEffects::nameForEffect(effect) + "Enabled", BuiltInEffects::enabledByDefault(effect));
}
ui->switchingModeCombo->setCurrentIndex(config->switchingMode());
void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm* ui, const KWin::TabBox::TabBoxConfig& config)
{
#define CONFIGURE(SETTING, MODE, IS, VALUE) ui->SETTING->setChecked(config.MODE##Mode() IS TabBoxConfig::VALUE)
CONFIGURE(filterDesktops, clientDesktop, !=, AllDesktopsClients);
CONFIGURE(currentDesktop, clientDesktop, ==, OnlyCurrentDesktopClients);
CONFIGURE(otherDesktops, clientDesktop, ==, ExcludeCurrentDesktopClients);
CONFIGURE(filterActivities, clientActivities, !=, AllActivitiesClients);
CONFIGURE(currentActivity, clientActivities, ==, OnlyCurrentActivityClients);
CONFIGURE(otherActivities, clientActivities, ==, ExcludeCurrentActivityClients);
CONFIGURE(filterScreens, clientMultiScreen, !=, IgnoreMultiScreen);
CONFIGURE(currentScreen, clientMultiScreen, ==, OnlyCurrentScreenClients);
CONFIGURE(otherScreens, clientMultiScreen, ==, ExcludeCurrentScreenClients);
CONFIGURE(oneAppWindow, clientApplications, ==, OneWindowPerApplication);
CONFIGURE(filterMinimization, clientMinimized, !=, IgnoreMinimizedStatus);
CONFIGURE(visibleWindows, clientMinimized, ==, ExcludeMinimizedClients);
CONFIGURE(hiddenWindows, clientMinimized, ==, OnlyMinimizedClients);
ui->switchingModeCombo->setCurrentIndex(config.clientSwitchingMode());
// check boxes
ui->showTabBox->setChecked(config->showTabBox());
ui->highlightWindowCheck->setChecked(config->highlightWindows());
ui->effectCombo->setCurrentIndex(ui->effectCombo->findData(config->layoutName()));
ui->showTabBox->setChecked(config.isShowTabBox());
ui->highlightWindowCheck->setChecked(config.isHighlightWindows());
ui->effectCombo->setCurrentIndex(ui->effectCombo->findData(config.layoutName()));
CONFIGURE(showDesktop, showDesktop, ==, ShowDesktopClient);
#undef CONFIGURE
}
void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm *ui, TabBoxSettings *config)
void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm* ui, TabBox::TabBoxConfig& config)
{
if (ui->filterDesktops->isChecked()) {
config->setDesktopMode(ui->currentDesktop->isChecked() ? TabBoxConfig::OnlyCurrentDesktopClients : TabBoxConfig::ExcludeCurrentDesktopClients);
} else {
config->setDesktopMode(TabBoxConfig::AllDesktopsClients);
}
if (ui->filterActivities->isChecked()) {
config->setActivitiesMode(ui->currentActivity->isChecked() ? TabBoxConfig::OnlyCurrentActivityClients : TabBoxConfig::ExcludeCurrentActivityClients);
} else {
config->setActivitiesMode(TabBoxConfig::AllActivitiesClients);
}
if (ui->filterScreens->isChecked()) {
config->setMultiScreenMode(ui->currentScreen->isChecked() ? TabBoxConfig::OnlyCurrentScreenClients : TabBoxConfig::ExcludeCurrentScreenClients);
} else {
config->setMultiScreenMode(TabBoxConfig::IgnoreMultiScreen);
}
config->setApplicationsMode(ui->oneAppWindow->isChecked() ? TabBoxConfig::OneWindowPerApplication : TabBoxConfig::AllWindowsAllApplications);
if (ui->filterMinimization->isChecked()) {
config->setMinimizedMode(ui->visibleWindows->isChecked() ? TabBoxConfig::ExcludeMinimizedClients : TabBoxConfig::OnlyMinimizedClients);
} else {
config->setMinimizedMode(TabBoxConfig::IgnoreMinimizedStatus);
}
if (ui->filterDesktops->isChecked())
config.setClientDesktopMode(ui->currentDesktop->isChecked() ? TabBoxConfig::OnlyCurrentDesktopClients : TabBoxConfig::ExcludeCurrentDesktopClients);
else
config.setClientDesktopMode(TabBoxConfig::AllDesktopsClients);
if (ui->filterActivities->isChecked())
config.setClientActivitiesMode(ui->currentActivity->isChecked() ? TabBoxConfig::OnlyCurrentActivityClients : TabBoxConfig::ExcludeCurrentActivityClients);
else
config.setClientActivitiesMode(TabBoxConfig::AllActivitiesClients);
if (ui->filterScreens->isChecked())
config.setClientMultiScreenMode(ui->currentScreen->isChecked() ? TabBoxConfig::OnlyCurrentScreenClients : TabBoxConfig::ExcludeCurrentScreenClients);
else
config.setClientMultiScreenMode(TabBoxConfig::IgnoreMultiScreen);
config.setClientApplicationsMode(ui->oneAppWindow->isChecked() ? TabBoxConfig::OneWindowPerApplication : TabBoxConfig::AllWindowsAllApplications);
if (ui->filterMinimization->isChecked())
config.setClientMinimizedMode(ui->visibleWindows->isChecked() ? TabBoxConfig::ExcludeMinimizedClients : TabBoxConfig::OnlyMinimizedClients);
else
config.setClientMinimizedMode(TabBoxConfig::IgnoreMinimizedStatus);
config->setSwitchingMode(TabBoxConfig::ClientSwitchingMode(ui->switchingModeCombo->currentIndex()));
config.setClientSwitchingMode(TabBoxConfig::ClientSwitchingMode(ui->switchingModeCombo->currentIndex()));
config->setShowTabBox(ui->showTabBox->isChecked());
config->setHighlightWindows(ui->highlightWindowCheck->isChecked());
config.setShowTabBox(ui->showTabBox->isChecked());
config.setHighlightWindows(ui->highlightWindowCheck->isChecked());
if (ui->effectCombo->currentIndex() >= Layout) {
config->setLayoutName(ui->effectCombo->itemData(ui->effectCombo->currentIndex()).toString());
config.setLayoutName(ui->effectCombo->itemData(ui->effectCombo->currentIndex()).toString());
}
config->setShowDesktopMode(ui->showDesktop->isChecked() ? TabBoxConfig::ShowDesktopClient : TabBoxConfig::DoNotShowDesktopClient);
config.setShowDesktopMode(ui->showDesktop->isChecked() ? TabBoxConfig::ShowDesktopClient : TabBoxConfig::DoNotShowDesktopClient);
}
#define CHECK_CURRENT_TABBOX_UI \
@ -485,8 +523,7 @@ void KWinTabBoxConfig::effectSelectionChanged(int index)
ui->highlightWindowCheck->setEnabled(index >= Layout);
}
void KWinTabBoxConfig::tabBoxToggled(bool on)
{
void KWinTabBoxConfig::tabBoxToggled(bool on) {
CHECK_CURRENT_TABBOX_UI
on = !on || ui->effectCombo->currentIndex() >= Layout;
ui->highlightWindowCheck->setEnabled(on);

View File

@ -3,7 +3,6 @@
This file is part of the KDE project.
Copyright (C) 2009 Martin Gräßlin <mgraesslin@kde.org>
Copyright (C) 2020 Cyril Rossi <cyril.rossi@enioka.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -24,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kcmodule.h>
#include <ksharedconfig.h>
#include "tabboxconfig.h"
#include "ui_main.h"
@ -35,9 +35,7 @@ namespace KWin
enum class BuiltInEffect;
namespace TabBox
{
class TabBoxSettings;
class SwitchEffectSettings;
class PluginsSettings;
}
@ -70,8 +68,10 @@ private Q_SLOTS:
void shortcutChanged(const QKeySequence &seq);
void slotGHNS();
private:
void updateUiFromConfig(KWinTabBoxConfigForm *ui, const TabBox::TabBoxSettings *config);
void updateConfigFromUi(const KWinTabBoxConfigForm *ui, TabBox::TabBoxSettings *config);
void updateUiFromConfig(KWinTabBoxConfigForm* ui, const TabBox::TabBoxConfig& config);
void updateConfigFromUi(const KWinTabBoxConfigForm* ui, TabBox::TabBoxConfig& config);
void loadConfig(const KConfigGroup& config, KWin::TabBox::TabBoxConfig& tabBoxConfig);
void saveConfig(KConfigGroup& config, const KWin::TabBox::TabBoxConfig& tabBoxConfig);
void initLayoutLists();
private:
@ -85,12 +85,10 @@ private:
KSharedConfigPtr m_config;
KActionCollection* m_actionCollection;
KShortcutsEditor* m_editor;
TabBox::TabBoxSettings *m_tabBoxConfig;
TabBox::TabBoxSettings *m_tabBoxAlternativeConfig;
TabBox::SwitchEffectSettings *m_coverSwitchConfig;
TabBox::SwitchEffectSettings *m_flipSwitchConfig;
TabBox::PluginsSettings *m_pluginsConfig;
TabBox::TabBoxConfig m_tabBoxConfig;
TabBox::TabBoxConfig m_tabBoxAlternativeConfig;
bool effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const;
};
} // namespace

View File

@ -222,10 +222,8 @@ void Workspace::propagateClients(bool propagate_new_clients)
cl = new xcb_window_t[ manual_overlays.count() + stacking_order.count()];
pos = 0;
for (auto it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it) {
X11Client *client = qobject_cast<X11Client *>(*it);
if (client) {
cl[pos++] = client->window();
}
if ((*it)->isClient())
cl[pos++] = (*it)->window();
}
for (const auto win : manual_overlays) {
cl[pos++] = win;
@ -853,6 +851,14 @@ void X11Client::restackWindow(xcb_window_t above, int detail, NET::RequestSource
sendSyntheticConfigureNotify();
}
void X11Client::doSetKeepAbove()
{
}
void X11Client::doSetKeepBelow()
{
}
bool X11Client::belongsToDesktop() const
{
foreach (const X11Client *c, group()->members()) {

View File

@ -346,14 +346,12 @@ EffectQuickScene::EffectQuickScene(QObject *parent)
: EffectQuickView(parent)
, d(new EffectQuickScene::Private)
{
d->qmlObject = new KDeclarative::QmlObjectSharedEngine(this);
}
EffectQuickScene::EffectQuickScene(QObject *parent, EffectQuickView::ExportMode exportMode)
: EffectQuickView(parent, exportMode)
, d(new EffectQuickScene::Private)
{
d->qmlObject = new KDeclarative::QmlObjectSharedEngine(this);
}
EffectQuickScene::~EffectQuickScene()
@ -362,6 +360,9 @@ EffectQuickScene::~EffectQuickScene()
void EffectQuickScene::setSource(const QUrl &source)
{
if (!d->qmlObject) {
d->qmlObject = new KDeclarative::QmlObjectSharedEngine(this);
}
d->qmlObject->setSource(source);
QQuickItem *item = rootItem();

View File

@ -1519,13 +1519,6 @@ Q_SIGNALS:
* @since 4.7
*/
void windowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
/**
* This signal is emitted when the frame geometry of a window changed.
* @param window The window whose geometry changed
* @param oldGeometry The previous geometry
* @since 5.19
*/
void windowFrameGeometryChanged(KWin::EffectWindow *window, const QRect &oldGeometry);
/**
* Signal emitted when the padding of a window changed. (eg. shadow size)
* @param w The window whose geometry changed

View File

@ -340,7 +340,8 @@ void ApplicationX11::crashHandler(int signal)
} // namespace
int main(int argc, char * argv[])
extern "C"
KWIN_EXPORT int kdemain(int argc, char * argv[])
{
KWin::Application::setupMalloc();
KWin::Application::setupLocalizedString();

View File

@ -748,7 +748,7 @@ void AbstractClient::growHorizontal()
return;
QRect geom = frameGeometry();
geom.setRight(workspace()->packPositionRight(this, geom.right(), true));
QSize adjsize = adjustedSize(geom.size(), SizeModeFixedW);
QSize adjsize = adjustedSize(geom.size(), SizemodeFixedW);
if (frameGeometry().size() == adjsize && geom.size() != adjsize && resizeIncrements().width() > 1) { // take care of size increments
int newright = workspace()->packPositionRight(this, geom.right() + resizeIncrements().width() - 1, true);
// check that it hasn't grown outside of the area, due to size increments
@ -757,8 +757,8 @@ void AbstractClient::growHorizontal()
QPoint((x() + newright) / 2, frameGeometry().center().y()), desktop()).right() >= newright)
geom.setRight(newright);
}
geom.setSize(adjustedSize(geom.size(), SizeModeFixedW));
geom.setSize(adjustedSize(geom.size(), SizeModeFixedH));
geom.setSize(adjustedSize(geom.size(), SizemodeFixedW));
geom.setSize(adjustedSize(geom.size(), SizemodeFixedH));
workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event;
setFrameGeometry(geom);
}
@ -777,7 +777,7 @@ void AbstractClient::shrinkHorizontal()
geom.setRight(workspace()->packPositionLeft(this, geom.right(), false));
if (geom.width() <= 1)
return;
geom.setSize(adjustedSize(geom.size(), SizeModeFixedW));
geom.setSize(adjustedSize(geom.size(), SizemodeFixedW));
if (geom.width() > 20) {
workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event;
setFrameGeometry(geom);
@ -796,7 +796,7 @@ void AbstractClient::growVertical()
return;
QRect geom = frameGeometry();
geom.setBottom(workspace()->packPositionDown(this, geom.bottom(), true));
QSize adjsize = adjustedSize(geom.size(), SizeModeFixedH);
QSize adjsize = adjustedSize(geom.size(), SizemodeFixedH);
if (frameGeometry().size() == adjsize && geom.size() != adjsize && resizeIncrements().height() > 1) { // take care of size increments
int newbottom = workspace()->packPositionDown(this, geom.bottom() + resizeIncrements().height() - 1, true);
// check that it hasn't grown outside of the area, due to size increments
@ -804,7 +804,7 @@ void AbstractClient::growVertical()
QPoint(frameGeometry().center().x(), (y() + newbottom) / 2), desktop()).bottom() >= newbottom)
geom.setBottom(newbottom);
}
geom.setSize(adjustedSize(geom.size(), SizeModeFixedH));
geom.setSize(adjustedSize(geom.size(), SizemodeFixedH));
workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event;
setFrameGeometry(geom);
}
@ -824,7 +824,7 @@ void AbstractClient::shrinkVertical()
geom.setBottom(workspace()->packPositionUp(this, geom.bottom(), false));
if (geom.height() <= 1)
return;
geom.setSize(adjustedSize(geom.size(), SizeModeFixedH));
geom.setSize(adjustedSize(geom.size(), SizemodeFixedH));
if (geom.height() > 20) {
workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event;
setFrameGeometry(geom);

View File

@ -88,7 +88,6 @@ Name[zh_CN]=Plastik
Name[zh_TW]=Plastik
Comment=The classic theme known from KDE 3
Comment[ar]=السّمة الكلاسيكيّة المعروفة من كدي 3
Comment[ast]=El tema clásicu y conocíu de KDE 3
Comment[bs]=Klasična tema iz KDE 3
Comment[ca]=El tema clàssic conegut des del KDE 3
Comment[ca@valencia]=El tema clàssic conegut des de KDE 3

View File

@ -52,7 +52,6 @@
"Name[fr]": "drm",
"Name[gl]": "drm",
"Name[hu]": "drm",
"Name[ia]": "drm",
"Name[id]": "drm",
"Name[it]": "drm",
"Name[ko]": "drm",

View File

@ -52,7 +52,6 @@
"Name[fr]": "framebuffer",
"Name[gl]": "framebuffer",
"Name[hu]": "framebuffer",
"Name[ia]": "framebuffer",
"Name[id]": "framebuffer",
"Name[it]": "framebuffer",
"Name[ko]": "framebuffer",

View File

@ -52,7 +52,6 @@
"Name[fr]": "virtual",
"Name[gl]": "virtual",
"Name[hu]": "virtuális",
"Name[ia]": "virtual",
"Name[id]": "virtual",
"Name[it]": "virtual",
"Name[ko]": "virtual",

View File

@ -52,7 +52,6 @@
"Name[fr]": "wayland",
"Name[gl]": "wayland",
"Name[hu]": "wayland",
"Name[ia]": "wayland",
"Name[id]": "wayland",
"Name[it]": "wayland",
"Name[ko]": "wayland",

View File

@ -243,19 +243,6 @@ static void paintSubSurface(QPainter *painter, const QPoint &pos, QPainterWindow
}
}
static bool isXwaylandClient(Toplevel *toplevel)
{
X11Client *client = qobject_cast<X11Client *>(toplevel);
if (client) {
return true;
}
Deleted *deleted = qobject_cast<Deleted *>(toplevel);
if (deleted) {
return deleted->wasX11Client();
}
return false;
}
void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintData data)
{
if (!(mask & (PAINT_WINDOW_TRANSFORMED | PAINT_SCREEN_TRANSFORMED)))
@ -302,7 +289,7 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa
// render content
QRect source;
QRect target;
if (isXwaylandClient(toplevel)) {
if (toplevel->isClient()) {
// special case for XWayland windows
source = QRect(toplevel->clientPos(), toplevel->clientSize());
target = source;

View File

@ -1,7 +1,6 @@
set(kwindowsystem_plugin_SRCS
plugin.cpp
windoweffects.cpp
windowshadow.cpp
windowsystem.cpp
)

View File

@ -18,9 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "plugin.h"
#include "windoweffects.h"
#include "windowshadow.h"
#include "windowsystem.h"
#include "windoweffects.h"
KWindowSystemKWinPlugin::KWindowSystemKWinPlugin(QObject *parent)
: KWindowSystemPluginInterface(parent)
@ -40,13 +39,3 @@ KWindowSystemPrivate *KWindowSystemKWinPlugin::createWindowSystem()
{
return new KWin::WindowSystem();
}
KWindowShadowTilePrivate *KWindowSystemKWinPlugin::createWindowShadowTile()
{
return new KWin::WindowShadowTile();
}
KWindowShadowPrivate *KWindowSystemKWinPlugin::createWindowShadow()
{
return new KWin::WindowShadow();
}

View File

@ -33,6 +33,4 @@ public:
KWindowEffectsPrivate *createEffects() override;
KWindowSystemPrivate *createWindowSystem() override;
KWindowShadowTilePrivate *createWindowShadowTile() override;
KWindowShadowPrivate *createWindowShadow() override;
};

View File

@ -1,95 +0,0 @@
/*
* Copyright 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "windowshadow.h"
#include <QVariant>
Q_DECLARE_METATYPE(QMargins)
namespace KWin
{
bool WindowShadowTile::create()
{
return true;
}
void WindowShadowTile::destroy()
{
}
bool WindowShadow::create()
{
// TODO: Perhaps we set way too many properties here. Alternatively we could put all shadow tiles
// in one big image and attach it rather than 8 separate images.
if (leftTile) {
window->setProperty("kwin_shadow_left_tile", QVariant::fromValue(leftTile->image()));
}
if (topLeftTile) {
window->setProperty("kwin_shadow_top_left_tile", QVariant::fromValue(topLeftTile->image()));
}
if (topTile) {
window->setProperty("kwin_shadow_top_tile", QVariant::fromValue(topTile->image()));
}
if (topRightTile) {
window->setProperty("kwin_shadow_top_right_tile", QVariant::fromValue(topRightTile->image()));
}
if (rightTile) {
window->setProperty("kwin_shadow_right_tile", QVariant::fromValue(rightTile->image()));
}
if (bottomRightTile) {
window->setProperty("kwin_shadow_bottom_right_tile", QVariant::fromValue(bottomRightTile->image()));
}
if (bottomTile) {
window->setProperty("kwin_shadow_bottom_tile", QVariant::fromValue(bottomTile->image()));
}
if (bottomLeftTile) {
window->setProperty("kwin_shadow_bottom_left_tile", QVariant::fromValue(bottomLeftTile->image()));
}
window->setProperty("kwin_shadow_padding", QVariant::fromValue(padding));
// Notice that the enabled property must be set last.
window->setProperty("kwin_shadow_enabled", QVariant::fromValue(true));
return true;
}
void WindowShadow::destroy()
{
// Attempting to uninstall the shadow after the decorated window has been destroyed. It's doomed.
if (!window) {
return;
}
// Remove relevant shadow properties.
window->setProperty("kwin_shadow_left_tile", {});
window->setProperty("kwin_shadow_top_left_tile", {});
window->setProperty("kwin_shadow_top_tile", {});
window->setProperty("kwin_shadow_top_right_tile", {});
window->setProperty("kwin_shadow_right_tile", {});
window->setProperty("kwin_shadow_bottom_right_tile", {});
window->setProperty("kwin_shadow_bottom_tile", {});
window->setProperty("kwin_shadow_bottom_left_tile", {});
window->setProperty("kwin_shadow_padding", {});
window->setProperty("kwin_shadow_enabled", {});
}
} // namespace KWin

View File

@ -1,42 +0,0 @@
/*
* Copyright 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <KWindowSystem/private/kwindowshadow_p.h>
namespace KWin
{
class WindowShadowTile final : public KWindowShadowTilePrivate
{
public:
bool create() override;
void destroy() override;
};
class WindowShadow final : public KWindowShadowPrivate
{
public:
bool create() override;
void destroy() override;
};
} // namespace KWin

View File

@ -51,7 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QHoverEvent>
#include <QWindow>
#include <QPainter>
// Wayland
#include <wayland-cursor.h>
@ -503,7 +502,7 @@ void PointerInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl
QCoreApplication::instance()->sendEvent(now->decoration(), &event);
now->client()->processDecorationMove(pos.toPoint(), m_pos.toPoint());
m_decorationGeometryConnection = connect(decoration()->client(), &AbstractClient::frameGeometryChanged, this,
m_decorationGeometryConnection = connect(decoration()->client(), &AbstractClient::geometryChanged, this,
[this] {
// ensure maximize button gets the leave event when maximizing/restore a window, see BUG 385140
const auto oldDeco = decoration();
@ -565,7 +564,7 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow
seat->setPointerPos(m_pos.toPoint());
seat->setFocusedPointerSurface(focusNow->surface(), focusNow->inputTransformation());
m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this,
m_focusGeometryConnection = connect(focusNow, &Toplevel::geometryChanged, this,
[this] {
// TODO: why no assert possible?
if (!focus()) {
@ -1222,7 +1221,6 @@ void CursorImage::updateDragCursor()
if (auto dragIcon = ddi->icon()) {
if (auto buffer = dragIcon->buffer()) {
additionalIcon = buffer->data().copy();
additionalIcon.setOffset(dragIcon->offset());
}
}
}
@ -1255,32 +1253,7 @@ void CursorImage::updateDragCursor()
return;
}
m_drag.cursor.hotSpot = c->hotspot();
if (additionalIcon.isNull()) {
m_drag.cursor.image = buffer->data().copy();
} else {
QRect cursorRect = buffer->data().rect();
QRect iconRect = additionalIcon.rect();
if (-m_drag.cursor.hotSpot.x() < additionalIcon.offset().x()) {
iconRect.moveLeft(m_drag.cursor.hotSpot.x() - additionalIcon.offset().x());
} else {
cursorRect.moveLeft(-additionalIcon.offset().x() - m_drag.cursor.hotSpot.x());
}
if (-m_drag.cursor.hotSpot.y() < additionalIcon.offset().y()) {
iconRect.moveTop(m_drag.cursor.hotSpot.y() - additionalIcon.offset().y());
} else {
cursorRect.moveTop(-additionalIcon.offset().y() - m_drag.cursor.hotSpot.y());
}
m_drag.cursor.image = QImage(cursorRect.united(iconRect).size(), QImage::Format_ARGB32_Premultiplied);
m_drag.cursor.image.fill(Qt::transparent);
QPainter p(&m_drag.cursor.image);
p.drawImage(iconRect, additionalIcon);
p.drawImage(cursorRect, buffer->data());
p.end();
}
m_drag.cursor.image = buffer->data().copy();
if (needsEmit) {
emit changed();
}

Some files were not shown because too many files have changed in this diff Show More