2000-03-24 22:23:02 +00:00
|
|
|
/*****************************************************************
|
2003-09-16 19:28:03 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2000-12-08 00:54:19 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
2003-09-16 19:28:03 +00:00
|
|
|
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
2000-03-24 22:23:02 +00:00
|
|
|
******************************************************************/
|
2003-09-16 19:28:03 +00:00
|
|
|
|
1999-10-09 09:55:16 +00:00
|
|
|
#include "options.h"
|
2004-03-24 19:05:49 +00:00
|
|
|
|
2004-06-21 16:25:24 +00:00
|
|
|
#ifndef KCMRULES
|
|
|
|
|
1999-10-10 03:22:21 +00:00
|
|
|
#include <qpalette.h>
|
1999-11-07 15:48:24 +00:00
|
|
|
#include <qpixmap.h>
|
2001-12-29 17:33:05 +00:00
|
|
|
#include <kapplication.h>
|
1999-10-10 03:22:21 +00:00
|
|
|
#include <kconfig.h>
|
|
|
|
#include <kglobal.h>
|
2000-09-23 19:58:45 +00:00
|
|
|
#include <kglobalsettings.h>
|
2003-11-20 13:01:09 +00:00
|
|
|
#include <qtooltip.h>
|
2005-07-28 14:59:42 +00:00
|
|
|
#include <QDesktopWidget>
|
1999-10-09 09:55:16 +00:00
|
|
|
|
2004-03-24 19:05:49 +00:00
|
|
|
#include "client.h"
|
|
|
|
|
2004-06-21 16:25:24 +00:00
|
|
|
#endif
|
|
|
|
|
2001-04-20 07:19:03 +00:00
|
|
|
namespace KWinInternal
|
|
|
|
{
|
|
|
|
|
2004-06-21 16:25:24 +00:00
|
|
|
#ifndef KCMRULES
|
|
|
|
|
1999-10-11 02:00:06 +00:00
|
|
|
Options::Options()
|
2003-09-16 19:28:03 +00:00
|
|
|
: electric_borders( 0 ),
|
|
|
|
electric_border_delay(0)
|
|
|
|
{
|
|
|
|
d = new KDecorationOptionsPrivate;
|
|
|
|
d->defaultKWinSettings();
|
|
|
|
updateSettings();
|
1999-10-11 02:00:06 +00:00
|
|
|
}
|
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
Options::~Options()
|
|
|
|
{
|
|
|
|
delete d;
|
|
|
|
}
|
1999-10-10 03:22:21 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
unsigned long Options::updateSettings()
|
|
|
|
{
|
1999-10-10 03:22:21 +00:00
|
|
|
KConfig *config = KGlobal::config();
|
2003-09-16 19:28:03 +00:00
|
|
|
unsigned long changed = 0;
|
|
|
|
changed |= d->updateKWinSettings( config ); // read decoration settings
|
1999-11-20 06:27:07 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
config->setGroup( "Windows" );
|
2004-06-09 08:33:53 +00:00
|
|
|
moveMode = stringToMoveResizeMode( config->readEntry("MoveMode", "Opaque" ));
|
|
|
|
resizeMode = stringToMoveResizeMode( config->readEntry("ResizeMode", "Opaque" ));
|
2006-01-03 14:01:15 +00:00
|
|
|
show_geometry_tip = config->readEntry("GeometryTip", QVariant(false)).toBool();
|
1999-12-22 04:49:43 +00:00
|
|
|
|
1999-11-20 06:27:07 +00:00
|
|
|
QString val;
|
2000-03-24 22:23:02 +00:00
|
|
|
|
2000-06-22 18:08:35 +00:00
|
|
|
val = config->readEntry ("FocusPolicy", "ClickToFocus");
|
|
|
|
focusPolicy = ClickToFocus; // what a default :-)
|
|
|
|
if ( val == "FocusFollowsMouse" )
|
2001-01-20 03:55:42 +00:00
|
|
|
focusPolicy = FocusFollowsMouse;
|
2000-06-22 18:08:35 +00:00
|
|
|
else if ( val == "FocusUnderMouse" )
|
2001-01-20 03:55:42 +00:00
|
|
|
focusPolicy = FocusUnderMouse;
|
2000-06-22 18:08:35 +00:00
|
|
|
else if ( val == "FocusStrictlyUnderMouse" )
|
2001-01-20 03:55:42 +00:00
|
|
|
focusPolicy = FocusStrictlyUnderMouse;
|
2000-06-22 18:08:35 +00:00
|
|
|
|
|
|
|
val = config->readEntry ("AltTabStyle", "KDE");
|
|
|
|
altTabStyle = KDE; // what a default :-)
|
|
|
|
if ( val == "CDE" )
|
2001-01-20 03:55:42 +00:00
|
|
|
altTabStyle = CDE;
|
1999-12-22 04:49:43 +00:00
|
|
|
|
2006-01-03 14:01:15 +00:00
|
|
|
rollOverDesktops = config->readEntry("RollOverDesktops", QVariant(TRUE)).toBool();
|
2003-09-29 11:23:14 +00:00
|
|
|
|
2006-01-21 19:36:31 +00:00
|
|
|
// focusStealingPreventionLevel = config->readEntry( "FocusStealingPreventionLevel", 2 );
|
2003-12-09 14:10:13 +00:00
|
|
|
// TODO use low level for now
|
2006-01-21 19:36:31 +00:00
|
|
|
focusStealingPreventionLevel = config->readEntry( "FocusStealingPreventionLevel", 1 );
|
2005-10-22 11:35:06 +00:00
|
|
|
focusStealingPreventionLevel = qMax( 0, qMin( 4, focusStealingPreventionLevel ));
|
2004-02-02 17:02:11 +00:00
|
|
|
if( !focusPolicyIsReasonable()) // #48786, comments #7 and later
|
|
|
|
focusStealingPreventionLevel = 0;
|
2002-02-28 21:04:36 +00:00
|
|
|
|
2003-02-18 04:55:07 +00:00
|
|
|
KConfig *gc = new KConfig("kdeglobals", false, false);
|
2003-02-18 04:34:53 +00:00
|
|
|
bool isVirtual = KApplication::desktop()->isVirtualDesktop();
|
|
|
|
gc->setGroup("Windows");
|
2006-01-03 14:01:15 +00:00
|
|
|
xineramaEnabled = gc->readEntry ("XineramaEnabled", QVariant(isVirtual )).toBool() &&
|
2003-02-18 04:34:53 +00:00
|
|
|
isVirtual;
|
2003-09-16 19:28:03 +00:00
|
|
|
if (xineramaEnabled)
|
|
|
|
{
|
2006-01-03 14:01:15 +00:00
|
|
|
xineramaPlacementEnabled = gc->readEntry ("XineramaPlacementEnabled", QVariant(true)).toBool();
|
|
|
|
xineramaMovementEnabled = gc->readEntry ("XineramaMovementEnabled", QVariant(true)).toBool();
|
|
|
|
xineramaMaximizeEnabled = gc->readEntry ("XineramaMaximizeEnabled", QVariant(true)).toBool();
|
|
|
|
xineramaFullscreenEnabled = gc->readEntry ("XineramaFullscreenEnabled", QVariant(true)).toBool();
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-10 23:22:27 +00:00
|
|
|
xineramaPlacementEnabled = xineramaMovementEnabled = xineramaMaximizeEnabled = xineramaFullscreenEnabled = false;
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
2003-02-18 04:55:07 +00:00
|
|
|
delete gc;
|
2001-06-03 09:04:03 +00:00
|
|
|
|
2004-05-31 14:14:10 +00:00
|
|
|
placement = Placement::policyFromString( config->readEntry("Placement"), true );
|
2003-09-16 19:28:03 +00:00
|
|
|
|
2006-01-03 14:01:15 +00:00
|
|
|
animateShade = config->readEntry("AnimateShade", QVariant(TRUE )).toBool();
|
1999-11-20 06:27:07 +00:00
|
|
|
|
2006-01-03 14:01:15 +00:00
|
|
|
animateMinimize = config->readEntry("AnimateMinimize", QVariant(TRUE )).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
animateMinimizeSpeed = config->readEntry("AnimateMinimizeSpeed", 5 );
|
2000-10-23 14:56:55 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
if( focusPolicy == ClickToFocus )
|
|
|
|
{
|
2002-12-17 20:20:31 +00:00
|
|
|
autoRaise = false;
|
|
|
|
autoRaiseInterval = 0;
|
2004-05-28 08:53:44 +00:00
|
|
|
delayFocus = false;
|
|
|
|
delayFocusInterval = 0;
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-01-03 14:01:15 +00:00
|
|
|
autoRaise = config->readEntry("AutoRaise", QVariant(FALSE )).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
autoRaiseInterval = config->readEntry("AutoRaiseInterval", 0 );
|
2006-01-03 14:01:15 +00:00
|
|
|
delayFocus = config->readEntry("DelayFocus", QVariant(FALSE )).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
delayFocusInterval = config->readEntry("DelayFocusInterval", 0 );
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
2000-07-09 20:29:53 +00:00
|
|
|
|
2006-01-03 14:01:15 +00:00
|
|
|
shadeHover = config->readEntry("ShadeHover", QVariant(FALSE )).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
shadeHoverInterval = config->readEntry("ShadeHoverInterval", 250 );
|
2001-01-14 20:16:04 +00:00
|
|
|
|
2000-07-09 20:29:53 +00:00
|
|
|
// important: autoRaise implies ClickRaise
|
2006-01-03 14:01:15 +00:00
|
|
|
clickRaise = autoRaise || config->readEntry("ClickRaise", QVariant(TRUE )).toBool();
|
2000-07-09 20:29:53 +00:00
|
|
|
|
2006-01-21 19:36:31 +00:00
|
|
|
borderSnapZone = config->readEntry("BorderSnapZone", 10);
|
|
|
|
windowSnapZone = config->readEntry("WindowSnapZone", 10);
|
2006-01-03 14:01:15 +00:00
|
|
|
snapOnlyWhenOverlapping=config->readEntry("SnapOnlyWhenOverlapping", QVariant(FALSE)).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
electric_borders = config->readEntry("ElectricBorders", 0);
|
|
|
|
electric_border_delay = config->readEntry("ElectricBorderDelay", 150);
|
1999-12-22 04:49:43 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
OpTitlebarDblClick = windowOperation( config->readEntry("TitlebarDoubleClickCommand", "Shade"), true );
|
2004-08-28 15:27:22 +00:00
|
|
|
d->OpMaxButtonLeftClick = windowOperation( config->readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true );
|
|
|
|
d->OpMaxButtonMiddleClick = windowOperation( config->readEntry("MaximizeButtonMiddleClickCommand", "Maximize (vertical only)"), true );
|
|
|
|
d->OpMaxButtonRightClick = windowOperation( config->readEntry("MaximizeButtonRightClickCommand", "Maximize (horizontal only)"), true );
|
1999-11-29 02:06:41 +00:00
|
|
|
|
2006-01-25 14:25:30 +00:00
|
|
|
ignorePositionClasses = config->readEntry("IgnorePositionClasses",QStringList());
|
|
|
|
ignoreFocusStealingClasses = config->readEntry("IgnoreFocusStealingClasses",QStringList());
|
2004-02-23 12:47:28 +00:00
|
|
|
// Qt3.2 and older had resource class all lowercase, but Qt3.3 has it capitalized
|
|
|
|
// therefore Client::resourceClass() forces lowercase, force here lowercase as well
|
|
|
|
for( QStringList::Iterator it = ignorePositionClasses.begin();
|
|
|
|
it != ignorePositionClasses.end();
|
|
|
|
++it )
|
|
|
|
(*it) = (*it).lower();
|
|
|
|
for( QStringList::Iterator it = ignoreFocusStealingClasses.begin();
|
|
|
|
it != ignoreFocusStealingClasses.end();
|
|
|
|
++it )
|
|
|
|
(*it) = (*it).lower();
|
2000-10-23 18:27:23 +00:00
|
|
|
|
2006-01-21 19:36:31 +00:00
|
|
|
killPingTimeout = config->readEntry( "KillPingTimeout", 5000 );
|
2006-01-04 17:28:58 +00:00
|
|
|
hideUtilityWindowsForInactive = config->readEntry( "HideUtilityWindowsForInactive", QVariant( true )).toBool();
|
2004-06-11 15:01:18 +00:00
|
|
|
|
1999-11-29 02:06:41 +00:00
|
|
|
// Mouse bindings
|
|
|
|
config->setGroup( "MouseBindings");
|
2003-09-16 19:28:03 +00:00
|
|
|
CmdActiveTitlebar1 = mouseCommand(config->readEntry("CommandActiveTitlebar1","Raise"), true );
|
|
|
|
CmdActiveTitlebar2 = mouseCommand(config->readEntry("CommandActiveTitlebar2","Lower"), true );
|
|
|
|
CmdActiveTitlebar3 = mouseCommand(config->readEntry("CommandActiveTitlebar3","Operations menu"), true );
|
|
|
|
CmdInactiveTitlebar1 = mouseCommand(config->readEntry("CommandInactiveTitlebar1","Activate and raise"), true );
|
|
|
|
CmdInactiveTitlebar2 = mouseCommand(config->readEntry("CommandInactiveTitlebar2","Activate and lower"), true );
|
|
|
|
CmdInactiveTitlebar3 = mouseCommand(config->readEntry("CommandInactiveTitlebar3","Operations menu"), true );
|
2005-05-06 15:20:49 +00:00
|
|
|
CmdTitlebarWheel = mouseWheelCommand(config->readEntry("CommandTitlebarWheel","Nothing"));
|
2003-09-16 19:28:03 +00:00
|
|
|
CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click"), false );
|
|
|
|
CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click"), false );
|
|
|
|
CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3","Activate and pass click"), false );
|
2002-03-02 13:50:26 +00:00
|
|
|
CmdAllModKey = (config->readEntry("CommandAllKey","Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt;
|
2003-09-16 19:28:03 +00:00
|
|
|
CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move"), false );
|
|
|
|
CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower"), false );
|
|
|
|
CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize"), false );
|
2005-05-06 15:20:49 +00:00
|
|
|
CmdAllWheel = mouseWheelCommand(config->readEntry("CommandAllWheel","Nothing"));
|
2001-07-01 10:10:17 +00:00
|
|
|
|
2005-01-15 17:07:48 +00:00
|
|
|
//translucency settings
|
2005-01-16 21:03:59 +00:00
|
|
|
config->setGroup( "Notification Messages" );
|
2006-01-03 14:01:15 +00:00
|
|
|
useTranslucency = config->readEntry("UseTranslucency", QVariant(false)).toBool();
|
2005-01-16 21:03:59 +00:00
|
|
|
config->setGroup( "Translucency");
|
2006-01-03 14:01:15 +00:00
|
|
|
translucentActiveWindows = config->readEntry("TranslucentActiveWindows", QVariant(false)).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
activeWindowOpacity = uint((config->readEntry("ActiveWindowOpacity", 100)/100.0)*0xFFFFFFFF);
|
2006-01-03 14:01:15 +00:00
|
|
|
translucentInactiveWindows = config->readEntry("TranslucentInactiveWindows", QVariant(false)).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
inactiveWindowOpacity = uint((config->readEntry("InactiveWindowOpacity", 75)/100.0)*0xFFFFFFFF);
|
2006-01-03 14:01:15 +00:00
|
|
|
translucentMovingWindows = config->readEntry("TranslucentMovingWindows", QVariant(false)).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
movingWindowOpacity = uint((config->readEntry("MovingWindowOpacity", 50)/100.0)*0xFFFFFFFF);
|
2006-01-03 14:01:15 +00:00
|
|
|
translucentDocks = config->readEntry("TranslucentDocks", QVariant(false)).toBool();
|
2006-01-21 19:36:31 +00:00
|
|
|
dockOpacity = uint((config->readEntry("DockOpacity", 80)/100.0)*0xFFFFFFFF);
|
2006-01-03 14:01:15 +00:00
|
|
|
keepAboveAsActive = config->readEntry("TreatKeepAboveAsActive", QVariant(true)).toBool();
|
2005-01-15 17:07:48 +00:00
|
|
|
//TODO: remove this variable
|
|
|
|
useTitleMenuSlider = true;
|
2006-01-21 19:36:31 +00:00
|
|
|
activeWindowShadowSize = config->readEntry("ActiveWindowShadowSize", 200);
|
|
|
|
inactiveWindowShadowSize = config->readEntry("InactiveWindowShadowSize", 100);
|
|
|
|
dockShadowSize = config->readEntry("DockShadowSize", 80);
|
2006-01-03 14:01:15 +00:00
|
|
|
removeShadowsOnMove = config->readEntry("RemoveShadowsOnMove", QVariant(true)).toBool();
|
|
|
|
removeShadowsOnResize = config->readEntry("RemoveShadowsOnResize", QVariant(true)).toBool();
|
|
|
|
onlyDecoTranslucent = config->readEntry("OnlyDecoTranslucent", QVariant(false)).toBool();
|
|
|
|
if (resetKompmgr = config->readEntry("ResetKompmgr", QVariant(false)).toBool())
|
2005-01-15 17:07:48 +00:00
|
|
|
config->writeEntry("ResetKompmgr",FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-07-02 12:40:14 +00:00
|
|
|
// Read button tooltip animation effect from kdeglobals
|
|
|
|
// Since we want to allow users to enable window decoration tooltips
|
|
|
|
// and not kstyle tooltips and vise-versa, we don't read the
|
|
|
|
// "EffectNoTooltip" setting from kdeglobals.
|
|
|
|
KConfig globalConfig("kdeglobals");
|
|
|
|
globalConfig.setGroup("KDE");
|
2006-01-03 14:01:15 +00:00
|
|
|
topmenus = globalConfig.readEntry( "macStyle", QVariant(false )).toBool();
|
2003-11-12 09:47:13 +00:00
|
|
|
|
|
|
|
KConfig kdesktopcfg( "kdesktoprc", true );
|
|
|
|
kdesktopcfg.setGroup( "Menubar" );
|
2006-01-03 14:01:15 +00:00
|
|
|
desktop_topmenu = kdesktopcfg.readEntry( "ShowMenubar", QVariant(false )).toBool();
|
2003-11-12 09:47:13 +00:00
|
|
|
if( desktop_topmenu )
|
|
|
|
topmenus = true;
|
2005-07-28 14:59:42 +00:00
|
|
|
|
|
|
|
// QToolTip::setGloballyEnabled( d->show_tooltips );
|
|
|
|
// KDE4 this probably needs to be done manually in clients
|
2002-03-07 03:19:57 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
return changed;
|
|
|
|
}
|
1999-11-29 02:06:41 +00:00
|
|
|
|
1999-11-25 23:12:32 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
// restricted should be true for operations that the user may not be able to repeat
|
|
|
|
// if the window is moved out of the workspace (e.g. if the user moves a window
|
|
|
|
// by the titlebar, and moves it too high beneath Kicker at the top edge, they
|
|
|
|
// may not be able to move it back, unless they know about Alt+LMB)
|
|
|
|
Options::WindowOperation Options::windowOperation(const QString &name, bool restricted )
|
|
|
|
{
|
1999-11-29 02:06:41 +00:00
|
|
|
if (name == "Move")
|
2003-09-16 19:28:03 +00:00
|
|
|
return restricted ? MoveOp : UnrestrictedMoveOp;
|
1999-11-29 02:06:41 +00:00
|
|
|
else if (name == "Resize")
|
2003-09-16 19:28:03 +00:00
|
|
|
return restricted ? ResizeOp : UnrestrictedResizeOp;
|
1999-11-29 02:06:41 +00:00
|
|
|
else if (name == "Maximize")
|
2001-01-20 03:55:42 +00:00
|
|
|
return MaximizeOp;
|
2003-09-16 19:28:03 +00:00
|
|
|
else if (name == "Minimize")
|
|
|
|
return MinimizeOp;
|
1999-11-29 02:06:41 +00:00
|
|
|
else if (name == "Close")
|
2001-01-20 03:55:42 +00:00
|
|
|
return CloseOp;
|
2003-09-16 19:28:03 +00:00
|
|
|
else if (name == "OnAllDesktops")
|
|
|
|
return OnAllDesktopsOp;
|
1999-11-29 02:06:41 +00:00
|
|
|
else if (name == "Shade")
|
2001-01-20 03:55:42 +00:00
|
|
|
return ShadeOp;
|
1999-11-29 02:06:41 +00:00
|
|
|
else if (name == "Operations")
|
2001-01-20 03:55:42 +00:00
|
|
|
return OperationsOp;
|
2001-02-27 07:19:52 +00:00
|
|
|
else if (name == "Maximize (vertical only)")
|
|
|
|
return VMaximizeOp;
|
|
|
|
else if (name == "Maximize (horizontal only)")
|
|
|
|
return HMaximizeOp;
|
|
|
|
else if (name == "Lower")
|
|
|
|
return LowerOp;
|
1999-11-29 02:06:41 +00:00
|
|
|
return NoOp;
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
1999-11-29 02:06:41 +00:00
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
Options::MouseCommand Options::mouseCommand(const QString &name, bool restricted )
|
|
|
|
{
|
2002-07-13 02:34:13 +00:00
|
|
|
QString lowerName = name.lower();
|
2002-08-03 19:27:21 +00:00
|
|
|
if (lowerName == "raise") return MouseRaise;
|
2002-07-13 02:34:13 +00:00
|
|
|
if (lowerName == "lower") return MouseLower;
|
2002-08-03 19:27:21 +00:00
|
|
|
if (lowerName == "operations menu") return MouseOperationsMenu;
|
2002-07-13 02:34:13 +00:00
|
|
|
if (lowerName == "toggle raise and lower") return MouseToggleRaiseAndLower;
|
|
|
|
if (lowerName == "activate and raise") return MouseActivateAndRaise;
|
|
|
|
if (lowerName == "activate and lower") return MouseActivateAndLower;
|
|
|
|
if (lowerName == "activate") return MouseActivate;
|
|
|
|
if (lowerName == "activate, raise and pass click") return MouseActivateRaiseAndPassClick;
|
|
|
|
if (lowerName == "activate and pass click") return MouseActivateAndPassClick;
|
2003-09-16 19:28:03 +00:00
|
|
|
if (lowerName == "activate, raise and move")
|
|
|
|
return restricted ? MouseActivateRaiseAndMove : MouseActivateRaiseAndUnrestrictedMove;
|
|
|
|
if (lowerName == "move") return restricted ? MouseMove : MouseUnrestrictedMove;
|
|
|
|
if (lowerName == "resize") return restricted ? MouseResize : MouseUnrestrictedResize;
|
2002-07-13 02:34:13 +00:00
|
|
|
if (lowerName == "shade") return MouseShade;
|
2003-09-16 19:28:03 +00:00
|
|
|
if (lowerName == "minimize") return MouseMinimize;
|
2002-07-13 02:34:13 +00:00
|
|
|
if (lowerName == "nothing") return MouseNothing;
|
1999-11-29 02:06:41 +00:00
|
|
|
return MouseNothing;
|
2003-09-16 19:28:03 +00:00
|
|
|
}
|
2000-06-09 00:20:21 +00:00
|
|
|
|
2005-05-06 15:20:49 +00:00
|
|
|
Options::MouseWheelCommand Options::mouseWheelCommand(const QString &name)
|
|
|
|
{
|
|
|
|
QString lowerName = name.lower();
|
|
|
|
if (lowerName == "raise/lower") return MouseWheelRaiseLower;
|
|
|
|
if (lowerName == "shade/unshade") return MouseWheelShadeUnshade;
|
|
|
|
if (lowerName == "maximize/restore") return MouseWheelMaximizeRestore;
|
|
|
|
if (lowerName == "above/below") return MouseWheelAboveBelow;
|
|
|
|
if (lowerName == "previous/next desktop") return MouseWheelPreviousNextDesktop;
|
|
|
|
if (lowerName == "change opacity") return MouseWheelChangeOpacity;
|
|
|
|
return MouseWheelNothing;
|
|
|
|
}
|
|
|
|
|
2003-01-10 10:54:57 +00:00
|
|
|
bool Options::showGeometryTip()
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
|
|
|
return show_geometry_tip;
|
|
|
|
}
|
2001-07-01 10:10:17 +00:00
|
|
|
|
2001-11-03 00:05:33 +00:00
|
|
|
int Options::electricBorders()
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
|
|
|
return electric_borders;
|
|
|
|
}
|
2001-08-27 05:42:32 +00:00
|
|
|
|
2001-09-06 19:44:06 +00:00
|
|
|
int Options::electricBorderDelay()
|
2003-09-16 19:28:03 +00:00
|
|
|
{
|
|
|
|
return electric_border_delay;
|
|
|
|
}
|
2000-06-09 00:20:21 +00:00
|
|
|
|
2004-03-24 19:05:49 +00:00
|
|
|
bool Options::checkIgnoreFocusStealing( const Client* c )
|
|
|
|
{
|
|
|
|
return ignoreFocusStealingClasses.contains(QString::fromLatin1(c->resourceClass()));
|
|
|
|
}
|
2005-05-06 15:20:49 +00:00
|
|
|
|
|
|
|
Options::MouseCommand Options::wheelToMouseCommand( MouseWheelCommand com, int delta )
|
|
|
|
{
|
|
|
|
switch( com )
|
|
|
|
{
|
|
|
|
case MouseWheelRaiseLower:
|
|
|
|
return delta > 0 ? MouseRaise : MouseLower;
|
|
|
|
case MouseWheelShadeUnshade:
|
|
|
|
return delta > 0 ? MouseSetShade : MouseUnsetShade;
|
|
|
|
case MouseWheelMaximizeRestore:
|
|
|
|
return delta > 0 ? MouseMaximize : MouseRestore;
|
|
|
|
case MouseWheelAboveBelow:
|
|
|
|
return delta > 0 ? MouseAbove : MouseBelow;
|
|
|
|
case MouseWheelPreviousNextDesktop:
|
|
|
|
return delta > 0 ? MousePreviousDesktop : MouseNextDesktop;
|
|
|
|
case MouseWheelChangeOpacity:
|
|
|
|
return delta > 0 ? MouseOpacityMore : MouseOpacityLess;
|
|
|
|
default:
|
|
|
|
return MouseNothing;
|
|
|
|
}
|
|
|
|
}
|
2004-06-21 16:25:24 +00:00
|
|
|
#endif
|
2004-03-24 19:05:49 +00:00
|
|
|
|
2004-06-09 08:33:53 +00:00
|
|
|
Options::MoveResizeMode Options::stringToMoveResizeMode( const QString& s )
|
|
|
|
{
|
|
|
|
return s == "Opaque" ? Opaque : Transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* Options::moveResizeModeToString( MoveResizeMode mode )
|
|
|
|
{
|
|
|
|
return mode == Opaque ? "Opaque" : "Transparent";
|
|
|
|
}
|
|
|
|
|
2003-09-16 19:28:03 +00:00
|
|
|
} // namespace
|