[kcm/effects] Clip ListView
Summary: Otherwise the content overflows the frame when scrolling. QQC2 scrollview docs say "ScrollView does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the clip property to true" Test Plan: Before: {F8121150} After: {F8121152} Reviewers: #kwin, #plasma, ngraham Reviewed By: ngraham Subscribers: ngraham, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D27558
This commit is contained in:
parent
275082ad49
commit
5babf52df4
112 changed files with 1443 additions and 1203 deletions
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
project(KWIN)
|
||||
set(PROJECT_VERSION "5.18.1")
|
||||
project(KWin)
|
||||
set(PROJECT_VERSION "5.18.80")
|
||||
set(PROJECT_VERSION_MAJOR 5)
|
||||
|
||||
set(QT_MIN_VERSION "5.12.0")
|
||||
|
@ -70,7 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
|
|||
I18n
|
||||
IconThemes
|
||||
IdleTime
|
||||
Init
|
||||
Notifications
|
||||
Package
|
||||
Plasma
|
||||
|
@ -312,7 +311,6 @@ cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kacti
|
|||
set(KWIN_NAME "kwin")
|
||||
set(KWIN_INTERNAL_NAME_X11 "kwin_x11")
|
||||
set(KWIN_INTERNAL_NAME_WAYLAND "kwin_wayland")
|
||||
set(KWIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# KWIN_HAVE_XRENDER_COMPOSITING - whether XRender-based compositing support is available: may be disabled
|
||||
if (KWIN_BUILD_XRENDER_COMPOSITING)
|
||||
|
@ -392,7 +390,7 @@ add_subdirectory(helpers)
|
|||
|
||||
########### next target ###############
|
||||
|
||||
set(kwin_KDEINIT_SRCS
|
||||
set(kwin_SRCS
|
||||
abstract_client.cpp
|
||||
abstract_opengl_context_attribute_builder.cpp
|
||||
abstract_output.cpp
|
||||
|
@ -504,14 +502,14 @@ set(kwin_KDEINIT_SRCS
|
|||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(kwin_KDEINIT_SRCS
|
||||
${kwin_KDEINIT_SRCS}
|
||||
set(kwin_SRCS
|
||||
${kwin_SRCS}
|
||||
colorcorrection/clockskewnotifierengine_linux.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
include(ECMQtDeclareLoggingCategory)
|
||||
ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS
|
||||
ecm_qt_declare_logging_category(kwin_SRCS
|
||||
HEADER
|
||||
colorcorrect_logging.h
|
||||
IDENTIFIER
|
||||
|
@ -524,7 +522,7 @@ ecm_qt_declare_logging_category(kwin_KDEINIT_SRCS
|
|||
|
||||
if (KWIN_BUILD_TABBOX)
|
||||
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
||||
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
|
||||
set(kwin_SRCS ${kwin_SRCS}
|
||||
tabbox/clientmodel.cpp
|
||||
tabbox/desktopchain.cpp
|
||||
tabbox/desktopmodel.cpp
|
||||
|
@ -538,33 +536,33 @@ if (KWIN_BUILD_TABBOX)
|
|||
endif()
|
||||
|
||||
if (KWIN_BUILD_ACTIVITIES)
|
||||
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
|
||||
set(kwin_SRCS ${kwin_SRCS}
|
||||
activities.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (HAVE_LINUX_VT_H)
|
||||
set(kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
|
||||
set(kwin_SRCS ${kwin_SRCS}
|
||||
virtual_terminal.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
kconfig_add_kcfg_files(kwin_KDEINIT_SRCS settings.kcfgc)
|
||||
kconfig_add_kcfg_files(kwin_KDEINIT_SRCS colorcorrection/colorcorrect_settings.kcfgc)
|
||||
kconfig_add_kcfg_files(kwin_SRCS settings.kcfgc)
|
||||
kconfig_add_kcfg_files(kwin_SRCS colorcorrection/colorcorrect_settings.kcfgc)
|
||||
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.kwin.OrientationSensor.xml orientation_sensor.h KWin::OrientationSensor)
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_KDEINIT_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.xml dbusinterface.h KWin::DBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.Compositing.xml dbusinterface.h KWin::CompositorDBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.ColorCorrect.xml colorcorrection/colorcorrectdbusinterface.h KWin::ColorCorrect::ColorCorrectDBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS ${kwin_effects_dbus_xml} effects.h KWin::EffectsHandlerImpl)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS org.kde.kwin.OrientationSensor.xml orientation_sensor.h KWin::OrientationSensor)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.VirtualDesktopManager.xml dbusinterface.h KWin::VirtualDesktopManagerDBusInterface)
|
||||
qt5_add_dbus_adaptor(kwin_SRCS org.kde.KWin.Session.xml sm.h KWin::SessionManager)
|
||||
|
||||
qt5_add_dbus_interface(kwin_KDEINIT_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface)
|
||||
qt5_add_dbus_interface(kwin_KDEINIT_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface)
|
||||
qt5_add_dbus_interface(kwin_KDEINIT_SRCS org.kde.kappmenu.xml appmenu_interface)
|
||||
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/kf5_org.freedesktop.ScreenSaver.xml screenlocker_interface)
|
||||
qt5_add_dbus_interface(kwin_SRCS ${KSCREENLOCKER_DBUS_INTERFACES_DIR}/org.kde.screensaver.xml kscreenlocker_interface)
|
||||
qt5_add_dbus_interface(kwin_SRCS org.kde.kappmenu.xml appmenu_interface)
|
||||
|
||||
ki18n_wrap_ui(kwin_KDEINIT_SRCS
|
||||
ki18n_wrap_ui(kwin_SRCS
|
||||
debug_console.ui
|
||||
shortcutdialog.ui
|
||||
)
|
||||
|
@ -647,7 +645,7 @@ set(kwinLibs
|
|||
Libinput::Libinput
|
||||
)
|
||||
|
||||
add_library(kwin SHARED ${kwin_KDEINIT_SRCS})
|
||||
add_library(kwin SHARED ${kwin_SRCS})
|
||||
|
||||
set_target_properties(kwin PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
|
@ -659,11 +657,10 @@ generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
|
|||
|
||||
target_link_libraries(kwin kwinglutils ${epoxy_LIBRARY})
|
||||
|
||||
kf5_add_kdeinit_executable(kwin_x11 main_x11.cpp)
|
||||
target_link_libraries(kdeinit_kwin_x11 kwin KF5::Crash Qt5::X11Extras)
|
||||
add_executable(kwin_x11 main_x11.cpp)
|
||||
target_link_libraries(kwin_x11 kwin KF5::Crash Qt5::X11Extras)
|
||||
|
||||
install(TARGETS kwin ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
|
||||
install(TARGETS kdeinit_kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(TARGETS kwin_x11 ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
set(kwin_XWAYLAND_SRCS
|
||||
|
|
|
@ -91,5 +91,8 @@ KWin uses [KDE's phabricator instance](https://phabricator.kde.org) for code rev
|
|||
|
||||
More complete documentation can be found in [KDE's wiki](https://community.kde.org/Infrastructure/Phabricator). Please add "#KWin" as reviewers. Please run KWin's automated test suite prior to uploading a patch to ensure that the change does not break existing code.
|
||||
|
||||
# Coding conventions
|
||||
KWin's coding conventions are explained in document [coding-conventions.md](doc/coding-conventions.md).
|
||||
|
||||
# Coding style
|
||||
KWin code follows the [Frameworks coding style](https://techbase.kde.org/Policies/Frameworks_Coding_Style).
|
||||
|
|
|
@ -64,10 +64,6 @@ AbstractClient::AbstractClient()
|
|||
#endif
|
||||
, m_colorScheme(QStringLiteral("kdeglobals"))
|
||||
{
|
||||
connect(this, &AbstractClient::geometryShapeChanged, this, &AbstractClient::geometryChanged);
|
||||
auto signalMaximizeChanged = static_cast<void (AbstractClient::*)(KWin::AbstractClient*, MaximizeMode)>(&AbstractClient::clientMaximizedStateChanged);
|
||||
connect(this, signalMaximizeChanged, this, &AbstractClient::geometryChanged);
|
||||
connect(this, &AbstractClient::clientStepUserMovedResized, this, &AbstractClient::geometryChanged);
|
||||
connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::moveResizedChanged);
|
||||
connect(this, &AbstractClient::clientFinishUserMovedResized, this, &AbstractClient::moveResizedChanged);
|
||||
connect(this, &AbstractClient::clientStartUserMovedResized, this, &AbstractClient::removeCheckScreenConnection);
|
||||
|
@ -89,7 +85,7 @@ AbstractClient::AbstractClient()
|
|||
});
|
||||
|
||||
// replace on-screen-display on size changes
|
||||
connect(this, &AbstractClient::geometryShapeChanged, this,
|
||||
connect(this, &AbstractClient::frameGeometryChanged, this,
|
||||
[this] (Toplevel *c, const QRect &old) {
|
||||
Q_UNUSED(c)
|
||||
if (isOnScreenDisplay() && !frameGeometry().isEmpty() && old.size() != frameGeometry().size() && !isInitialPositionSet()) {
|
||||
|
@ -135,11 +131,6 @@ void AbstractClient::setClientShown(bool shown)
|
|||
Q_UNUSED(shown)
|
||||
}
|
||||
|
||||
MaximizeMode AbstractClient::requestedMaximizeMode() const
|
||||
{
|
||||
return maximizeMode();
|
||||
}
|
||||
|
||||
xcb_timestamp_t AbstractClient::userTime() const
|
||||
{
|
||||
return XCB_TIME_CURRENT_TIME;
|
||||
|
@ -326,19 +317,13 @@ void AbstractClient::setKeepAbove(bool b)
|
|||
if (b && !rules()->checkKeepBelow(false))
|
||||
setKeepBelow(false);
|
||||
if (b == keepAbove()) {
|
||||
// force hint change if different
|
||||
if (info && bool(info->state() & NET::KeepAbove) != keepAbove())
|
||||
info->setState(keepAbove() ? NET::KeepAbove : NET::States(), NET::KeepAbove);
|
||||
return;
|
||||
}
|
||||
m_keepAbove = b;
|
||||
if (info) {
|
||||
info->setState(keepAbove() ? NET::KeepAbove : NET::States(), NET::KeepAbove);
|
||||
}
|
||||
doSetKeepAbove();
|
||||
workspace()->updateClientLayer(this);
|
||||
updateWindowRules(Rules::Above);
|
||||
|
||||
doSetKeepAbove();
|
||||
emit keepAboveChanged(m_keepAbove);
|
||||
}
|
||||
|
||||
|
@ -352,19 +337,13 @@ void AbstractClient::setKeepBelow(bool b)
|
|||
if (b && !rules()->checkKeepAbove(false))
|
||||
setKeepAbove(false);
|
||||
if (b == keepBelow()) {
|
||||
// force hint change if different
|
||||
if (info && bool(info->state() & NET::KeepBelow) != keepBelow())
|
||||
info->setState(keepBelow() ? NET::KeepBelow : NET::States(), NET::KeepBelow);
|
||||
return;
|
||||
}
|
||||
m_keepBelow = b;
|
||||
if (info) {
|
||||
info->setState(keepBelow() ? NET::KeepBelow : NET::States(), NET::KeepBelow);
|
||||
}
|
||||
doSetKeepBelow();
|
||||
workspace()->updateClientLayer(this);
|
||||
updateWindowRules(Rules::Below);
|
||||
|
||||
doSetKeepBelow();
|
||||
emit keepBelowChanged(m_keepBelow);
|
||||
}
|
||||
|
||||
|
@ -411,13 +390,15 @@ void AbstractClient::demandAttention(bool set)
|
|||
if (m_demandsAttention == set)
|
||||
return;
|
||||
m_demandsAttention = set;
|
||||
if (info) {
|
||||
info->setState(set ? NET::DemandsAttention : NET::States(), NET::DemandsAttention);
|
||||
}
|
||||
doSetDemandsAttention();
|
||||
workspace()->clientAttentionChanged(this, set);
|
||||
emit demandsAttentionChanged();
|
||||
}
|
||||
|
||||
void AbstractClient::doSetDemandsAttention()
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractClient::setDesktop(int desktop)
|
||||
{
|
||||
const int numberOfDesktops = VirtualDesktopManager::self()->count();
|
||||
|
@ -489,7 +470,7 @@ void AbstractClient::setDesktops(QVector<VirtualDesktop*> desktops)
|
|||
c2->setDesktops(desktops);
|
||||
}
|
||||
|
||||
doSetDesktop(desktop(), was_desk);
|
||||
doSetDesktop();
|
||||
|
||||
FocusChain::self()->update(this, FocusChain::MakeFirst);
|
||||
updateWindowRules(Rules::Desktop);
|
||||
|
@ -500,10 +481,8 @@ void AbstractClient::setDesktops(QVector<VirtualDesktop*> desktops)
|
|||
emit x11DesktopIdsChanged();
|
||||
}
|
||||
|
||||
void AbstractClient::doSetDesktop(int desktop, int was_desk)
|
||||
void AbstractClient::doSetDesktop()
|
||||
{
|
||||
Q_UNUSED(desktop)
|
||||
Q_UNUSED(was_desk)
|
||||
}
|
||||
|
||||
void AbstractClient::enterDesktop(VirtualDesktop *virtualDesktop)
|
||||
|
@ -619,11 +598,7 @@ void AbstractClient::minimize(bool avoid_animation)
|
|||
if (!isMinimizable() || isMinimized())
|
||||
return;
|
||||
|
||||
if (isShade() && info) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded
|
||||
info->setState(NET::States(), NET::Shaded);
|
||||
|
||||
m_minimized = true;
|
||||
|
||||
doMinimize();
|
||||
|
||||
updateWindowRules(Rules::Minimize);
|
||||
|
@ -643,11 +618,7 @@ void AbstractClient::unminimize(bool avoid_animation)
|
|||
return;
|
||||
}
|
||||
|
||||
if (isShade() && info) // NETWM restriction - KWindowInfo::isMinimized() == Hidden && !Shaded
|
||||
info->setState(NET::Shaded, NET::Shaded);
|
||||
|
||||
m_minimized = false;
|
||||
|
||||
doMinimize();
|
||||
|
||||
updateWindowRules(Rules::Minimize);
|
||||
|
@ -822,9 +793,9 @@ void AbstractClient::move(int x, int y, ForceGeometry_t force)
|
|||
screens()->setCurrent(this);
|
||||
workspace()->updateStackingOrder();
|
||||
// client itself is not damaged
|
||||
emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking());
|
||||
addRepaintDuringGeometryUpdates();
|
||||
updateGeometryBeforeUpdateBlocking();
|
||||
emit geometryChanged();
|
||||
}
|
||||
|
||||
bool AbstractClient::startMoveResize()
|
||||
|
@ -1081,8 +1052,8 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
|
|||
bool update = false;
|
||||
if (isResize()) {
|
||||
QRect orig = initialMoveResizeGeometry();
|
||||
Sizemode sizemode = SizemodeAny;
|
||||
auto calculateMoveResizeGeom = [this, &topleft, &bottomright, &orig, &sizemode, &mode]() {
|
||||
SizeMode sizeMode = SizeModeAny;
|
||||
auto calculateMoveResizeGeom = [this, &topleft, &bottomright, &orig, &sizeMode, &mode]() {
|
||||
switch(mode) {
|
||||
case PositionTopLeft:
|
||||
setMoveResizeGeometry(QRect(topleft, orig.bottomRight()));
|
||||
|
@ -1098,19 +1069,19 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
|
|||
break;
|
||||
case PositionTop:
|
||||
setMoveResizeGeometry(QRect(QPoint(orig.left(), topleft.y()), orig.bottomRight()));
|
||||
sizemode = SizemodeFixedH; // try not to affect height
|
||||
sizeMode = SizeModeFixedH; // try not to affect height
|
||||
break;
|
||||
case PositionBottom:
|
||||
setMoveResizeGeometry(QRect(orig.topLeft(), QPoint(orig.right(), bottomright.y())));
|
||||
sizemode = SizemodeFixedH;
|
||||
sizeMode = SizeModeFixedH;
|
||||
break;
|
||||
case PositionLeft:
|
||||
setMoveResizeGeometry(QRect(QPoint(topleft.x(), orig.top()), orig.bottomRight()));
|
||||
sizemode = SizemodeFixedW;
|
||||
sizeMode = SizeModeFixedW;
|
||||
break;
|
||||
case PositionRight:
|
||||
setMoveResizeGeometry(QRect(orig.topLeft(), QPoint(bottomright.x(), orig.bottom())));
|
||||
sizemode = SizemodeFixedW;
|
||||
sizeMode = SizeModeFixedW;
|
||||
break;
|
||||
case PositionCenter:
|
||||
default:
|
||||
|
@ -1211,7 +1182,7 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
|
|||
}
|
||||
|
||||
// Always obey size hints, even when in "unrestricted" mode
|
||||
QSize size = adjustedSize(moveResizeGeometry().size(), sizemode);
|
||||
QSize size = adjustedSize(moveResizeGeometry().size(), sizeMode);
|
||||
// the new topleft and bottomright corners (after checking size constrains), if they'll be needed
|
||||
topleft = QPoint(moveResizeGeometry().right() - size.width() + 1, moveResizeGeometry().bottom() - size.height() + 1);
|
||||
bottomright = QPoint(moveResizeGeometry().left() + size.width() - 1, moveResizeGeometry().top() + size.height() - 1);
|
||||
|
@ -1220,9 +1191,9 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
|
|||
// if aspect ratios are specified, both dimensions may change.
|
||||
// Therefore grow to the right/bottom if needed.
|
||||
// TODO it should probably obey gravity rather than always using right/bottom ?
|
||||
if (sizemode == SizemodeFixedH)
|
||||
if (sizeMode == SizeModeFixedH)
|
||||
orig.setRight(bottomright.x());
|
||||
else if (sizemode == SizemodeFixedW)
|
||||
else if (sizeMode == SizeModeFixedW)
|
||||
orig.setBottom(bottomright.y());
|
||||
|
||||
calculateMoveResizeGeom();
|
||||
|
@ -1238,7 +1209,7 @@ void AbstractClient::handleMoveResize(int x, int y, int x_root, int y_root)
|
|||
setMoveResizeGeometry(workspace()->clientArea(FullScreenArea, screen, 0));
|
||||
else {
|
||||
QRect moveResizeGeom = workspace()->clientArea(MaximizeArea, screen, 0);
|
||||
QSize adjSize = adjustedSize(moveResizeGeom.size(), SizemodeMax);
|
||||
QSize adjSize = adjustedSize(moveResizeGeom.size(), SizeModeMax);
|
||||
if (adjSize != moveResizeGeom.size()) {
|
||||
QRect r(moveResizeGeom);
|
||||
moveResizeGeom.setSize(adjSize);
|
||||
|
@ -1342,8 +1313,6 @@ void AbstractClient::performMoveResize()
|
|||
setFrameGeometry(moveResizeGeom);
|
||||
}
|
||||
doPerformMoveResize();
|
||||
if (isResize())
|
||||
addRepaintFull();
|
||||
positionGeometryTip();
|
||||
emit clientStepUserMovedResized(this, moveResizeGeom);
|
||||
}
|
||||
|
@ -1433,7 +1402,7 @@ void AbstractClient::setupWindowManagementInterface()
|
|||
w->setParentWindow(transientFor() ? transientFor()->windowManagementInterface() : nullptr);
|
||||
}
|
||||
);
|
||||
connect(this, &AbstractClient::geometryChanged, w,
|
||||
connect(this, &AbstractClient::frameGeometryChanged, w,
|
||||
[w, this] {
|
||||
w->setGeometry(frameGeometry());
|
||||
}
|
||||
|
@ -1882,7 +1851,7 @@ BORDER(Right)
|
|||
BORDER(Top)
|
||||
#undef BORDER
|
||||
|
||||
QSize AbstractClient::sizeForClientSize(const QSize &wsize, Sizemode mode, bool noframe) const
|
||||
QSize AbstractClient::sizeForClientSize(const QSize &wsize, SizeMode mode, bool noframe) const
|
||||
{
|
||||
Q_UNUSED(mode)
|
||||
Q_UNUSED(noframe)
|
||||
|
@ -3126,7 +3095,7 @@ void AbstractClient::checkOffscreenPosition(QRect* geom, const QRect& screenArea
|
|||
}
|
||||
}
|
||||
|
||||
QSize AbstractClient::adjustedSize(const QSize& frame, Sizemode mode) const
|
||||
QSize AbstractClient::adjustedSize(const QSize& frame, SizeMode mode) const
|
||||
{
|
||||
// first, get the window size for the given frame size s
|
||||
QSize wsize = frameSizeToClientSize(frame);
|
||||
|
@ -3143,4 +3112,122 @@ QSize AbstractClient::adjustedSize() const
|
|||
return sizeForClientSize(clientSize());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns @c true if the AbstractClient can be shown in full screen mode; otherwise @c false.
|
||||
*
|
||||
* Default implementation returns @c false.
|
||||
*/
|
||||
bool AbstractClient::isFullScreenable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns @c true if the AbstractClient is currently being shown in full screen mode; otherwise @c false.
|
||||
*
|
||||
* A client in full screen mode occupies the entire screen with no window frame around it.
|
||||
*
|
||||
* Default implementation returns @c false.
|
||||
*/
|
||||
bool AbstractClient::isFullScreen() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether requests initiated by the user to enter or leave full screen mode are honored.
|
||||
*
|
||||
* Default implementation returns @c false.
|
||||
*/
|
||||
bool AbstractClient::userCanSetFullScreen() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks the AbstractClient to enter or leave full screen mode.
|
||||
*
|
||||
* Default implementation does nothing.
|
||||
*
|
||||
* @param set @c true if the AbstractClient has to be shown in full screen mode, otherwise @c false
|
||||
* @param user @c true if the request is initiated by the user, otherwise @c false
|
||||
*/
|
||||
void AbstractClient::setFullScreen(bool set, bool user)
|
||||
{
|
||||
Q_UNUSED(set)
|
||||
Q_UNUSED(user)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns @c true if the AbstractClient can be minimized; otherwise @c false.
|
||||
*
|
||||
* Default implementation returns @c false.
|
||||
*/
|
||||
bool AbstractClient::isMinimizable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns @c true if the AbstractClient can be maximized; otherwise @c false.
|
||||
*
|
||||
* Default implementation returns @c false.
|
||||
*/
|
||||
bool AbstractClient::isMaximizable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently applied maximize mode.
|
||||
*
|
||||
* Default implementation returns MaximizeRestore.
|
||||
*/
|
||||
MaximizeMode AbstractClient::maximizeMode() const
|
||||
{
|
||||
return MaximizeRestore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last requested maximize mode.
|
||||
*
|
||||
* On X11, this method always matches maximizeMode(). On Wayland, it is asynchronous.
|
||||
*
|
||||
* Default implementation matches maximizeMode().
|
||||
*/
|
||||
MaximizeMode AbstractClient::requestedMaximizeMode() const
|
||||
{
|
||||
return maximizeMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the geometry of the AbstractClient before it was maximized or quick tiled.
|
||||
*/
|
||||
QRect AbstractClient::geometryRestore() const
|
||||
{
|
||||
return m_maximizeGeometryRestore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the geometry of the AbstractClient before it was maximized or quick tiled to @p rect.
|
||||
*/
|
||||
void AbstractClient::setGeometryRestore(const QRect &rect)
|
||||
{
|
||||
m_maximizeGeometryRestore = rect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the maximized state along specified dimensions @p horizontal and @p vertical.
|
||||
*
|
||||
* If @p adjust is @c true, only frame geometry will be updated to match requestedMaximizeMode().
|
||||
*
|
||||
* Default implementation does nothing.
|
||||
*/
|
||||
void AbstractClient::changeMaximize(bool horizontal, bool vertical, bool adjust)
|
||||
{
|
||||
Q_UNUSED(horizontal)
|
||||
Q_UNUSED(vertical)
|
||||
Q_UNUSED(adjust)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -220,8 +220,8 @@ class KWIN_EXPORT AbstractClient : public Toplevel
|
|||
Q_PROPERTY(bool modal READ isModal NOTIFY modalChanged)
|
||||
|
||||
/**
|
||||
* The geometry of this Client. Be aware that depending on resize mode the geometryChanged signal
|
||||
* might be emitted at each resize step or only at the end of the resize operation.
|
||||
* The geometry of this Client. Be aware that depending on resize mode the frameGeometryChanged
|
||||
* signal might be emitted at each resize step or only at the end of the resize operation.
|
||||
*/
|
||||
Q_PROPERTY(QRect geometry READ frameGeometry WRITE setFrameGeometry)
|
||||
|
||||
|
@ -416,8 +416,8 @@ public:
|
|||
virtual bool isHiddenInternal() const = 0;
|
||||
// TODO: remove boolean trap
|
||||
virtual void hideClient(bool hide) = 0;
|
||||
virtual bool isFullScreenable() const = 0;
|
||||
virtual bool isFullScreen() const = 0;
|
||||
virtual bool isFullScreenable() const;
|
||||
virtual bool isFullScreen() const;
|
||||
// TODO: remove boolean trap
|
||||
virtual AbstractClient *findModal(bool allow_itself = false) = 0;
|
||||
virtual bool isTransient() const;
|
||||
|
@ -484,20 +484,12 @@ public:
|
|||
bool isMinimized() const {
|
||||
return m_minimized;
|
||||
}
|
||||
virtual void setFullScreen(bool set, bool user = true) = 0;
|
||||
virtual void setFullScreen(bool set, bool user = true);
|
||||
|
||||
virtual void setClientShown(bool shown);
|
||||
|
||||
virtual QRect geometryRestore() const = 0;
|
||||
/**
|
||||
* The currently applied maximize mode
|
||||
*/
|
||||
virtual MaximizeMode maximizeMode() const = 0;
|
||||
/**
|
||||
* The maximise mode requested by the server.
|
||||
* For X this always matches maximizeMode, for wayland clients it
|
||||
* is asynchronous
|
||||
*/
|
||||
QRect geometryRestore() const;
|
||||
virtual MaximizeMode maximizeMode() const;
|
||||
virtual MaximizeMode requestedMaximizeMode() const;
|
||||
void maximize(MaximizeMode);
|
||||
/**
|
||||
|
@ -540,13 +532,10 @@ public:
|
|||
* Whether the Client can be shaded. Default implementation returns @c false.
|
||||
*/
|
||||
virtual bool isShadeable() const;
|
||||
/**
|
||||
* Returns whether the window is maximizable or not.
|
||||
*/
|
||||
virtual bool isMaximizable() const = 0;
|
||||
virtual bool isMinimizable() const = 0;
|
||||
virtual bool isMaximizable() const;
|
||||
virtual bool isMinimizable() const;
|
||||
virtual QRect iconGeometry() const;
|
||||
virtual bool userCanSetFullScreen() const = 0;
|
||||
virtual bool userCanSetFullScreen() const;
|
||||
virtual bool userCanSetNoBorder() const = 0;
|
||||
virtual void checkNoBorder();
|
||||
virtual void setOnActivities(QStringList newActivitiesList);
|
||||
|
@ -634,12 +623,15 @@ public:
|
|||
virtual QSize maxSize() const;
|
||||
virtual void setFrameGeometry(int x, int y, int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0;
|
||||
void setFrameGeometry(const QRect &rect, ForceGeometry_t force = NormalGeometrySet);
|
||||
/// How to resize the window in order to obey constains (mainly aspect ratios)
|
||||
enum Sizemode {
|
||||
SizemodeAny,
|
||||
SizemodeFixedW, ///< Try not to affect width
|
||||
SizemodeFixedH, ///< Try not to affect height
|
||||
SizemodeMax ///< Try not to make it larger in either direction
|
||||
|
||||
/**
|
||||
* How to resize the window in order to obey constraints (mainly aspect ratios).
|
||||
*/
|
||||
enum SizeMode {
|
||||
SizeModeAny,
|
||||
SizeModeFixedW, ///< Try not to affect width
|
||||
SizeModeFixedH, ///< Try not to affect height
|
||||
SizeModeMax ///< Try not to make it larger in either direction
|
||||
};
|
||||
/**
|
||||
* Calculates the appropriate frame size for the given client size @p wsize.
|
||||
|
@ -648,12 +640,12 @@ public:
|
|||
*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
|
@ -965,10 +957,8 @@ 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(int desktop, int was_desk);
|
||||
virtual void doSetDesktop();
|
||||
/**
|
||||
* Called from @ref minimize and @ref unminimize once the minimized value got updated, but before the
|
||||
* changed signal is emitted.
|
||||
|
@ -981,6 +971,7 @@ protected:
|
|||
virtual void doSetSkipTaskbar();
|
||||
virtual void doSetSkipPager();
|
||||
virtual void doSetSkipSwitcher();
|
||||
virtual void doSetDemandsAttention();
|
||||
|
||||
void setupWindowManagementInterface();
|
||||
void destroyWindowManagementInterface();
|
||||
|
@ -1025,8 +1016,8 @@ protected:
|
|||
int borderRight() const;
|
||||
int borderTop() const;
|
||||
int borderBottom() const;
|
||||
virtual void changeMaximize(bool horizontal, bool vertical, bool adjust) = 0;
|
||||
virtual void setGeometryRestore(const QRect &geo) = 0;
|
||||
virtual void changeMaximize(bool horizontal, bool vertical, bool adjust);
|
||||
void setGeometryRestore(const QRect &rect);
|
||||
|
||||
/**
|
||||
* Called from move after updating the geometry. Can be reimplemented to perform specific tasks.
|
||||
|
@ -1267,6 +1258,7 @@ private:
|
|||
QRect m_frameGeometryBeforeUpdateBlocking;
|
||||
QRect m_virtualKeyboardGeometry;
|
||||
QRect m_keyboardGeometryRestore;
|
||||
QRect m_maximizeGeometryRestore;
|
||||
|
||||
struct {
|
||||
bool enabled = false;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -381,11 +381,11 @@ void ActivationTest::testSwitchToWindowMaximized()
|
|||
QVERIFY(configureRequestedSpy1.wait());
|
||||
workspace()->slotWindowMaximize();
|
||||
QVERIFY(configureRequestedSpy1.wait());
|
||||
QSignalSpy geometryChangedSpy1(client1, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy1.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy1.isValid());
|
||||
shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>());
|
||||
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
|
||||
QVERIFY(geometryChangedSpy1.wait());
|
||||
QVERIFY(frameGeometryChangedSpy1.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 geometryChangedSpy2(client2, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy2.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy2.isValid());
|
||||
shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>());
|
||||
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
|
||||
QVERIFY(geometryChangedSpy2.wait());
|
||||
QVERIFY(frameGeometryChangedSpy2.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 geometryChangedSpy1(client1, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy1.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy1(client1, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy1.isValid());
|
||||
shellSurface1->ackConfigure(configureRequestedSpy1.last().at(2).value<quint32>());
|
||||
Test::render(surface1.data(), configureRequestedSpy1.last().at(0).toSize(), Qt::red);
|
||||
QVERIFY(geometryChangedSpy1.wait());
|
||||
QVERIFY(frameGeometryChangedSpy1.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 geometryChangedSpy2(client2, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy2.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy2(client2, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy2.isValid());
|
||||
shellSurface2->ackConfigure(configureRequestedSpy2.last().at(2).value<quint32>());
|
||||
Test::render(surface2.data(), configureRequestedSpy2.last().at(0).toSize(), Qt::red);
|
||||
QVERIFY(geometryChangedSpy2.wait());
|
||||
QVERIFY(frameGeometryChangedSpy2.wait());
|
||||
|
||||
const QList<Toplevel *> stackingOrder = workspace()->stackingOrder();
|
||||
QVERIFY(stackingOrder.indexOf(client1) < stackingOrder.indexOf(client2));
|
||||
|
|
|
@ -157,8 +157,8 @@ void MaximizeAnimationTest::testMaximizeRestore()
|
|||
QVERIFY(!effect->isActive());
|
||||
|
||||
// Maximize the client.
|
||||
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QCOMPARE(geometryChangedSpy.count(), 2);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
||||
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(geometryChangedSpy.wait());
|
||||
QCOMPARE(geometryChangedSpy.count(), 4);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 2);
|
||||
QCOMPARE(maximizeChangedSpy.count(), 2);
|
||||
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
||||
QVERIFY(effect->isActive());
|
||||
|
|
|
@ -133,8 +133,8 @@ void TestMaximized::testMaximizedPassedToDeco()
|
|||
QVERIFY(bordersChangedSpy.isValid());
|
||||
QSignalSpy maximizedChangedSpy(decoration->client().data(), &KDecoration2::DecoratedClient::maximizedChanged);
|
||||
QVERIFY(maximizedChangedSpy.isValid());
|
||||
QSignalSpy geometryShapeChangedSpy(client, &AbstractClient::geometryShapeChanged);
|
||||
QVERIFY(geometryShapeChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryShapeChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
|
||||
// If no borders, there is only the initial geometry shape change, but none through border resizing.
|
||||
QCOMPARE(geometryShapeChangedSpy.count(), hasBorders ? 2 : 1);
|
||||
QCOMPARE(frameGeometryChangedSpy.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(geometryShapeChangedSpy.wait());
|
||||
QCOMPARE(geometryShapeChangedSpy.count(), hasBorders ? 4 : 2);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(1280, 1024), Qt::blue);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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 geometryChangedSpy(client, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
|
||||
QVERIFY(client->isDecorated());
|
||||
QVERIFY(!client->noBorder());
|
||||
|
|
|
@ -138,8 +138,6 @@ 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);
|
||||
|
@ -243,8 +241,8 @@ void MoveResizeWindowTest::testResize()
|
|||
QVERIFY(c);
|
||||
QCOMPARE(workspace()->activeClient(), c);
|
||||
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized);
|
||||
QVERIFY(startMoveResizedSpy.isValid());
|
||||
QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged);
|
||||
|
@ -289,7 +287,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 50));
|
||||
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
||||
|
||||
|
@ -310,7 +308,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 58));
|
||||
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
|
||||
|
||||
|
@ -487,10 +485,10 @@ void MoveResizeWindowTest::testGrowShrink()
|
|||
QVERIFY(sizeChangeSpy.wait());
|
||||
Test::render(surface.data(), shellSurface->size(), Qt::red);
|
||||
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
m_connection->flush();
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QTEST(c->frameGeometry(), "expectedGeometry");
|
||||
}
|
||||
|
||||
|
@ -920,8 +918,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard()
|
|||
QVERIFY(configureRequestedSpy.wait());
|
||||
|
||||
client->move(100, 300);
|
||||
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
|
||||
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
|
||||
client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
|
||||
|
@ -930,7 +928,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
|
||||
QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101));
|
||||
client->setVirtualKeyboardGeometry(QRect());
|
||||
|
@ -939,7 +937,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
|
||||
}
|
||||
|
||||
|
@ -963,8 +961,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
|
|||
QVERIFY(configureRequestedSpy.wait());
|
||||
|
||||
client->move(100, 300);
|
||||
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
|
||||
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
|
||||
client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
|
||||
|
@ -973,14 +971,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
|
||||
|
||||
client->setVirtualKeyboardGeometry(QRect());
|
||||
|
@ -988,7 +986,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(!geometryChangedSpy.wait(10));
|
||||
QVERIFY(!frameGeometryChangedSpy.wait(10));
|
||||
|
||||
// Size will NOT be restored
|
||||
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
|
||||
|
@ -1014,8 +1012,8 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
|
|||
QVERIFY(configureRequestedSpy.wait());
|
||||
|
||||
client->move(100, 300);
|
||||
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
|
||||
QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800));
|
||||
client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
|
||||
|
@ -1024,14 +1022,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
|
||||
|
||||
client->setVirtualKeyboardGeometry(QRect());
|
||||
|
@ -1039,7 +1037,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(!geometryChangedSpy.wait(10));
|
||||
QVERIFY(!frameGeometryChangedSpy.wait(10));
|
||||
// Size will NOT be restored
|
||||
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
|
||||
}
|
||||
|
|
|
@ -241,10 +241,10 @@ void PlasmaSurfaceTest::testOSDPlacement()
|
|||
QCOMPARE(c->frameGeometry(), QRect(590, 649, 100, 50));
|
||||
|
||||
// change size of window
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryShapeChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
Test::render(surface.data(), QSize(200, 100), Qt::red);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(c->frameGeometry(), QRect(540, 616, 200, 100));
|
||||
}
|
||||
|
||||
|
|
|
@ -180,8 +180,8 @@ void QuickTilingTest::testQuickTiling()
|
|||
|
||||
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
|
||||
QVERIFY(quickTileChangedSpy.isValid());
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
|
||||
QFETCH(QuickTileMode, mode);
|
||||
QFETCH(QRect, expectedGeometry);
|
||||
|
@ -202,9 +202,8 @@ void QuickTilingTest::testQuickTiling()
|
|||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), expectedGeometry.size(), Qt::red);
|
||||
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue);
|
||||
QCOMPARE(geometryChangedSpy.count(), 1);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
||||
QCOMPARE(c->frameGeometry(), expectedGeometry);
|
||||
|
||||
// send window to other screen
|
||||
|
@ -257,8 +256,8 @@ void QuickTilingTest::testQuickMaximizing()
|
|||
|
||||
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
|
||||
QVERIFY(quickTileChangedSpy.isValid());
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
QSignalSpy maximizeChangedSpy1(c, qOverload<AbstractClient *, MaximizeMode>(&AbstractClient::clientMaximizedStateChanged));
|
||||
QVERIFY(maximizeChangedSpy1.isValid());
|
||||
QSignalSpy maximizeChangedSpy2(c, qOverload<AbstractClient *, bool, bool>(&AbstractClient::clientMaximizedStateChanged));
|
||||
|
@ -283,8 +282,8 @@ void QuickTilingTest::testQuickMaximizing()
|
|||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(1280, 1024), Qt::red);
|
||||
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QCOMPARE(geometryChangedSpy.count(), 2);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
||||
QCOMPARE(c->frameGeometry(), QRect(0, 0, 1280, 1024));
|
||||
QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50));
|
||||
|
||||
|
@ -316,8 +315,8 @@ void QuickTilingTest::testQuickMaximizing()
|
|||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(100, 50), Qt::yellow);
|
||||
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QCOMPARE(geometryChangedSpy.count(), 4);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 2);
|
||||
QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50));
|
||||
QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50));
|
||||
QCOMPARE(maximizeChangedSpy1.count(), 2);
|
||||
|
@ -782,14 +781,14 @@ void QuickTilingTest::testShortcut()
|
|||
QCOMPARE(configureRequestedSpy.last().at(0).toSize(), expectedGeometry.size());
|
||||
|
||||
// attach a new image
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), expectedGeometry.size(), Qt::red);
|
||||
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue);
|
||||
QCOMPARE(geometryChangedSpy.count(), 1);
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
||||
QCOMPARE(c->frameGeometry(), expectedGeometry);
|
||||
}
|
||||
|
||||
|
@ -837,8 +836,8 @@ void QuickTilingTest::testScript()
|
|||
|
||||
QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged);
|
||||
QVERIFY(quickTileChangedSpy.isValid());
|
||||
QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
|
||||
QVERIFY(Scripting::self());
|
||||
QTemporaryFile tmpFile;
|
||||
|
@ -881,9 +880,9 @@ void QuickTilingTest::testScript()
|
|||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), expectedGeometry.size(), Qt::red);
|
||||
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QEXPECT_FAIL("maximize", "Geometry changed called twice for maximize", Continue);
|
||||
QCOMPARE(geometryChangedSpy.count(), 1);
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
||||
QCOMPARE(c->frameGeometry(), expectedGeometry);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 geometryChangedSpy(c, &XdgShellClient::geometryShapeChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
plasmaSurface->setPosition(QPoint(1280, 1000));
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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));
|
||||
|
|
|
@ -209,6 +209,27 @@ 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()
|
||||
|
@ -249,7 +270,7 @@ void TransientPlacementTest::testXdgPopup()
|
|||
QCOMPARE(configureRequestedSpy.first()[0].value<QRect>(), expectedRelativeGeometry);
|
||||
popup->ackConfigure(configureRequestedSpy.first()[1].toUInt());
|
||||
|
||||
auto transient = Test::renderAndWaitForShown(transientSurface, positioner.initialSize(), Qt::red);
|
||||
auto transient = Test::renderAndWaitForShown(transientSurface, expectedRelativeGeometry.size(), Qt::red);
|
||||
QVERIFY(transient);
|
||||
|
||||
QVERIFY(!transient->isDecorated());
|
||||
|
@ -319,10 +340,10 @@ void TransientPlacementTest::testXdgPopupWithPanel()
|
|||
parent->setFullScreen(true);
|
||||
QVERIFY(fullscreenSpy.wait());
|
||||
parentShellSurface->ackConfigure(fullscreenSpy.first().at(2).value<quint32>());
|
||||
QSignalSpy geometryShapeChangedSpy{parent, &XdgShellClient::geometryShapeChanged};
|
||||
QVERIFY(geometryShapeChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy{parent, &XdgShellClient::frameGeometryChanged};
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
Test::render(parentSurface, fullscreenSpy.first().at(0).toSize(), Qt::red);
|
||||
QVERIFY(geometryShapeChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(parent->frameGeometry(), screens()->geometry(0));
|
||||
QVERIFY(parent->isFullScreen());
|
||||
|
||||
|
|
|
@ -579,10 +579,10 @@ void TestXdgShellClientRules::testPositionApplyNow()
|
|||
RuleBook::self()->setConfig(config);
|
||||
|
||||
// The client should be moved to the position specified by the rule.
|
||||
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
workspace()->slotReconfigure();
|
||||
QCOMPARE(geometryChangedSpy.count(), 1);
|
||||
QCOMPARE(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(480, 640), Qt::blue);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(100, 50), Qt::blue);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(100, 50), Qt::blue);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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 geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), QSize(1280, 1024), Qt::blue);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->size(), QSize(100, 50));
|
||||
QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
||||
QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
||||
|
|
|
@ -461,8 +461,8 @@ void TestXdgShellClient::testFullscreen()
|
|||
QCOMPARE(c->sizeForClientSize(c->clientSize()), c->frameGeometry().size());
|
||||
QSignalSpy fullscreenChangedSpy(c, &XdgShellClient::fullScreenChanged);
|
||||
QVERIFY(fullscreenChangedSpy.isValid());
|
||||
QSignalSpy geometryChangedSpy(c, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.isEmpty());
|
||||
QVERIFY(frameGeometryChangedSpy.isEmpty());
|
||||
|
||||
shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
|
||||
Test::render(surface.data(), sizeChangeRequestedSpy.first().first().toSize(), Qt::red);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QCOMPARE(geometryChangedSpy.count(), 1);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.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 geometryChangedSpy(c, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
|
||||
// swap back to normal
|
||||
configureRequestedSpy.clear();
|
||||
|
@ -554,8 +554,8 @@ void TestXdgShellClient::testFullscreenRestore()
|
|||
}
|
||||
|
||||
Test::render(surface.data(), QSize(100, 50), Qt::red);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QCOMPARE(geometryChangedSpy.count(), 1);
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.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 geometryChangedSpy(c, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(c, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
|
||||
QCOMPARE(c->maximizeMode(), MaximizeFull);
|
||||
QCOMPARE(geometryChangedSpy.isEmpty(), false);
|
||||
geometryChangedSpy.clear();
|
||||
QCOMPARE(frameGeometryChangedSpy.isEmpty(), false);
|
||||
frameGeometryChangedSpy.clear();
|
||||
|
||||
// fullscreen the window
|
||||
shellSurface->setFullscreen(true);
|
||||
|
@ -1318,10 +1318,10 @@ void TestXdgShellClient::testXdgWindowGeometryIsntSet()
|
|||
|
||||
const QPoint oldPosition = client->pos();
|
||||
|
||||
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
Test::render(surface.data(), QSize(100, 50), Qt::blue);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(120, 60));
|
||||
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition + QPoint(20, 10));
|
||||
|
@ -1356,27 +1356,29 @@ void TestXdgShellClient::testXdgWindowGeometryAttachBuffer()
|
|||
|
||||
const QPoint oldPosition = client->pos();
|
||||
|
||||
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
|
||||
surface->commit(Surface::CommitFlag::None);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
||||
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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 2);
|
||||
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
|
||||
QEXPECT_FAIL("", "Ask on wayland-devel what effective window geometry should be here", Continue);
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(100, 50));
|
||||
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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(frameGeometryChangedSpy.count(), 3);
|
||||
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(90, 40));
|
||||
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(5, 5));
|
||||
|
@ -1401,11 +1403,11 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface()
|
|||
|
||||
const QPoint oldPosition = client->pos();
|
||||
|
||||
QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
|
||||
surface->commit(Surface::CommitFlag::None);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(10, 10));
|
||||
|
@ -1424,7 +1426,7 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface()
|
|||
|
||||
shellSurface->setWindowGeometry(QRect(-15, -15, 50, 40));
|
||||
surface->commit(Surface::CommitFlag::None);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->frameGeometry().topLeft(), oldPosition);
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(50, 40));
|
||||
QCOMPARE(client->bufferGeometry().topLeft(), oldPosition - QPoint(-15, -15));
|
||||
|
@ -1449,11 +1451,11 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize()
|
|||
QVERIFY(configureRequestedSpy.wait());
|
||||
QCOMPARE(configureRequestedSpy.count(), 1);
|
||||
|
||||
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
|
||||
surface->commit(Surface::CommitFlag::None);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
|
||||
|
@ -1487,7 +1489,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(208, 100));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(188, 80));
|
||||
|
@ -1505,7 +1507,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(clientStepUserMovedResizedSpy.count(), 2);
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(208, 108));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(188, 88));
|
||||
|
@ -1544,11 +1546,11 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen()
|
|||
QVERIFY(configureRequestedSpy.wait());
|
||||
QCOMPARE(configureRequestedSpy.count(), 1);
|
||||
|
||||
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
|
||||
surface->commit(Surface::CommitFlag::None);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
|
||||
|
@ -1561,7 +1563,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(1280, 1024));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024));
|
||||
|
||||
|
@ -1574,7 +1576,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
|
||||
|
@ -1600,11 +1602,11 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize()
|
|||
QVERIFY(configureRequestedSpy.wait());
|
||||
QCOMPARE(configureRequestedSpy.count(), 1);
|
||||
|
||||
QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged);
|
||||
QVERIFY(geometryChangedSpy.isValid());
|
||||
QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged);
|
||||
QVERIFY(frameGeometryChangedSpy.isValid());
|
||||
shellSurface->setWindowGeometry(QRect(10, 10, 180, 80));
|
||||
surface->commit(Surface::CommitFlag::None);
|
||||
QVERIFY(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
|
||||
|
@ -1617,7 +1619,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(1280, 1024));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(1280, 1024));
|
||||
|
||||
|
@ -1630,7 +1632,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(geometryChangedSpy.wait());
|
||||
QVERIFY(frameGeometryChangedSpy.wait());
|
||||
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
|
||||
QCOMPARE(client->frameGeometry().size(), QSize(180, 80));
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
include_directories(${KWIN_SOURCE_DIR})
|
||||
include_directories(${KWin_SOURCE_DIR})
|
||||
add_definitions(-DKWIN_UNIT_TEST)
|
||||
########################################################
|
||||
# Test TabBox::ClientModel
|
||||
|
|
|
@ -283,7 +283,7 @@ private:
|
|||
ClockSkewNotifier *m_skewNotifier;
|
||||
|
||||
// Specifies whether Night Color is enabled.
|
||||
bool m_active;
|
||||
bool m_active = false;
|
||||
|
||||
// Specifies whether Night Color is currently running.
|
||||
bool m_running = false;
|
||||
|
|
|
@ -54,7 +54,7 @@ DecoratedClientImpl::DecoratedClientImpl(AbstractClient *client, KDecoration2::D
|
|||
emit decoratedClient->activeChanged(client->isActive());
|
||||
}
|
||||
);
|
||||
connect(client, &AbstractClient::geometryChanged, this,
|
||||
connect(client, &AbstractClient::frameGeometryChanged, this,
|
||||
[decoratedClient, this]() {
|
||||
if (m_client->clientSize() == m_clientSize) {
|
||||
return;
|
||||
|
|
86
doc/coding-conventions.md
Normal file
86
doc/coding-conventions.md
Normal file
|
@ -0,0 +1,86 @@
|
|||
# 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;
|
||||
}
|
||||
```
|
10
effects.cpp
10
effects.cpp
|
@ -334,6 +334,7 @@ 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) {
|
||||
|
@ -380,6 +381,7 @@ 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);
|
||||
}
|
||||
|
@ -637,6 +639,14 @@ 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
|
||||
|
|
|
@ -303,6 +303,7 @@ 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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env bash
|
||||
$EXTRACTRC `find . -name \*.ui` >> rc.cpp || exit 11
|
||||
$XGETTEXT `find . -name \*.cpp` -o $podir/kwin_effects.pot
|
||||
$XGETTEXT `find . -name \*.cpp -o -name \*.h` -o $podir/kwin_effects.pot
|
||||
rm -f rc.cpp
|
||||
|
|
|
@ -36,10 +36,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QMouseEvent>
|
||||
#include <QTimer>
|
||||
#include <QVector2D>
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
#include <QQuickItem>
|
||||
#include <QMatrix4x4>
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <QQmlContext>
|
||||
#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::windowGeometryShapeChanged, this, &DesktopGridEffect::slotWindowGeometryShapeChanged);
|
||||
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &DesktopGridEffect::slotWindowFrameGeometryChanged);
|
||||
connect(effects, &EffectsHandler::numberScreensChanged, this, &DesktopGridEffect::setup);
|
||||
|
||||
connect(effects, &EffectsHandler::screenAboutToLock, this, [this]() {
|
||||
|
@ -102,9 +102,6 @@ DesktopGridEffect::DesktopGridEffect()
|
|||
|
||||
DesktopGridEffect::~DesktopGridEffect()
|
||||
{
|
||||
foreach (DesktopButtonsView *view, m_desktopButtonsViews)
|
||||
view->deleteLater();
|
||||
m_desktopButtonsViews.clear();
|
||||
}
|
||||
|
||||
void DesktopGridEffect::reconfigure(ReconfigureFlags)
|
||||
|
@ -194,19 +191,9 @@ void DesktopGridEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaint
|
|||
}
|
||||
|
||||
// paint the add desktop button
|
||||
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);
|
||||
}
|
||||
for (EffectQuickScene *view : m_desktopButtons) {
|
||||
view->rootItem()->setOpacity(timeline.currentValue());
|
||||
effects->renderEffectQuickView(view);
|
||||
}
|
||||
|
||||
if (isUsingPresentWindows() && windowMove && wasWindowMove) {
|
||||
|
@ -313,14 +300,6 @@ 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();
|
||||
|
@ -444,12 +423,6 @@ 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) {
|
||||
|
@ -458,7 +431,7 @@ void DesktopGridEffect::slotWindowDeleted(EffectWindow* w)
|
|||
}
|
||||
}
|
||||
|
||||
void DesktopGridEffect::slotWindowGeometryShapeChanged(EffectWindow* w, const QRect& old)
|
||||
void DesktopGridEffect::slotWindowFrameGeometryChanged(EffectWindow* w, const QRect& old)
|
||||
{
|
||||
Q_UNUSED(old)
|
||||
if (!activated)
|
||||
|
@ -482,11 +455,9 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
|
|||
return;
|
||||
QMouseEvent* me = static_cast< QMouseEvent* >(e);
|
||||
if (!(wasWindowMove || wasDesktopMove)) {
|
||||
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);
|
||||
for (EffectQuickScene *view : m_desktopButtons) {
|
||||
view->forwardMouseEvent(me);
|
||||
if (e->isAccepted()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1060,7 +1031,7 @@ void DesktopGridEffect::setActive(bool active)
|
|||
[this] {
|
||||
if (activated)
|
||||
return;
|
||||
foreach (DesktopButtonsView *view, m_desktopButtonsViews) {
|
||||
for (EffectQuickScene *view : m_desktopButtons) {
|
||||
view->hide();
|
||||
}
|
||||
}
|
||||
|
@ -1125,33 +1096,46 @@ void DesktopGridEffect::setup()
|
|||
}
|
||||
}
|
||||
}
|
||||
bool enableAdd = effects->numberOfDesktops() < 20;
|
||||
bool enableRemove = effects->numberOfDesktops() > 1;
|
||||
|
||||
QVector<DesktopButtonsView*>::iterator it = m_desktopButtonsViews.begin();
|
||||
auto it = m_desktopButtons.begin();
|
||||
const int n = DesktopGridConfig::showAddRemove() ? effects->numScreens() : 0;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
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);
|
||||
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());
|
||||
} 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
|
||||
view->setPosition(screenRect.right() - border/3 - view->width(),
|
||||
screenRect.bottom() - border/3 - view->height());
|
||||
const QPoint position(screenRect.right() - border/3 - size.width(),
|
||||
screenRect.bottom() - border/3 - size.height());
|
||||
view->setGeometry(QRect(position, size));
|
||||
}
|
||||
while (it != m_desktopButtonsViews.end()) {
|
||||
while (it != m_desktopButtons.end()) {
|
||||
(*it)->deleteLater();
|
||||
it = m_desktopButtonsViews.erase(it);
|
||||
it = m_desktopButtons.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1297,12 +1281,6 @@ 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
|
||||
|
@ -1443,76 +1421,5 @@ 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
|
||||
|
||||
|
|
|
@ -25,35 +25,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kwineffects.h>
|
||||
#include <QObject>
|
||||
#include <QTimeLine>
|
||||
#include <QQuickView>
|
||||
|
||||
#include "kwineffectquickview.h"
|
||||
|
||||
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
|
||||
{
|
||||
|
@ -115,7 +94,7 @@ private Q_SLOTS:
|
|||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
void slotNumberDesktopsChanged(uint old);
|
||||
void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
|
||||
private:
|
||||
QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const;
|
||||
|
@ -182,7 +161,7 @@ private:
|
|||
QRect m_windowMoveGeometry;
|
||||
QPoint m_windowMoveStartPoint;
|
||||
|
||||
QVector<DesktopButtonsView*> m_desktopButtonsViews;
|
||||
QVector<EffectQuickScene*> m_desktopButtons;
|
||||
|
||||
QAction *m_activateAction;
|
||||
|
||||
|
|
|
@ -18,32 +18,20 @@ 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 org.kde.plasma.components 2.0 as Plasma
|
||||
import QtQuick.Layouts 1.2
|
||||
import org.kde.plasma.components 3.0 as Plasma
|
||||
|
||||
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: "+"
|
||||
}
|
||||
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++
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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, qOverload<>(&InvertEffectConfig::changed));
|
||||
connect(mShortcutEditor, &KShortcutsEditor::keyChange, this, &InvertEffectConfig::markAsChanged);
|
||||
layout->addWidget(mShortcutEditor);
|
||||
|
||||
load();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Name=Login
|
||||
Name[af]=Aanteken
|
||||
Name[ar]=ولوج
|
||||
Name[ast]=Aniciu de sesión
|
||||
Name[be]=Уваход
|
||||
Name[be@latin]=Uvachod
|
||||
Name[bg]=Вход
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Name=Logout
|
||||
Name[ast]=Zarru de sesión
|
||||
Name[ca]=Sortida
|
||||
Name[ca@valencia]=Eixida
|
||||
Name[cs]=Odhlášení
|
||||
|
|
|
@ -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, qOverload<>(&LookingGlassEffectConfig::changed));
|
||||
connect(m_ui->editor, &KShortcutsEditor::keyChange, this, &LookingGlassEffectConfig::markAsChanged);
|
||||
|
||||
// Shortcut config. The shortcut belongs to the component "kwin"!
|
||||
m_actionCollection = new KActionCollection(this, QStringLiteral("kwin"));
|
||||
|
|
|
@ -7,6 +7,7 @@ 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
|
||||
|
|
|
@ -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, qOverload<>(&MagnifierEffectConfig::changed));
|
||||
connect(m_ui->editor, &KShortcutsEditor::keyChange, this, &MagnifierEffectConfig::markAsChanged);
|
||||
|
||||
// Shortcut config. The shortcut belongs to the component "kwin"!
|
||||
m_actionCollection = new KActionCollection(this, QStringLiteral("kwin"));
|
||||
|
|
|
@ -93,7 +93,7 @@ var maximizeEffect = {
|
|||
},
|
||||
init: function () {
|
||||
effect.configChanged.connect(maximizeEffect.loadConfig);
|
||||
effects.windowGeometryShapeChanged.connect(maximizeEffect.geometryChange);
|
||||
effects.windowFrameGeometryChanged.connect(maximizeEffect.geometryChange);
|
||||
effects.windowMaximizedStateChanged.connect(maximizeEffect.maximizeChanged);
|
||||
effect.animationEnded.connect(maximizeEffect.restoreForceBlurState);
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ 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
|
||||
|
|
|
@ -26,7 +26,7 @@ var morphingEffect = {
|
|||
morphingEffect.duration = animationTime(150);
|
||||
},
|
||||
|
||||
geometryChange: function (window, oldGeometry) {
|
||||
handleFrameGeometryChanged: function (window, oldGeometry) {
|
||||
//only tooltips and notifications
|
||||
if (!window.tooltip && !window.notification && !window.criticalNotification) {
|
||||
return;
|
||||
|
@ -38,13 +38,6 @@ 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;
|
||||
|
@ -137,7 +130,7 @@ var morphingEffect = {
|
|||
|
||||
init: function () {
|
||||
effect.configChanged.connect(morphingEffect.loadConfig);
|
||||
effects.windowGeometryShapeChanged.connect(morphingEffect.geometryChange);
|
||||
effects.windowFrameGeometryChanged.connect(morphingEffect.handleFrameGeometryChanged);
|
||||
}
|
||||
};
|
||||
morphingEffect.init();
|
||||
|
|
|
@ -6,6 +6,7 @@ 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í
|
||||
|
|
|
@ -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::windowGeometryShapeChanged, this, &PresentWindowsEffect::slotWindowGeometryShapeChanged);
|
||||
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &PresentWindowsEffect::slotWindowFrameGeometryChanged);
|
||||
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::slotWindowGeometryShapeChanged(EffectWindow* w, const QRect& old)
|
||||
void PresentWindowsEffect::slotWindowFrameGeometryChanged(EffectWindow* w, const QRect& old)
|
||||
{
|
||||
Q_UNUSED(old)
|
||||
if (!m_activated)
|
||||
|
|
|
@ -208,7 +208,7 @@ public Q_SLOTS:
|
|||
void slotWindowAdded(KWin::EffectWindow *w);
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
// atoms
|
||||
void slotPropertyNotify(KWin::EffectWindow* w, long atom);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ 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]=Представяне на прозорци
|
||||
|
|
|
@ -7,6 +7,7 @@ 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
|
||||
|
|
|
@ -57,7 +57,7 @@ ShowPaintEffectConfig::ShowPaintEffectConfig(QWidget *parent, const QVariantList
|
|||
m_ui->shortcutsEditor->addCollection(actionCollection);
|
||||
|
||||
connect(m_ui->shortcutsEditor, &KShortcutsEditor::keyChange,
|
||||
this, qOverload<>(&ShowPaintEffectConfig::changed));
|
||||
this, &ShowPaintEffectConfig::markAsChanged);
|
||||
|
||||
load();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ Name[km]=ស្លាយ
|
|||
Name[kn]=ಜಾರು
|
||||
Name[ko]=슬라이드
|
||||
Name[ku]=Xîş Bike
|
||||
Name[lt]=Slidimas
|
||||
Name[lt]=Slydimas
|
||||
Name[lv]=Slīdēt
|
||||
Name[mai]=स्लाइड
|
||||
Name[ml]=തെന്നിമാറുക
|
||||
|
|
|
@ -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::windowGeometryShapeChanged, this, &SnapHelperEffect::slotWindowGeometryShapeChanged);
|
||||
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &SnapHelperEffect::slotWindowFrameGeometryChanged);
|
||||
}
|
||||
|
||||
SnapHelperEffect::~SnapHelperEffect()
|
||||
|
@ -316,7 +316,7 @@ void SnapHelperEffect::slotWindowFinishUserMovedResized(EffectWindow *w)
|
|||
effects->addRepaint(computeDirtyRegion(m_geometry));
|
||||
}
|
||||
|
||||
void SnapHelperEffect::slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old)
|
||||
void SnapHelperEffect::slotWindowFrameGeometryChanged(EffectWindow *w, const QRect &old)
|
||||
{
|
||||
if (w != m_window) {
|
||||
return;
|
||||
|
|
|
@ -47,7 +47,7 @@ private Q_SLOTS:
|
|||
void slotWindowClosed(EffectWindow *w);
|
||||
void slotWindowStartUserMovedResized(EffectWindow *w);
|
||||
void slotWindowFinishUserMovedResized(EffectWindow *w);
|
||||
void slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old);
|
||||
void slotWindowFrameGeometryChanged(EffectWindow *w, const QRect &old);
|
||||
|
||||
private:
|
||||
QRect m_geometry;
|
||||
|
|
|
@ -44,7 +44,7 @@ ThumbnailAsideEffect::ThumbnailAsideEffect()
|
|||
connect(a, &QAction::triggered, this, &ThumbnailAsideEffect::toggleCurrentThumbnail);
|
||||
|
||||
connect(effects, &EffectsHandler::windowClosed, this, &ThumbnailAsideEffect::slotWindowClosed);
|
||||
connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &ThumbnailAsideEffect::slotWindowGeometryShapeChanged);
|
||||
connect(effects, &EffectsHandler::windowFrameGeometryChanged, this, &ThumbnailAsideEffect::slotWindowFrameGeometryChanged);
|
||||
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::slotWindowGeometryShapeChanged(EffectWindow* w, const QRect& old)
|
||||
void ThumbnailAsideEffect::slotWindowFrameGeometryChanged(EffectWindow* w, const QRect& old)
|
||||
{
|
||||
foreach (const Data & d, windows) {
|
||||
if (d.window == w) {
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
private Q_SLOTS:
|
||||
void toggleCurrentThumbnail();
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
void slotWindowGeometryShapeChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
void slotWindowFrameGeometryChanged(KWin::EffectWindow *w, const QRect &old);
|
||||
void slotWindowDamaged(KWin::EffectWindow* w, const QRect& damage);
|
||||
bool isActive() const override;
|
||||
void repaintAll();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[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
|
||||
|
|
|
@ -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, qOverload<>(&WindowGeometryConfig::changed));
|
||||
connect(myUi->shortcuts, &KShortcutsEditor::keyChange, this, &WindowGeometryConfig::markAsChanged);
|
||||
|
||||
addConfig(WindowGeometryConfiguration::self(), myUi);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ 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
|
||||
|
|
|
@ -9,6 +9,7 @@ Name=Zoom
|
|||
Name[af]=Zoem
|
||||
Name[ar]=تكبير
|
||||
Name[as]=ডাঙৰকৈ প্ৰদৰ্শন
|
||||
Name[ast]=Zoom
|
||||
Name[be]=Маштабаванне
|
||||
Name[be@latin]=Maštab
|
||||
Name[bg]=Мащабиране
|
||||
|
|
|
@ -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 geometryChanged(); // update shadow region
|
||||
emit frameGeometryChanged(this, old); // update shadow region
|
||||
addRepaintFull();
|
||||
if (old.size() != m_frameGeometry.size())
|
||||
discardWindowPixmap();
|
||||
|
|
14
input.cpp
14
input.cpp
|
@ -759,7 +759,16 @@ public:
|
|||
return input()->shortcuts()->processAxis(event->modifiers(), direction);
|
||||
}
|
||||
bool keyEvent(QKeyEvent *event) override {
|
||||
if (event->type() == QEvent::KeyPress) {
|
||||
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) {
|
||||
return input()->shortcuts()->processKey(static_cast<KeyEvent*>(event)->modifiersRelevantForGlobalShortcuts(), event->key());
|
||||
}
|
||||
return false;
|
||||
|
@ -784,6 +793,9 @@ public:
|
|||
input()->shortcuts()->processSwipeEnd();
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
uint m_powerOffPress;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ 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
|
||||
{
|
||||
|
@ -62,6 +63,7 @@ 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();
|
||||
|
||||
|
@ -86,6 +88,9 @@ 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();
|
||||
|
@ -203,26 +208,6 @@ 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;
|
||||
|
@ -287,16 +272,6 @@ 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)
|
||||
|
@ -365,11 +340,6 @@ 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;
|
||||
|
@ -392,17 +362,6 @@ 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()) {
|
||||
|
@ -527,15 +486,6 @@ 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()) {
|
||||
|
@ -623,9 +573,11 @@ void InternalClient::commitGeometry(const QRect &rect)
|
|||
addWorkspaceRepaint(visibleRect());
|
||||
syncGeometryToInternalWindow();
|
||||
|
||||
const QRect oldGeometry = frameGeometryBeforeUpdateBlocking();
|
||||
if (frameGeometryBeforeUpdateBlocking() != frameGeometry()) {
|
||||
emit frameGeometryChanged(this, frameGeometryBeforeUpdateBlocking());
|
||||
}
|
||||
emit geometryShapeChanged(this, frameGeometryBeforeUpdateBlocking());
|
||||
updateGeometryBeforeUpdateBlocking();
|
||||
emit geometryShapeChanged(this, oldGeometry);
|
||||
|
||||
if (isResize()) {
|
||||
performMoveResize();
|
||||
|
|
|
@ -53,10 +53,6 @@ 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;
|
||||
|
@ -68,8 +64,6 @@ 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;
|
||||
|
@ -77,13 +71,10 @@ 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;
|
||||
|
@ -97,7 +88,6 @@ 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;
|
||||
|
@ -113,7 +103,6 @@ private:
|
|||
void updateInternalWindowGeometry();
|
||||
|
||||
QWindow *m_internalWindow = nullptr;
|
||||
QRect m_maximizeRestoreGeometry;
|
||||
QSize m_clientSize = QSize(0, 0);
|
||||
QString m_captionNormal;
|
||||
QString m_captionSuffix;
|
||||
|
|
|
@ -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})
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -13,6 +13,7 @@ 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
|
||||
|
@ -110,7 +111,6 @@ 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
Executable file → Normal file
2
kcmkwin/kwindecoration/Messages.sh
Executable file → Normal file
|
@ -1,4 +1,2 @@
|
|||
#! /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
|
||||
|
|
|
@ -14,6 +14,7 @@ X-KDE-Weight=60
|
|||
|
||||
Name=Virtual Desktops
|
||||
Name[ar]=أسطح المكتب الافتراضية
|
||||
Name[ast]=Escritorios virtuales
|
||||
Name[bg]=Виртуални работни плотове
|
||||
Name[bs]=Virtuelne površi
|
||||
Name[ca]=Escriptoris virtuals
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
[Desktop Entry]
|
||||
Name=Virtual Desktops
|
||||
Name[ar]=أسطح المكتب الافتراضية
|
||||
Name[ast]=Escritorios virtuales
|
||||
Name[bg]=Виртуални работни плотове
|
||||
Name[bs]=Virtuelne površi
|
||||
Name[ca]=Escriptoris virtuals
|
||||
|
|
|
@ -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,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[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[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ę
|
||||
|
|
|
@ -86,6 +86,8 @@ ScrollViewKCM {
|
|||
|
||||
property var _buttonGroups: []
|
||||
|
||||
clip: true
|
||||
|
||||
model: Private.EffectsFilterProxyModel {
|
||||
id: searchModel
|
||||
|
||||
|
|
|
@ -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,7 +17,9 @@ ki18n_wrap_ui(kcm_kwinoptions_PART_SRCS
|
|||
moving.ui
|
||||
)
|
||||
|
||||
qt5_add_dbus_interface(kcm_kwinoptions_PART_SRCS ${KWIN_SOURCE_DIR}/org.kde.kwin.Effects.xml kwin_effects_interface)
|
||||
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)
|
||||
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})
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
<string>Window &unshading:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>shadeHoverOn</cstring>
|
||||
<cstring>kcfg_ShadeHover</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="shadeHoverOn">
|
||||
<widget class="QCheckBox" name="kcfg_ShadeHover">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>If this option is enabled, a shaded window will unshade automatically when the mouse pointer has been over the titlebar for some time.</p></body></html></string>
|
||||
</property>
|
||||
|
@ -37,7 +37,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="shadeHover">
|
||||
<widget class="QSpinBox" name="kcfg_ShadeHoverInterval">
|
||||
<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 &placement:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>placementCombo</cstring>
|
||||
<cstring>kcfg_Placement</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="KComboBox" name="placementCombo">
|
||||
<widget class="KComboBox" name="kcfg_Placement">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>The placement policy determines where a new window will appear on the desktop.</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Smart</span> will try to achieve a minimum overlap of windows</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Maximizing</span> 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.</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Cascade</span> will cascade the windows</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Random</span> will use a random position</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Centered</span> will place the window centered</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Zero-cornered</span> will place the window in the top-left corner</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Under mouse</span> will place the window under the pointer</li></ul></body></html></string>
|
||||
</property>
|
||||
|
@ -118,12 +118,12 @@
|
|||
<string>&Special windows:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>hideUtilityWindowsForInactive</cstring>
|
||||
<cstring>kcfg_HideUtilityWindowsForInactive</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="hideUtilityWindowsForInactive">
|
||||
<widget class="QCheckBox" name="kcfg_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>
|
||||
|
|
62
kcmkwin/kwinoptions/kwinoptions_settings.kcfg
Normal file
62
kcmkwin/kwinoptions/kwinoptions_settings.kcfg
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?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>
|
6
kcmkwin/kwinoptions/kwinoptions_settings.kcfgc
Normal file
6
kcmkwin/kwinoptions/kwinoptions_settings.kcfgc
Normal file
|
@ -0,0 +1,6 @@
|
|||
File=kwinoptions_settings.kcfg
|
||||
ClassName=KWinOptionsSettings
|
||||
Mutators=true
|
||||
DefaultValueGetters=true
|
||||
ParentInConstructor=true
|
||||
Singleton=true
|
|
@ -50,7 +50,7 @@ class KMovingConfigStandalone : public KMovingConfig
|
|||
Q_OBJECT
|
||||
public:
|
||||
KMovingConfigStandalone(QWidget* parent, const QVariantList &)
|
||||
: KMovingConfig(true, new KConfig("kwinrc"), parent)
|
||||
: KMovingConfig(true, parent)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -59,7 +59,7 @@ class KAdvancedConfigStandalone : public KAdvancedConfig
|
|||
Q_OBJECT
|
||||
public:
|
||||
KAdvancedConfigStandalone(QWidget* parent, const QVariantList &)
|
||||
: KAdvancedConfig(true, new KConfig("kwinrc"), parent)
|
||||
: KAdvancedConfig(true, parent)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -76,27 +76,29 @@ 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, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mFocus, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
|
||||
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this);
|
||||
mTitleBarActions->setObjectName(QLatin1String("KWin TitleBar Actions"));
|
||||
tab->addTab(mTitleBarActions, i18n("Titlebar A&ctions"));
|
||||
connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mTitleBarActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
|
||||
mWindowActions = new KWindowActionsConfig(false, mConfig, this);
|
||||
mWindowActions->setObjectName(QLatin1String("KWin Window Actions"));
|
||||
tab->addTab(mWindowActions, i18n("W&indow Actions"));
|
||||
connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mWindowActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
|
||||
mMoving = new KMovingConfig(false, mConfig, this);
|
||||
mMoving = new KMovingConfig(false, this);
|
||||
mMoving->setObjectName(QLatin1String("KWin Moving"));
|
||||
tab->addTab(mMoving, i18n("Mo&vement"));
|
||||
connect(mMoving, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mMoving, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
connect(mMoving, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
|
||||
|
||||
mAdvanced = new KAdvancedConfig(false, mConfig, this);
|
||||
mAdvanced = new KAdvancedConfig(false, this);
|
||||
mAdvanced->setObjectName(QLatin1String("KWin Advanced"));
|
||||
tab->addTab(mAdvanced, i18n("Adva&nced"));
|
||||
connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mAdvanced, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
connect(mAdvanced, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
|
||||
|
||||
KAboutData *about =
|
||||
new KAboutData(QStringLiteral("kcmkwinoptions"), i18n("Window Behavior Configuration Module"),
|
||||
|
@ -189,12 +191,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, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mTitleBarActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
|
||||
mWindowActions = new KWindowActionsConfig(false, mConfig, this);
|
||||
mWindowActions->setObjectName(QLatin1String("KWin Window Actions"));
|
||||
tab->addTab(mWindowActions, i18n("Window Actio&ns"));
|
||||
connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
|
||||
connect(mWindowActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
|
||||
}
|
||||
|
||||
KActionsOptions::~KActionsOptions()
|
||||
|
@ -230,6 +232,8 @@ void KActionsOptions::defaults()
|
|||
{
|
||||
mTitleBarActions->defaults();
|
||||
mWindowActions->defaults();
|
||||
|
||||
emit defaulted(true);
|
||||
}
|
||||
|
||||
void KActionsOptions::moduleChanged(bool state)
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
<string>Window &geometry:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>geometryTipOn</cstring>
|
||||
<cstring>kcfg_GeometryTip</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="geometryTipOn">
|
||||
<widget class="QCheckBox" name="kcfg_GeometryTip">
|
||||
<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 &edge snap zone:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>borderSnap</cstring>
|
||||
<cstring>kcfg_BorderSnapZone</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="borderSnap">
|
||||
<widget class="QSpinBox" name="kcfg_BorderSnapZone">
|
||||
<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="windowSnap">
|
||||
<widget class="QSpinBox" name="kcfg_WindowSnapZone">
|
||||
<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="centerSnap">
|
||||
<widget class="QSpinBox" name="kcfg_CenterSnapZone">
|
||||
<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="OverlapSnap">
|
||||
<widget class="QCheckBox" name="kcfg_SnapOnlyWhenOverlapping">
|
||||
<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>&Window snap zone:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>windowSnap</cstring>
|
||||
<cstring>kcfg_WindowSnapZone</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -133,7 +133,7 @@
|
|||
<string>&Center snap zone:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>centerSnap</cstring>
|
||||
<cstring>kcfg_CenterSnapZone</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -143,7 +143,7 @@
|
|||
<string>&Snap windows:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>OverlapSnap</cstring>
|
||||
<cstring>kcfg_SnapOnlyWhenOverlapping</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -37,38 +37,21 @@
|
|||
#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
|
||||
|
@ -169,22 +152,22 @@ void KFocusConfig::focusPolicyChanged()
|
|||
{
|
||||
switch (m_ui->windowFocusPolicyCombo->currentIndex()) {
|
||||
case 0:
|
||||
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>"));
|
||||
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."));
|
||||
break;
|
||||
case 1:
|
||||
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>"));
|
||||
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>."));
|
||||
break;
|
||||
case 2:
|
||||
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>"));
|
||||
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."));
|
||||
break;
|
||||
case 3:
|
||||
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>"));
|
||||
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."));
|
||||
break;
|
||||
case 4:
|
||||
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>"));
|
||||
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!"));
|
||||
break;
|
||||
case 5:
|
||||
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>"));
|
||||
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!"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -370,51 +353,22 @@ KWinAdvancedConfigForm::KWinAdvancedConfigForm(QWidget* parent)
|
|||
|
||||
KAdvancedConfig::~KAdvancedConfig()
|
||||
{
|
||||
if (standAlone)
|
||||
delete config;
|
||||
}
|
||||
|
||||
KAdvancedConfig::KAdvancedConfig(bool _standAlone, KConfig *_config, QWidget *parent)
|
||||
: KCModule(parent), config(_config), standAlone(_standAlone)
|
||||
KAdvancedConfig::KAdvancedConfig(bool _standAlone, QWidget *parent)
|
||||
: KCModule(parent), m_config(KWinOptionsSettings::self()), standAlone(_standAlone)
|
||||
, m_ui(new KWinAdvancedConfigForm(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");
|
||||
addConfig(m_config, this);
|
||||
|
||||
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()));
|
||||
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");
|
||||
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)
|
||||
|
@ -426,62 +380,17 @@ 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)
|
||||
{
|
||||
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());
|
||||
KCModule::save();
|
||||
|
||||
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)
|
||||
|
@ -492,34 +401,16 @@ KWinMovingConfigForm::KWinMovingConfigForm(QWidget* parent)
|
|||
|
||||
KMovingConfig::~KMovingConfig()
|
||||
{
|
||||
if (standAlone)
|
||||
delete config;
|
||||
}
|
||||
|
||||
KMovingConfig::KMovingConfig(bool _standAlone, KConfig *_config, QWidget *parent)
|
||||
: KCModule(parent), config(_config), standAlone(_standAlone)
|
||||
KMovingConfig::KMovingConfig(bool _standAlone, QWidget *parent)
|
||||
: KCModule(parent), m_config(KWinOptionsSettings::self()), standAlone(_standAlone)
|
||||
, m_ui(new KWinMovingConfigForm(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()));
|
||||
|
||||
addConfig(m_config, this);
|
||||
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) {
|
||||
|
@ -529,54 +420,11 @@ 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)
|
||||
{
|
||||
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);
|
||||
m_config->save();
|
||||
|
||||
if (standAlone) {
|
||||
config->sync();
|
||||
// Send signal to all kwin instances
|
||||
QDBusMessage message =
|
||||
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
|
||||
|
@ -586,54 +434,9 @@ void KMovingConfig::save(void)
|
|||
OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"),
|
||||
QStringLiteral("/Effects"),
|
||||
QDBusConnection::sessionBus());
|
||||
if (geometryTip) {
|
||||
if (m_config->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);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ class QSpinBox;
|
|||
|
||||
class KColorButton;
|
||||
|
||||
class KWinOptionsSettings;
|
||||
|
||||
class KWinFocusConfigForm : public QWidget, public Ui::KWinFocusConfigForm
|
||||
{
|
||||
|
@ -118,71 +119,37 @@ class KMovingConfig : public KCModule
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMovingConfig(bool _standAlone, KConfig *config, QWidget *parent);
|
||||
KMovingConfig(bool _standAlone, 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:
|
||||
bool getGeometryTip(void); //KS
|
||||
|
||||
void setGeometryTip(bool); //KS
|
||||
|
||||
KConfig *config;
|
||||
KWinOptionsSettings *m_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, KConfig *config, QWidget *parent);
|
||||
KAdvancedConfig(bool _standAlone, 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:
|
||||
|
||||
int getShadeHoverInterval(void);
|
||||
void setShadeHover(bool);
|
||||
void setShadeHoverInterval(int);
|
||||
|
||||
KConfig *config;
|
||||
KWinOptionsSettings *m_config;
|
||||
bool standAlone;
|
||||
KWinAdvancedConfigForm *m_ui;
|
||||
|
||||
void setHideUtilityWindowsForInactive(bool);
|
||||
};
|
||||
|
||||
#endif // KKWMWINDOWS_H
|
||||
|
|
|
@ -6,13 +6,11 @@ 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 ${kwinrules_MOC_SRCS})
|
||||
set(kwinrules_SRCS ruleswidget.cpp ruleslist.cpp kwinsrc.cpp detectwidget.cpp main.cpp ${kwinrules_MOC_SRCS})
|
||||
|
||||
ki18n_wrap_ui(kwinrules_SRCS ruleslist.ui detectwidget.ui editshortcut.ui ruleswidgetbase.ui)
|
||||
|
||||
set(kwin_rules_dialog_KDEINIT_SRCS main.cpp ${kwinrules_SRCS})
|
||||
|
||||
kf5_add_kdeinit_executable(kwin_rules_dialog ${kwin_rules_dialog_KDEINIT_SRCS})
|
||||
add_executable(kwin_rules_dialog ${kwinrules_SRCS})
|
||||
|
||||
set(kwin_kcm_rules_XCB_LIBS
|
||||
XCB::CURSOR
|
||||
|
@ -36,9 +34,8 @@ if (KWIN_BUILD_ACTIVITIES)
|
|||
set(kcm_libs ${kcm_libs} KF5::Activities)
|
||||
endif()
|
||||
|
||||
target_link_libraries(kdeinit_kwin_rules_dialog ${kcm_libs} ${kwin_kcm_rules_XCB_LIBS})
|
||||
target_link_libraries(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 ###############
|
||||
|
|
|
@ -233,8 +233,7 @@ static void edit(const QVariantMap &data, bool whole_app)
|
|||
|
||||
} // namespace
|
||||
|
||||
extern "C"
|
||||
KWIN_EXPORT int kdemain(int argc, char* argv[])
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -11,6 +11,7 @@ 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
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
# 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
|
||||
|
|
18
kcmkwin/kwintabbox/kwinpluginssettings.kcfg
Normal file
18
kcmkwin/kwintabbox/kwinpluginssettings.kcfg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?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>
|
7
kcmkwin/kwintabbox/kwinpluginssettings.kcfgc
Normal file
7
kcmkwin/kwintabbox/kwinpluginssettings.kcfgc
Normal file
|
@ -0,0 +1,7 @@
|
|||
File=kwinpluginssettings.kcfg
|
||||
NameSpace=KWin::TabBox
|
||||
ClassName=PluginsSettings
|
||||
IncludeFiles=effect_builtins.h
|
||||
Mutators=true
|
||||
DefaultValueGetters=true
|
||||
ParentInConstructor=true
|
17
kcmkwin/kwintabbox/kwinswitcheffectsettings.kcfg
Normal file
17
kcmkwin/kwintabbox/kwinswitcheffectsettings.kcfg
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?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>
|
6
kcmkwin/kwintabbox/kwinswitcheffectsettings.kcfgc
Normal file
6
kcmkwin/kwintabbox/kwinswitcheffectsettings.kcfgc
Normal file
|
@ -0,0 +1,6 @@
|
|||
File=kwinswitcheffectsettings.kcfg
|
||||
NameSpace=KWin::TabBox
|
||||
ClassName=SwitchEffectSettings
|
||||
Mutators=true
|
||||
DefaultValueGetters=true
|
||||
ParentInConstructor=true
|
41
kcmkwin/kwintabbox/kwintabboxsettings.kcfg
Normal file
41
kcmkwin/kwintabbox/kwintabboxsettings.kcfg
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?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>
|
7
kcmkwin/kwintabbox/kwintabboxsettings.kcfgc
Normal file
7
kcmkwin/kwintabbox/kwintabboxsettings.kcfgc
Normal file
|
@ -0,0 +1,7 @@
|
|||
File=kwintabboxsettings.kcfg
|
||||
NameSpace=KWin::TabBox
|
||||
ClassName=TabBoxSettings
|
||||
IncludeFiles=\"tabboxconfig.h\"
|
||||
Mutators=true
|
||||
DefaultValueGetters=true
|
||||
ParentInConstructor=true
|
|
@ -3,6 +3,7 @@
|
|||
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
|
||||
|
@ -48,8 +49,10 @@ 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>();)
|
||||
|
||||
|
@ -67,6 +70,11 @@ 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);
|
||||
|
@ -163,8 +171,9 @@ KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args)
|
|||
if ((policy == "FocusUnderMouse") || (policy == "FocusStrictlyUnderMouse")) {
|
||||
tabWidget->setEnabled(false);
|
||||
infoLabel->show();
|
||||
} else
|
||||
} else {
|
||||
infoLabel->hide();
|
||||
}
|
||||
}
|
||||
|
||||
KWinTabBoxConfig::~KWinTabBoxConfig()
|
||||
|
@ -263,22 +272,36 @@ void KWinTabBoxConfig::load()
|
|||
{
|
||||
KCModule::load();
|
||||
|
||||
const QString group[2] = { "TabBox", "TabBoxAlternative" };
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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();\
|
||||
|
@ -297,59 +320,15 @@ 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);
|
||||
saveConfig(config, m_tabBoxConfig);
|
||||
config = KConfigGroup(m_config, "TabBoxAlternative");
|
||||
saveConfig(config, m_tabBoxAlternativeConfig);
|
||||
m_tabBoxConfig->save();
|
||||
m_tabBoxAlternativeConfig->save();
|
||||
|
||||
// effects
|
||||
bool highlightWindows = m_primaryTabBoxUi->highlightWindowCheck->isChecked() ||
|
||||
|
@ -364,22 +343,24 @@ void KWinTabBoxConfig::save()
|
|||
m_alternativeTabBoxUi->effectCombo->currentIndex() == FlipSwitch;
|
||||
|
||||
// activate effects if not active
|
||||
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();
|
||||
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();
|
||||
|
||||
// Reload KWin.
|
||||
QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
|
||||
|
@ -396,35 +377,17 @@ void KWinTabBoxConfig::save()
|
|||
|
||||
void KWinTabBoxConfig::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);
|
||||
KCModule::defaults();
|
||||
|
||||
ui[i]->switchingModeCombo->setCurrentIndex(TabBoxConfig::defaultSwitchingMode());
|
||||
m_tabBoxConfig->setDefaults();
|
||||
m_tabBoxAlternativeConfig->setDefaults();
|
||||
|
||||
// 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"));
|
||||
}
|
||||
m_pluginsConfig->setDefaults();
|
||||
m_coverSwitchConfig->setDefaults();
|
||||
m_flipSwitchConfig->setDefaults();
|
||||
|
||||
updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig);
|
||||
updateUiFromConfig(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig);
|
||||
|
||||
QString action;
|
||||
auto RESET_SHORTCUT = [this](KKeySequenceWidget *widget, const QKeySequence &sequence = QKeySequence()) {
|
||||
|
@ -444,66 +407,65 @@ void KWinTabBoxConfig::defaults()
|
|||
emit changed(true);
|
||||
}
|
||||
|
||||
bool KWinTabBoxConfig::effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const
|
||||
void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm *ui, const KWin::TabBox::TabBoxSettings *config)
|
||||
{
|
||||
return cfg.readEntry(BuiltInEffects::nameForEffect(effect) + "Enabled", BuiltInEffects::enabledByDefault(effect));
|
||||
}
|
||||
#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);
|
||||
|
||||
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());
|
||||
ui->switchingModeCombo->setCurrentIndex(config->switchingMode());
|
||||
|
||||
// check boxes
|
||||
ui->showTabBox->setChecked(config.isShowTabBox());
|
||||
ui->highlightWindowCheck->setChecked(config.isHighlightWindows());
|
||||
ui->effectCombo->setCurrentIndex(ui->effectCombo->findData(config.layoutName()));
|
||||
ui->showTabBox->setChecked(config->showTabBox());
|
||||
ui->highlightWindowCheck->setChecked(config->highlightWindows());
|
||||
ui->effectCombo->setCurrentIndex(ui->effectCombo->findData(config->layoutName()));
|
||||
CONFIGURE(showDesktop, showDesktop, ==, ShowDesktopClient);
|
||||
#undef CONFIGURE
|
||||
}
|
||||
|
||||
void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm* ui, TabBox::TabBoxConfig& config)
|
||||
void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm *ui, TabBoxSettings *config)
|
||||
{
|
||||
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.setClientSwitchingMode(TabBoxConfig::ClientSwitchingMode(ui->switchingModeCombo->currentIndex()));
|
||||
|
||||
config.setShowTabBox(ui->showTabBox->isChecked());
|
||||
config.setHighlightWindows(ui->highlightWindowCheck->isChecked());
|
||||
if (ui->effectCombo->currentIndex() >= Layout) {
|
||||
config.setLayoutName(ui->effectCombo->itemData(ui->effectCombo->currentIndex()).toString());
|
||||
if (ui->filterDesktops->isChecked()) {
|
||||
config->setDesktopMode(ui->currentDesktop->isChecked() ? TabBoxConfig::OnlyCurrentDesktopClients : TabBoxConfig::ExcludeCurrentDesktopClients);
|
||||
} else {
|
||||
config->setDesktopMode(TabBoxConfig::AllDesktopsClients);
|
||||
}
|
||||
config.setShowDesktopMode(ui->showDesktop->isChecked() ? TabBoxConfig::ShowDesktopClient : TabBoxConfig::DoNotShowDesktopClient);
|
||||
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);
|
||||
}
|
||||
|
||||
config->setSwitchingMode(TabBoxConfig::ClientSwitchingMode(ui->switchingModeCombo->currentIndex()));
|
||||
|
||||
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->setShowDesktopMode(ui->showDesktop->isChecked() ? TabBoxConfig::ShowDesktopClient : TabBoxConfig::DoNotShowDesktopClient);
|
||||
}
|
||||
|
||||
#define CHECK_CURRENT_TABBOX_UI \
|
||||
|
@ -523,7 +485,8 @@ 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);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
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
|
||||
|
@ -23,7 +24,6 @@ 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,7 +35,9 @@ namespace KWin
|
|||
enum class BuiltInEffect;
|
||||
namespace TabBox
|
||||
{
|
||||
|
||||
class TabBoxSettings;
|
||||
class SwitchEffectSettings;
|
||||
class PluginsSettings;
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,10 +70,8 @@ private Q_SLOTS:
|
|||
void shortcutChanged(const QKeySequence &seq);
|
||||
void slotGHNS();
|
||||
private:
|
||||
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 updateUiFromConfig(KWinTabBoxConfigForm *ui, const TabBox::TabBoxSettings *config);
|
||||
void updateConfigFromUi(const KWinTabBoxConfigForm *ui, TabBox::TabBoxSettings *config);
|
||||
void initLayoutLists();
|
||||
|
||||
private:
|
||||
|
@ -85,10 +85,12 @@ private:
|
|||
KSharedConfigPtr m_config;
|
||||
KActionCollection* m_actionCollection;
|
||||
KShortcutsEditor* m_editor;
|
||||
TabBox::TabBoxConfig m_tabBoxConfig;
|
||||
TabBox::TabBoxConfig m_tabBoxAlternativeConfig;
|
||||
TabBox::TabBoxSettings *m_tabBoxConfig;
|
||||
TabBox::TabBoxSettings *m_tabBoxAlternativeConfig;
|
||||
TabBox::SwitchEffectSettings *m_coverSwitchConfig;
|
||||
TabBox::SwitchEffectSettings *m_flipSwitchConfig;
|
||||
TabBox::PluginsSettings *m_pluginsConfig;
|
||||
|
||||
bool effectEnabled(const BuiltInEffect& effect, const KConfigGroup& cfg) const;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
14
layers.cpp
14
layers.cpp
|
@ -222,8 +222,10 @@ 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) {
|
||||
if ((*it)->isClient())
|
||||
cl[pos++] = (*it)->window();
|
||||
X11Client *client = qobject_cast<X11Client *>(*it);
|
||||
if (client) {
|
||||
cl[pos++] = client->window();
|
||||
}
|
||||
}
|
||||
for (const auto win : manual_overlays) {
|
||||
cl[pos++] = win;
|
||||
|
@ -851,14 +853,6 @@ 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()) {
|
||||
|
|
|
@ -346,12 +346,14 @@ 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()
|
||||
|
@ -360,9 +362,6 @@ EffectQuickScene::~EffectQuickScene()
|
|||
|
||||
void EffectQuickScene::setSource(const QUrl &source)
|
||||
{
|
||||
if (!d->qmlObject) {
|
||||
d->qmlObject = new KDeclarative::QmlObjectSharedEngine(this);
|
||||
}
|
||||
d->qmlObject->setSource(source);
|
||||
|
||||
QQuickItem *item = rootItem();
|
||||
|
|
|
@ -1519,6 +1519,13 @@ 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
|
||||
|
|
|
@ -340,8 +340,7 @@ void ApplicationX11::crashHandler(int signal)
|
|||
|
||||
} // namespace
|
||||
|
||||
extern "C"
|
||||
KWIN_EXPORT int kdemain(int argc, char * argv[])
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
KWin::Application::setupMalloc();
|
||||
KWin::Application::setupLocalizedString();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -88,6 +88,7 @@ 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
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
"Name[fr]": "drm",
|
||||
"Name[gl]": "drm",
|
||||
"Name[hu]": "drm",
|
||||
"Name[ia]": "drm",
|
||||
"Name[id]": "drm",
|
||||
"Name[it]": "drm",
|
||||
"Name[ko]": "drm",
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
"Name[fr]": "framebuffer",
|
||||
"Name[gl]": "framebuffer",
|
||||
"Name[hu]": "framebuffer",
|
||||
"Name[ia]": "framebuffer",
|
||||
"Name[id]": "framebuffer",
|
||||
"Name[it]": "framebuffer",
|
||||
"Name[ko]": "framebuffer",
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
"Name[fr]": "virtual",
|
||||
"Name[gl]": "virtual",
|
||||
"Name[hu]": "virtuális",
|
||||
"Name[ia]": "virtual",
|
||||
"Name[id]": "virtual",
|
||||
"Name[it]": "virtual",
|
||||
"Name[ko]": "virtual",
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
"Name[fr]": "wayland",
|
||||
"Name[gl]": "wayland",
|
||||
"Name[hu]": "wayland",
|
||||
"Name[ia]": "wayland",
|
||||
"Name[id]": "wayland",
|
||||
"Name[it]": "wayland",
|
||||
"Name[ko]": "wayland",
|
||||
|
|
|
@ -243,6 +243,19 @@ 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)))
|
||||
|
@ -289,7 +302,7 @@ void SceneQPainter::Window::performPaint(int mask, QRegion region, WindowPaintDa
|
|||
// render content
|
||||
QRect source;
|
||||
QRect target;
|
||||
if (toplevel->isClient()) {
|
||||
if (isXwaylandClient(toplevel)) {
|
||||
// special case for XWayland windows
|
||||
source = QRect(toplevel->clientPos(), toplevel->clientSize());
|
||||
target = source;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
set(kwindowsystem_plugin_SRCS
|
||||
plugin.cpp
|
||||
windoweffects.cpp
|
||||
windowshadow.cpp
|
||||
windowsystem.cpp
|
||||
)
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "plugin.h"
|
||||
#include "windowsystem.h"
|
||||
#include "windoweffects.h"
|
||||
#include "windowshadow.h"
|
||||
#include "windowsystem.h"
|
||||
|
||||
KWindowSystemKWinPlugin::KWindowSystemKWinPlugin(QObject *parent)
|
||||
: KWindowSystemPluginInterface(parent)
|
||||
|
@ -39,3 +40,13 @@ KWindowSystemPrivate *KWindowSystemKWinPlugin::createWindowSystem()
|
|||
{
|
||||
return new KWin::WindowSystem();
|
||||
}
|
||||
|
||||
KWindowShadowTilePrivate *KWindowSystemKWinPlugin::createWindowShadowTile()
|
||||
{
|
||||
return new KWin::WindowShadowTile();
|
||||
}
|
||||
|
||||
KWindowShadowPrivate *KWindowSystemKWinPlugin::createWindowShadow()
|
||||
{
|
||||
return new KWin::WindowShadow();
|
||||
}
|
||||
|
|
|
@ -33,4 +33,6 @@ public:
|
|||
|
||||
KWindowEffectsPrivate *createEffects() override;
|
||||
KWindowSystemPrivate *createWindowSystem() override;
|
||||
KWindowShadowTilePrivate *createWindowShadowTile() override;
|
||||
KWindowShadowPrivate *createWindowShadow() override;
|
||||
};
|
||||
|
|
95
plugins/windowsystem/windowshadow.cpp
Normal file
95
plugins/windowsystem/windowshadow.cpp
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* 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
|
42
plugins/windowsystem/windowshadow.h
Normal file
42
plugins/windowsystem/windowshadow.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* 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
|
|
@ -51,6 +51,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <QHoverEvent>
|
||||
#include <QWindow>
|
||||
#include <QPainter>
|
||||
// Wayland
|
||||
#include <wayland-cursor.h>
|
||||
|
||||
|
@ -502,7 +503,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::geometryChanged, this,
|
||||
m_decorationGeometryConnection = connect(decoration()->client(), &AbstractClient::frameGeometryChanged, this,
|
||||
[this] {
|
||||
// ensure maximize button gets the leave event when maximizing/restore a window, see BUG 385140
|
||||
const auto oldDeco = decoration();
|
||||
|
@ -564,7 +565,7 @@ void PointerInputRedirection::focusUpdate(Toplevel *focusOld, Toplevel *focusNow
|
|||
seat->setPointerPos(m_pos.toPoint());
|
||||
seat->setFocusedPointerSurface(focusNow->surface(), focusNow->inputTransformation());
|
||||
|
||||
m_focusGeometryConnection = connect(focusNow, &Toplevel::geometryChanged, this,
|
||||
m_focusGeometryConnection = connect(focusNow, &Toplevel::frameGeometryChanged, this,
|
||||
[this] {
|
||||
// TODO: why no assert possible?
|
||||
if (!focus()) {
|
||||
|
@ -1221,6 +1222,7 @@ void CursorImage::updateDragCursor()
|
|||
if (auto dragIcon = ddi->icon()) {
|
||||
if (auto buffer = dragIcon->buffer()) {
|
||||
additionalIcon = buffer->data().copy();
|
||||
additionalIcon.setOffset(dragIcon->offset());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1253,7 +1255,32 @@ void CursorImage::updateDragCursor()
|
|||
return;
|
||||
}
|
||||
m_drag.cursor.hotSpot = c->hotspot();
|
||||
m_drag.cursor.image = buffer->data().copy();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
if (needsEmit) {
|
||||
emit changed();
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue