summaryrefslogtreecommitdiffstats
path: root/twin/options.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2023-04-05 22:08:38 +0300
committerMavridis Philippe <[email protected]>2023-05-27 16:40:33 +0300
commitad771450f3fe9c170d8cef42147e444f2f7aaea8 (patch)
tree0b296fed6100dc178d1eff80e8709d6d4f27666e /twin/options.cpp
parent60f10cca06201053402a2af678ac59387db4b61e (diff)
downloadtdebase-ad771450f3fe9c170d8cef42147e444f2f7aaea8.tar.gz
tdebase-ad771450f3fe9c170d8cef42147e444f2f7aaea8.zip
TWin: Active borders and snap tiling
This commit is a squash of the commits of TDE/tdebase#331. In short, this backports some improvements to existing electric border functionality from KDE, adds the snap tiling (or aerosnap) feature and brings rudimentary support for active corners, which will be fully implemented in a later PR. The options dialog and the documentation has been updated to reflect these changes. Additionally, a new relevant option is introduced: an option for restoring the original size of maximized/tiled windows when the user starts dragging them. The option is set to be off by default, preserving the traditional behaviour of KDE 3.x/TDE. Last but not least, the term "electric" in relation to borders and corners is replaced by "active" for clarity to the users. Signed-off-by: Mavridis Philippe <[email protected]> (cherry picked from commit 31335a04ed9bc01fd3ede33afde40d6f3359f2e9)
Diffstat (limited to 'twin/options.cpp')
-rw-r--r--twin/options.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/twin/options.cpp b/twin/options.cpp
index ce35f6d06..3d237255b 100644
--- a/twin/options.cpp
+++ b/twin/options.cpp
@@ -31,8 +31,8 @@ namespace KWinInternal
#ifndef KCMRULES
Options::Options()
- : electric_borders( 0 ),
- electric_border_delay(0)
+ : active_borders( 0 ),
+ active_border_delay(0)
{
d = new KDecorationOptionsPrivate;
d->defaultKWinSettings();
@@ -54,6 +54,7 @@ unsigned long Options::updateSettings()
moveMode = stringToMoveResizeMode( config->readEntry("MoveMode", "Opaque" ));
resizeMode = stringToMoveResizeMode( config->readEntry("ResizeMode", "Opaque" ));
show_geometry_tip = config->readBoolEntry("GeometryTip", false);
+ reset_maximized_window_geometry = config->readBoolEntry("ResetMaximizedWindowGeometry", false);
tabboxOutline = config->readBoolEntry("TabboxOutline", true);
TQString val;
@@ -125,8 +126,16 @@ unsigned long Options::updateSettings()
borderSnapZone = config->readNumEntry("BorderSnapZone", 10);
windowSnapZone = config->readNumEntry("WindowSnapZone", 10);
snapOnlyWhenOverlapping=config->readBoolEntry("SnapOnlyWhenOverlapping",FALSE);
- electric_borders = config->readNumEntry("ElectricBorders", 0);
- electric_border_delay = config->readNumEntry("ElectricBorderDelay", 150);
+
+ // active borders: compatibility with old option names (Electric*)
+ active_borders = config->readNumEntry("ActiveBorders", -1);
+ if (active_borders == -1) {
+ active_borders = config->readNumEntry("ElectricBorders", 0);
+ }
+ active_border_delay = config->readNumEntry("ActiveBorderDelay", -1);
+ if (active_border_delay == -1) {
+ active_border_delay = config->readNumEntry("ElectricBorderDelay", 150);
+ }
OpTitlebarDblClick = windowOperation( config->readEntry("TitlebarDoubleClickCommand", "Shade"), true );
d->OpMaxButtonLeftClick = windowOperation( config->readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true );
@@ -308,6 +317,11 @@ bool Options::showGeometryTip()
return show_geometry_tip;
}
+bool Options::resetMaximizedWindowGeometry()
+ {
+ return reset_maximized_window_geometry;
+ }
+
TQColor &Options::shadowColour(bool active)
{
return active ? shadow_colour : shadow_inactive_colour;
@@ -373,14 +387,14 @@ int Options::shadowYOffset(bool active)
return active ? shadow_y_offset : shadow_inactive_y_offset;
}
-int Options::electricBorders()
+int Options::activeBorders()
{
- return electric_borders;
+ return active_borders;
}
-int Options::electricBorderDelay()
+int Options::activeBorderDelay()
{
- return electric_border_delay;
+ return active_border_delay;
}
bool Options::checkIgnoreFocusStealing( const Client* c )