2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
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) any later version.
|
|
|
|
|
|
|
|
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/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_OPTIONS_H
|
|
|
|
#define KWIN_OPTIONS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QFont>
|
|
|
|
#include <QPalette>
|
2008-01-29 16:44:41 +00:00
|
|
|
#include <kdecoration.h>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#include "placement.h"
|
2007-07-04 09:51:10 +00:00
|
|
|
#include "utils.h"
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class Client;
|
2007-09-18 13:59:06 +00:00
|
|
|
class CompositingPrefs;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-11-25 01:45:09 +00:00
|
|
|
class Options : public KDecorationOptions
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Options();
|
|
|
|
~Options();
|
|
|
|
|
|
|
|
virtual unsigned long updateSettings();
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Different focus policies:
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li>ClickToFocus - Clicking into a window activates it. This is
|
|
|
|
also the default.
|
|
|
|
|
|
|
|
<li>FocusFollowsMouse - Moving the mouse pointer actively onto a
|
|
|
|
normal window activates it. For convenience, the desktop and
|
|
|
|
windows on the dock are excluded. They require clicking.
|
|
|
|
|
|
|
|
<li>FocusUnderMouse - The window that happens to be under the
|
|
|
|
mouse pointer becomes active. The invariant is: no window can
|
|
|
|
have focus that is not under the mouse. This also means that
|
|
|
|
Alt-Tab won't work properly and popup dialogs are usually
|
|
|
|
unsable with the keyboard. Note that the desktop and windows on
|
|
|
|
the dock are excluded for convenience. They get focus only when
|
|
|
|
clicking on it.
|
|
|
|
|
|
|
|
<li>FocusStrictlyUnderMouse - this is even worse than
|
|
|
|
FocusUnderMouse. Only the window under the mouse pointer is
|
|
|
|
active. If the mouse points nowhere, nothing has the focus. If
|
|
|
|
the mouse points onto the desktop, the desktop has focus. The
|
|
|
|
same holds for windows on the dock.
|
|
|
|
|
|
|
|
Note that FocusUnderMouse and FocusStrictlyUnderMouse are not
|
|
|
|
particulary useful. They are only provided for old-fashined
|
|
|
|
die-hard UNIX people ;-)
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
*/
|
|
|
|
enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse };
|
|
|
|
FocusPolicy focusPolicy;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Whether clicking on a window raises it in FocusFollowsMouse
|
|
|
|
mode or not.
|
|
|
|
*/
|
|
|
|
bool clickRaise;
|
|
|
|
|
|
|
|
/**
|
|
|
|
whether autoraise is enabled FocusFollowsMouse mode or not.
|
|
|
|
*/
|
|
|
|
bool autoRaise;
|
|
|
|
|
|
|
|
/**
|
|
|
|
autoraise interval
|
|
|
|
*/
|
|
|
|
int autoRaiseInterval;
|
|
|
|
|
|
|
|
/**
|
|
|
|
whether delay focus is enabled or not.
|
|
|
|
*/
|
|
|
|
bool delayFocus;
|
|
|
|
|
|
|
|
/**
|
|
|
|
delayed focus interval
|
|
|
|
*/
|
|
|
|
int delayFocusInterval;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Whether shade hover is enabled or not
|
|
|
|
*/
|
|
|
|
bool shadeHover;
|
|
|
|
|
|
|
|
/**
|
|
|
|
shade hover interval
|
|
|
|
*/
|
|
|
|
int shadeHoverInterval;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Different Alt-Tab-Styles:
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li> KDE - the recommended KDE style. Alt-Tab opens a nice icon
|
|
|
|
box that makes it easy to select the window you want to tab
|
|
|
|
to. The order automatically adjusts to the most recently used
|
|
|
|
windows. Note that KDE style does not work with the
|
|
|
|
FocusUnderMouse and FocusStrictlyUnderMouse focus
|
|
|
|
policies. Choose ClickToFocus or FocusFollowsMouse instead.
|
|
|
|
|
|
|
|
<li> CDE - the old-fashion CDE style. Alt-Tab cycles between
|
|
|
|
the windows in static order. The current window gets raised,
|
|
|
|
the previous window gets lowered.
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
*/
|
|
|
|
enum AltTabStyle { KDE, CDE };
|
|
|
|
AltTabStyle altTabStyle;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-05-07 12:18:19 +00:00
|
|
|
// whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
|
|
|
|
bool separateScreenFocus;
|
|
|
|
// whether active Xinerama screen is the one with mouse (or with the active window)
|
|
|
|
bool activeMouseScreen;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Xinerama options
|
|
|
|
*/
|
|
|
|
bool xineramaEnabled;
|
|
|
|
bool xineramaPlacementEnabled;
|
|
|
|
bool xineramaMovementEnabled;
|
|
|
|
bool xineramaMaximizeEnabled;
|
|
|
|
bool xineramaFullscreenEnabled;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-05-07 12:27:19 +00:00
|
|
|
// number, or -1 = active screen (Workspace::activeScreen())
|
|
|
|
int xineramaPlacementScreen;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
MoveResizeMode, either Tranparent or Opaque.
|
|
|
|
*/
|
|
|
|
enum MoveResizeMode { Transparent, Opaque };
|
|
|
|
|
|
|
|
MoveResizeMode resizeMode;
|
|
|
|
MoveResizeMode moveMode;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
static MoveResizeMode stringToMoveResizeMode( const QString& s );
|
|
|
|
static const char* moveResizeModeToString( MoveResizeMode mode );
|
|
|
|
|
|
|
|
Placement::Policy placement;
|
|
|
|
|
2008-11-25 01:45:09 +00:00
|
|
|
bool focusPolicyIsReasonable()
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping on desktop borders
|
|
|
|
*/
|
|
|
|
int borderSnapZone;
|
|
|
|
|
|
|
|
/**
|
2008-07-09 15:18:47 +00:00
|
|
|
* the size of the zone that triggers snapping with other windows
|
2007-04-29 17:35:43 +00:00
|
|
|
*/
|
|
|
|
int windowSnapZone;
|
|
|
|
|
2008-07-09 15:18:47 +00:00
|
|
|
/**
|
|
|
|
* the size of the zone that triggers snapping on the screen center
|
|
|
|
*/
|
|
|
|
int centerSnapZone;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* snap only when windows will overlap
|
|
|
|
*/
|
|
|
|
bool snapOnlyWhenOverlapping;
|
|
|
|
|
|
|
|
bool showDesktopIsMinimizeAll;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* whether or not we roll over to the other edge when switching desktops past the edge
|
|
|
|
*/
|
|
|
|
bool rollOverDesktops;
|
|
|
|
|
|
|
|
// 0 - 4 , see Workspace::allowClientActivation()
|
|
|
|
int focusStealingPreventionLevel;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* List of window classes to ignore PPosition size hint
|
|
|
|
*/
|
|
|
|
QStringList ignorePositionClasses;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2009-09-08 20:19:20 +00:00
|
|
|
/**
|
|
|
|
* support legacy fullscreen windows hack: borderless non-netwm windows with screen geometry
|
|
|
|
*/
|
|
|
|
bool legacyFullscreenSupport;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
bool checkIgnoreFocusStealing( const Client* c );
|
|
|
|
|
|
|
|
WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; }
|
|
|
|
|
2008-11-25 01:45:09 +00:00
|
|
|
enum MouseCommand
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
|
|
|
MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
|
|
|
|
MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
|
|
|
|
MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
|
|
|
|
MouseMove, MouseUnrestrictedMove,
|
|
|
|
MouseActivateRaiseAndMove, MouseActivateRaiseAndUnrestrictedMove,
|
|
|
|
MouseResize, MouseUnrestrictedResize,
|
|
|
|
MouseShade, MouseSetShade, MouseUnsetShade,
|
|
|
|
MouseMaximize, MouseRestore, MouseMinimize,
|
|
|
|
MouseNextDesktop, MousePreviousDesktop,
|
|
|
|
MouseAbove, MouseBelow,
|
|
|
|
MouseOpacityMore, MouseOpacityLess,
|
2009-08-25 04:10:11 +00:00
|
|
|
MouseClose,
|
2007-04-29 17:35:43 +00:00
|
|
|
MouseNothing
|
|
|
|
};
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
enum MouseWheelCommand
|
|
|
|
{
|
|
|
|
MouseWheelRaiseLower, MouseWheelShadeUnshade, MouseWheelMaximizeRestore,
|
|
|
|
MouseWheelAboveBelow, MouseWheelPreviousNextDesktop,
|
|
|
|
MouseWheelChangeOpacity,
|
|
|
|
MouseWheelNothing
|
|
|
|
};
|
|
|
|
|
|
|
|
MouseCommand operationTitlebarMouseWheel( int delta )
|
|
|
|
{
|
|
|
|
return wheelToMouseCommand( CmdTitlebarWheel, delta );
|
|
|
|
}
|
|
|
|
MouseCommand operationWindowMouseWheel( int delta )
|
|
|
|
{
|
|
|
|
return wheelToMouseCommand( CmdAllWheel, delta );
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; }
|
|
|
|
MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; }
|
|
|
|
MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; }
|
|
|
|
MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; }
|
|
|
|
MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; }
|
|
|
|
MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; }
|
|
|
|
MouseCommand commandWindow1() { return CmdWindow1; }
|
|
|
|
MouseCommand commandWindow2() { return CmdWindow2; }
|
|
|
|
MouseCommand commandWindow3() { return CmdWindow3; }
|
2009-05-06 06:38:54 +00:00
|
|
|
MouseCommand commandWindowWheel() { return CmdWindowWheel; }
|
2007-04-29 17:35:43 +00:00
|
|
|
MouseCommand commandAll1() { return CmdAll1; }
|
|
|
|
MouseCommand commandAll2() { return CmdAll2; }
|
|
|
|
MouseCommand commandAll3() { return CmdAll3; }
|
|
|
|
uint keyCmdAllModKey() { return CmdAllModKey; }
|
|
|
|
|
2009-02-28 08:33:16 +00:00
|
|
|
static ElectricBorderAction electricBorderAction( const QString& name );
|
2007-04-29 17:35:43 +00:00
|
|
|
static WindowOperation windowOperation(const QString &name, bool restricted );
|
|
|
|
static MouseCommand mouseCommand(const QString &name, bool restricted );
|
|
|
|
static MouseWheelCommand mouseWheelCommand(const QString &name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns true if the Geometry Tip should be shown during a window move/resize.
|
|
|
|
*/
|
|
|
|
bool showGeometryTip();
|
|
|
|
|
|
|
|
enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 };
|
|
|
|
/**
|
2009-02-28 08:33:16 +00:00
|
|
|
* @returns The action assigned to the specified electric border
|
|
|
|
*/
|
|
|
|
ElectricBorderAction electricBorderAction( ElectricBorder edge );
|
|
|
|
/**
|
2007-04-29 17:35:43 +00:00
|
|
|
* @returns true if electric borders are enabled. With electric borders
|
|
|
|
* you can change desktop by moving the mouse pointer towards the edge
|
|
|
|
* of the screen
|
|
|
|
*/
|
|
|
|
int electricBorders();
|
|
|
|
/**
|
|
|
|
* @returns the activation delay for electric borders in milliseconds.
|
|
|
|
*/
|
|
|
|
int electricBorderDelay();
|
2009-02-28 08:33:16 +00:00
|
|
|
/**
|
|
|
|
* @returns the trigger cooldown for electric borders in milliseconds.
|
|
|
|
*/
|
|
|
|
int electricBorderCooldown();
|
2009-09-08 20:01:08 +00:00
|
|
|
/**
|
2009-09-08 20:01:16 +00:00
|
|
|
* @returns the number of pixels the mouse cursor is pushed back when it
|
|
|
|
* reaches the screen edge.
|
|
|
|
*/
|
|
|
|
int electricBorderPushbackPixels() const { return electric_border_pushback_pixels; }
|
|
|
|
/**
|
2009-09-08 20:01:08 +00:00
|
|
|
* @returns true if a window gets maximized when it reaches top screen edge
|
|
|
|
* while being moved.
|
|
|
|
*/
|
|
|
|
bool electricBorderMaximize() const { return electric_border_maximize; }
|
|
|
|
/**
|
|
|
|
* @returns true if window is tiled to half screen when reaching left or
|
|
|
|
* right screen edge while been moved
|
|
|
|
*/
|
|
|
|
bool electricBorderTiling() const { return electric_border_tiling; }
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
bool topMenuEnabled() const { return topmenus; }
|
|
|
|
bool desktopTopMenu() const { return desktop_topmenu; }
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
// timeout before non-responding application will be killed after attempt to close
|
|
|
|
int killPingTimeout;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
// Whether to hide utility windows for inactive applications.
|
|
|
|
bool hideUtilityWindowsForInactive;
|
|
|
|
|
2007-07-19 16:20:05 +00:00
|
|
|
// Compositing settings
|
|
|
|
bool useCompositing;
|
|
|
|
CompositingType compositingMode;
|
2007-07-04 09:51:10 +00:00
|
|
|
HiddenPreviews hiddenPreviews;
|
2008-08-24 13:32:57 +00:00
|
|
|
bool unredirectFullscreen;
|
2008-09-12 10:26:19 +00:00
|
|
|
bool disableCompositingChecks;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
uint refreshRate;
|
2007-09-21 13:27:56 +00:00
|
|
|
// This is for OpenGL mode
|
2007-04-29 17:35:43 +00:00
|
|
|
int smoothScale; // 0 = no, 1 = yes when transformed,
|
|
|
|
// 2 = try trilinear when transformed; else 1,
|
|
|
|
// -1 = auto
|
2007-09-21 13:27:56 +00:00
|
|
|
// This is for XRender mode
|
|
|
|
bool xrenderSmoothScale;
|
2008-11-25 01:45:09 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
enum GLMode { GLTFP, GLSHM, GLFallback };
|
|
|
|
GLMode glMode;
|
|
|
|
bool glDirect;
|
|
|
|
bool glVSync;
|
2007-06-17 12:17:03 +00:00
|
|
|
bool glStrictBinding;
|
2008-08-30 07:25:54 +00:00
|
|
|
double animationTimeFactor() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
WindowOperation OpTitlebarDblClick;
|
|
|
|
|
2008-11-25 01:45:09 +00:00
|
|
|
// mouse bindings
|
2007-04-29 17:35:43 +00:00
|
|
|
MouseCommand CmdActiveTitlebar1;
|
|
|
|
MouseCommand CmdActiveTitlebar2;
|
|
|
|
MouseCommand CmdActiveTitlebar3;
|
|
|
|
MouseCommand CmdInactiveTitlebar1;
|
|
|
|
MouseCommand CmdInactiveTitlebar2;
|
|
|
|
MouseCommand CmdInactiveTitlebar3;
|
|
|
|
MouseWheelCommand CmdTitlebarWheel;
|
|
|
|
MouseCommand CmdWindow1;
|
|
|
|
MouseCommand CmdWindow2;
|
|
|
|
MouseCommand CmdWindow3;
|
2009-05-06 06:38:54 +00:00
|
|
|
MouseCommand CmdWindowWheel;
|
2007-04-29 17:35:43 +00:00
|
|
|
MouseCommand CmdAll1;
|
|
|
|
MouseCommand CmdAll2;
|
|
|
|
MouseCommand CmdAll3;
|
|
|
|
MouseWheelCommand CmdAllWheel;
|
|
|
|
uint CmdAllModKey;
|
|
|
|
|
2009-02-28 08:33:16 +00:00
|
|
|
ElectricBorderAction electric_border_top;
|
|
|
|
ElectricBorderAction electric_border_top_right;
|
|
|
|
ElectricBorderAction electric_border_right;
|
|
|
|
ElectricBorderAction electric_border_bottom_right;
|
|
|
|
ElectricBorderAction electric_border_bottom;
|
|
|
|
ElectricBorderAction electric_border_bottom_left;
|
|
|
|
ElectricBorderAction electric_border_left;
|
|
|
|
ElectricBorderAction electric_border_top_left;
|
2007-04-29 17:35:43 +00:00
|
|
|
int electric_borders;
|
|
|
|
int electric_border_delay;
|
2009-02-28 08:33:16 +00:00
|
|
|
int electric_border_cooldown;
|
2009-09-08 20:01:16 +00:00
|
|
|
int electric_border_pushback_pixels;
|
2009-09-08 20:01:08 +00:00
|
|
|
bool electric_border_maximize;
|
|
|
|
bool electric_border_tiling;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool show_geometry_tip;
|
|
|
|
bool topmenus;
|
|
|
|
bool desktop_topmenu;
|
|
|
|
// List of window classes for which not to use focus stealing prevention
|
|
|
|
QStringList ignoreFocusStealingClasses;
|
2008-08-30 07:25:54 +00:00
|
|
|
int animationSpeed; // 0 - instant, 5 - very slow
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
MouseCommand wheelToMouseCommand( MouseWheelCommand com, int delta );
|
2008-12-08 05:08:31 +00:00
|
|
|
void reloadCompositingSettings(const CompositingPrefs& prefs);
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Options* options;
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|