redesign focus config GUI

REVIEW: 110001
This commit is contained in:
Thomas Lübking 2013-04-13 20:07:08 +02:00
parent cb77b468f8
commit e5028bb7fc
3 changed files with 554 additions and 268 deletions

View file

@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>574</width>
<height>313</height>
<width>656</width>
<height>527</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="2,1,5">
<item>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="1,1,1,100" columnstretch="1,2,3,2">
<item row="0" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -24,82 +24,272 @@
</property>
</spacer>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&amp;Policy:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>focusCombo</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="focusCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>The focus policy is used to determine the active window, i.e. the window you can work in. &lt;ul&gt;
&lt;li&gt;&lt;em&gt;Click to focus:&lt;/em&gt; A window becomes active when you click into it. This is the behavior you might know from other operating systems.&lt;/li&gt; &lt;li&gt;&lt;em&gt;Focus follows mouse:&lt;/em&gt; Moving the mouse pointer actively on to a normal window activates it. New windows will receive the focus, without you having to point the mouse at them explicitly. Very practical if you are using the mouse a lot.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Focus under mouse:&lt;/em&gt; The window that happens to be under the mouse pointer is active. If the mouse points nowhere, the last window that was under the mouse has focus. New windows will not automatically receive the focus.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Focus strictly under mouse:&lt;/em&gt; Only the window under the mouse pointer is active. If the mouse points nowhere, nothing has focus.&lt;/li&gt;
&lt;/ul&gt;
Note that 'Focus under mouse' and 'Focus strictly under mouse' prevent certain features such as the Alt+Tab walk through windows dialog in the KDE mode from working properly.</string>
</property>
<item>
<property name="text">
<string>Click to Focus</string>
<item row="0" column="1" colspan="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Activating windows</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</item>
<item>
<property name="text">
<string>Focus Follows Mouse</string>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</item>
<item>
<property name="text">
<string>Focus Under Mouse</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</item>
<item>
<property name="text">
<string>Focus Strictly Under Mouse</string>
</spacer>
</item>
<item row="1" column="1">
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>2</number>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Focus &amp;stealing prevention level:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>focusStealing</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="focusStealing">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;p&gt;This option specifies how much KWin will try to prevent unwanted focus stealing caused by unexpected activation of new windows. (Note: This feature does not work with the Focus Under Mouse or Focus Strictly Under Mouse focus policies.)
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>&lt;b&gt;Click To Focus&lt;/b&gt;&lt;br&gt;
A window becomes active when you click into it.&lt;br&gt;&lt;br&gt;
This behaviour is common on other operating systems and&lt;br&gt;
likely what you want.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;b&gt;Click To Focus - Mouse Precendence&lt;/b&gt;&lt;br&gt;
This is mostly the same as &lt;i&gt;Click To Focus&lt;/i&gt;&lt;br&gt;&lt;br&gt;
If an active window has to be chosen by the system&lt;br&gt;
(eg. because the currently active one was closed) &lt;br&gt;
the window under the mouse is the preferred candidate.&lt;br&gt;&lt;br&gt;
Unusual, but possible variant of &lt;i&gt;Click To Focus&lt;/i&gt;.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_4">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>&lt;b&gt;Focus Follows Mouse&lt;/b&gt;&lt;br&gt;
Moving the mouse onto a window will activate it.&lt;br&gt;&lt;br&gt;
Eg. windows randomly appearing under the mouse will not gain the focus.&lt;br&gt;
Focus stealing prevention takes place as usual.&lt;br&gt;&lt;br&gt;
Think as &lt;i&gt;Click To Focus&lt;/i&gt; just without having to actually click.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_5">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>&lt;b&gt;Focus Follows Mouse - Mouse Precendence&lt;/b&gt;&lt;br&gt;
This is mostly the same as &lt;i&gt;Focus Follows Mouse&lt;/i&gt;&lt;br&gt;&lt;br&gt;
If an active window has to be chosen by the system&lt;br&gt;
(eg. because the currently active one was closed) &lt;br&gt;
the window under the mouse is the preferred candidate.&lt;br&gt;&lt;br&gt;
Choose this, if you want a hover controlled focus.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>&lt;b&gt;Focus Under Mouse&lt;/b&gt;&lt;br&gt;
The focus always remains on the window under the mouse.&lt;br&gt;&lt;br&gt;
Notice:&lt;br&gt;
&lt;b&gt;Focus stealing prevention&lt;/b&gt; and the &lt;b&gt;tabbox (&quot;Alt+Tab&quot;)&lt;/b&gt;&lt;br&gt;
contradict the policy and &lt;b&gt;will not work&lt;/b&gt;.&lt;br&gt;&lt;br&gt;
You very likely want to use&lt;br&gt;
&lt;i&gt;Focus Follows Mouse - Mouse Precendence&lt;/i&gt; instead!</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_6">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>&lt;b&gt;Focus Strictly Under Mouse&lt;/b&gt;&lt;br&gt;
The focus is always on the window under the mouse - in doubt nowhere -&lt;br&gt;
very much like the focus behaviour in an unmanaged legacy X11 environment.&lt;br&gt;&lt;br&gt;
Notice:&lt;br&gt;
&lt;b&gt;Focus stealing prevention&lt;/b&gt; and the &lt;b&gt;tabbox (&quot;Alt+Tab&quot;)&lt;/b&gt;&lt;br&gt;
contradict the policy and &lt;b&gt;will not work&lt;/b&gt;.&lt;br&gt;&lt;br&gt;
You very likely want to use&lt;br&gt;
&lt;i&gt;Focus Follows Mouse - Mouse Precendence&lt;/i&gt; instead!</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="100,1,1">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="delayFocusOnLabel">
<property name="text">
<string>&amp;Delay focus by</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>delayFocus</cstring>
</property>
</widget>
</item>
<item>
<widget class="KIntNumInput" name="delayFocus">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>This is the delay after which the window the mouse pointer is over will automatically receive focus.</string>
</property>
<property name="value">
<number>100</number>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="suffix">
<string> ms</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_8" stretch="1,1,100">
<item>
<widget class="QLabel" name="focusStealingLabel">
<property name="text">
<string>Focus &amp;stealing prevention</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>focusStealing</cstring>
</property>
</widget>
</item>
<item>
<widget class="KComboBox" name="focusStealing">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>&lt;p&gt;This option specifies how much KWin will try to prevent unwanted focus stealing caused by unexpected activation of new windows. (Note: This feature does not work with the Focus Under Mouse or Focus Strictly Under Mouse focus policies.)
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;None:&lt;/em&gt; Prevention is turned off and new windows always become activated.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Low:&lt;/em&gt; Prevention is enabled; when some window does not have support for the underlying mechanism and KWin cannot reliably decide whether to activate the window or not, it will be activated. This setting may have both worse and better results than the medium level, depending on the applications.&lt;/li&gt;
@ -108,166 +298,124 @@ Note that 'Focus under mouse' and 'Focus strictly under mouse' prevent certain f
&lt;li&gt;&lt;em&gt;Extreme:&lt;/em&gt; All windows must be explicitly activated by the user.&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;Windows that are prevented from stealing focus are marked as demanding attention, which by default means their taskbar entry will be highlighted. This can be changed in the Notifications control module.&lt;/p&gt;</string>
</property>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">None</string>
</property>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">None</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">Low</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">Medium</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">High</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">Extreme</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_3">
<property name="verticalSpacing">
<number>0</number>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">Low</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">Medium</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">High</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="Focus Stealing Prevention Level">Extreme</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="autoRaiseOn">
<property name="whatsThis">
<string>When this option is enabled, a window in the background will automatically come to the front when the mouse pointer has been over it for some time.</string>
</property>
<property name="text">
<string>&amp;Raise, with the following delay:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KIntNumInput" name="autoRaise">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>This is the delay after which the window that the mouse pointer is over will automatically come to the front.</string>
</property>
<property name="value">
<number>100</number>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="suffix">
<string> ms</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="delayFocusOnLabel">
<property name="text">
<string>&amp;Delay focus by:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>delayFocus</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KIntNumInput" name="delayFocus">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>This is the delay after which the window the mouse pointer is over will automatically receive focus.</string>
</property>
<property name="value">
<number>100</number>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="suffix">
<string> ms</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="focusNextToMouse">
<property name="text">
<string>&amp;When the active window disappears, pass focus to window under mouse</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="clickRaiseOn">
<property name="whatsThis">
<string>When this option is enabled, the active window will be brought to the front when you click somewhere into the window contents. To change it for inactive windows, you need to change the settings in the Actions tab.</string>
</property>
<property name="text">
<string>C&amp;lick raises active window</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="separateScreenFocus">
<property name="whatsThis">
<string>When this option is enabled, focus operations are limited only to the active Xinerama screen</string>
</property>
<property name="text">
<string>S&amp;eparate screen focus</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="activeMouseScreen">
<property name="whatsThis">
<string>When this option is enabled, the active Xinerama screen (where new windows appear, for example) is the screen containing the mouse pointer. When disabled, the active Xinerama screen is the screen containing the focused window. By default this option is disabled for Click to focus and enabled for other focus policies.</string>
</property>
<property name="text">
<string>Active screen follows &amp;mouse</string>
</property>
</widget>
</item>
<item row="8" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
<item row="1" column="2">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Policy</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Click</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QSlider" name="windowFocusPolicy">
<property name="maximum">
<number>5</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
<property name="tickInterval">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Hover</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<item row="0" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -280,6 +428,124 @@ Note that 'Focus under mouse' and 'Focus strictly under mouse' prevent certain f
</property>
</spacer>
</item>
<item row="1" column="1" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Raising windows</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,1,100">
<item row="1" column="0">
<widget class="QCheckBox" name="autoRaiseOn">
<property name="whatsThis">
<string>When this option is enabled, a window in the background will automatically come to the front when the mouse pointer has been over it for some time.</string>
</property>
<property name="text">
<string>&amp;Raise on hover, delayed by</string>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="KIntNumInput" name="autoRaise">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string>This is the delay after which the window that the mouse pointer is over will automatically come to the front.</string>
</property>
<property name="value">
<number>100</number>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>3000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="suffix">
<string> ms</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="clickRaiseOn">
<property name="whatsThis">
<string>When this option is enabled, the active window will be brought to the front when you click somewhere into the window contents. To change it for inactive windows, you need to change the settings in the Actions tab.</string>
</property>
<property name="text">
<string>C&amp;lick raises active window</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>192</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" colspan="2">
<widget class="QGroupBox" name="multiscreenBox">
<property name="title">
<string>Multiscreen behaviour</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="separateScreenFocus">
<property name="whatsThis">
<string>When this option is enabled, focus operations are limited only to the active Xinerama screen</string>
</property>
<property name="text">
<string>S&amp;eparate screen focus</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="activeMouseScreen">
<property name="whatsThis">
<string>When this option is enabled, the active Xinerama screen (where new windows appear, for example) is the screen containing the mouse pointer. When disabled, the active Xinerama screen is the screen containing the focused window. By default this option is disabled for Click to focus and enabled for other focus policies.</string>
</property>
<property name="text">
<string>Active screen follows &amp;mouse</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
@ -295,16 +561,30 @@ Note that 'Focus under mouse' and 'Focus strictly under mouse' prevent certain f
</customwidget>
</customwidgets>
<tabstops>
<tabstop>focusCombo</tabstop>
<tabstop>focusStealing</tabstop>
<tabstop>autoRaiseOn</tabstop>
<tabstop>autoRaise</tabstop>
<tabstop>delayFocus</tabstop>
<tabstop>focusNextToMouse</tabstop>
<tabstop>clickRaiseOn</tabstop>
<tabstop>separateScreenFocus</tabstop>
<tabstop>activeMouseScreen</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>windowFocusPolicy</sender>
<signal>valueChanged(int)</signal>
<receiver>stackedWidget</receiver>
<slot>setCurrentIndex(int)</slot>
<hints>
<hint type="sourcelabel">
<x>244</x>
<y>38</y>
</hint>
<hint type="destinationlabel">
<x>444</x>
<y>84</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View file

@ -75,6 +75,11 @@
#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
#define FOCUS_STRICTLY_UNDER_MOUSE 5
KFocusConfig::~KFocusConfig()
{
@ -94,10 +99,10 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
, m_ui(new KWinFocusConfigForm(this))
{
connect(m_ui->focusStealing, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->focusCombo, SIGNAL(activated(int)), SLOT(changed()));
connect(m_ui->focusCombo, SIGNAL(activated(int)), this, SLOT(focusPolicyChanged()));
connect(m_ui->focusCombo, SIGNAL(activated(int)), this, SLOT(setDelayFocusEnabled()));
connect(m_ui->focusCombo, SIGNAL(activated(int)), this, SLOT(updateActiveMouseScreen()));
connect(m_ui->windowFocusPolicy, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(m_ui->windowFocusPolicy, SIGNAL(valueChanged(int)), this, SLOT(focusPolicyChanged()));
connect(m_ui->windowFocusPolicy, SIGNAL(valueChanged(int)), this, SLOT(setDelayFocusEnabled()));
connect(m_ui->windowFocusPolicy, SIGNAL(valueChanged(int)), this, SLOT(updateActiveMouseScreen()));
connect(m_ui->autoRaiseOn, SIGNAL(clicked()), SLOT(changed()));
connect(m_ui->autoRaiseOn, SIGNAL(toggled(bool)), SLOT(autoRaiseOnTog(bool)));
connect(m_ui->clickRaiseOn, SIGNAL(clicked()), SLOT(changed()));
@ -105,20 +110,30 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
connect(m_ui->delayFocus, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(m_ui->separateScreenFocus, SIGNAL(clicked()), SLOT(changed()));
connect(m_ui->activeMouseScreen, SIGNAL(clicked()), SLOT(changed()));
connect(m_ui->focusNextToMouse, SIGNAL(clicked()), SLOT(changed()));
connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), SLOT(updateMultiScreen()));
updateMultiScreen();
load();
}
void KFocusConfig::updateMultiScreen()
{
m_ui->multiscreenBox->setVisible(QApplication::desktop()->screenCount() > 1);
}
int KFocusConfig::getFocus()
{
return m_ui->focusCombo->currentIndex();
int policy = m_ui->windowFocusPolicy->value();
if (policy == 1 || policy == 3)
--policy; // fix the NextFocusPrefersMouse condition
return policy;
}
void KFocusConfig::setFocus(int foc)
{
m_ui->focusCombo->setCurrentIndex(foc);
m_ui->windowFocusPolicy->setValue(foc);
// this will disable/hide the auto raise delay widget if focus==click
focusPolicyChanged();
@ -156,21 +171,22 @@ void KFocusConfig::setClickRaise(bool on)
void KFocusConfig::focusPolicyChanged()
{
int policyIndex = m_ui->focusCombo->currentIndex();
int policyIndex = getFocus();
// the auto raise related widgets are: autoRaise
m_ui->autoRaiseOn->setEnabled(policyIndex != CLICK_TO_FOCUS);
autoRaiseOnTog(policyIndex != CLICK_TO_FOCUS && m_ui->autoRaiseOn->isChecked());
m_ui->focusStealing->setDisabled(policyIndex == FOCUS_UNDER_MOUSE || policyIndex == FOCUS_STRICTLY_UNDER_MOUSE);
m_ui->focusStealingLabel->setEnabled(m_ui->focusStealing->isEnabled());
m_ui->focusNextToMouse->setDisabled(policyIndex == FOCUS_UNDER_MOUSE || policyIndex == FOCUS_STRICTLY_UNDER_MOUSE);
setDelayFocusEnabled();
}
void KFocusConfig::setDelayFocusEnabled()
{
int policyIndex = m_ui->focusCombo->currentIndex();
int policyIndex = getFocus();
// the delayed focus related widgets are: delayFocus
m_ui->delayFocusOnLabel->setEnabled(policyIndex != CLICK_TO_FOCUS);
@ -209,7 +225,7 @@ void KFocusConfig::updateActiveMouseScreen()
// on by default for non click to focus policies
KConfigGroup cfg(config, "Windows");
if (!cfg.hasKey(KWIN_ACTIVE_MOUSE_SCREEN))
setActiveMouseScreen(m_ui->focusCombo->currentIndex() != 0);
setActiveMouseScreen(getFocus() != 0);
}
void KFocusConfig::showEvent(QShowEvent *ev)
@ -227,11 +243,13 @@ void KFocusConfig::load(void)
KConfigGroup cg(config, "Windows");
const bool focusNextToMouse = cg.readEntry("NextFocusPrefersMouse", false);
key = cg.readEntry(KWIN_FOCUS);
if (key == "ClickToFocus")
setFocus(CLICK_TO_FOCUS);
setFocus(CLICK_TO_FOCUS + focusNextToMouse);
else if (key == "FocusFollowsMouse")
setFocus(FOCUS_FOLLOWS_MOUSE);
setFocus(FOCUS_FOLLOWS_MOUSE + focusNextToMouse);
else if (key == "FocusUnderMouse")
setFocus(FOCUS_UNDER_MOUSE);
else if (key == "FocusStrictlyUnderMouse")
@ -246,17 +264,15 @@ void KFocusConfig::load(void)
setAutoRaise(cg.readEntry(KWIN_AUTORAISE, false));
setClickRaise(cg.readEntry(KWIN_CLICKRAISE, true));
focusPolicyChanged(); // this will disable/hide the auto raise delay widget if focus==click
setDelayFocusEnabled();
setSeparateScreenFocus(cg.readEntry(KWIN_SEPARATE_SCREEN_FOCUS, false));
// on by default for non click to focus policies
setActiveMouseScreen(cg.readEntry(KWIN_ACTIVE_MOUSE_SCREEN, m_ui->focusCombo->currentIndex() != 0));
setActiveMouseScreen(cg.readEntry(KWIN_ACTIVE_MOUSE_SCREEN, getFocus() != 0));
// setFocusStealing( cg.readEntry(KWIN_FOCUS_STEALING, 2 ));
// TODO default to low for now
setFocusStealing(cg.readEntry(KWIN_FOCUS_STEALING, 1));
m_ui->focusNextToMouse->setChecked(cg.readEntry("NextFocusPrefersMouse", false));
emit KCModule::changed(false);
}
@ -277,6 +293,8 @@ void KFocusConfig::save(void)
else
cg.writeEntry(KWIN_FOCUS, "FocusFollowsMouse");
cg.writeEntry("NextFocusPrefersMouse", v != m_ui->windowFocusPolicy->value());
v = getAutoRaiseInterval();
if (v < 0) v = 0;
cg.writeEntry(KWIN_AUTORAISE_INTERVAL, v);
@ -297,7 +315,6 @@ void KFocusConfig::save(void)
cg.writeEntry(KWIN_SEPARATE_SCREEN_FOCUS, m_ui->separateScreenFocus->isChecked());
cg.writeEntry(KWIN_ACTIVE_MOUSE_SCREEN, m_ui->activeMouseScreen->isChecked());
cg.writeEntry("NextFocusPrefersMouse", m_ui->focusNextToMouse->isChecked());
if (standAlone) {
config->sync();
@ -323,9 +340,8 @@ void KFocusConfig::defaults()
setFocusStealing(1);
// on by default for non click to focus policies
setActiveMouseScreen(m_ui->focusCombo->currentIndex() != 0);
setActiveMouseScreen(getFocus() != 0);
setDelayFocusEnabled();
m_ui->focusNextToMouse->setChecked(false);
emit KCModule::changed(true);
}

View file

@ -43,17 +43,6 @@ class KButtonGroup;
class KColorButton;
class KIntNumInput;
#define CLICK_TO_FOCUS 0
#define FOCUS_FOLLOW_MOUSE 1
#define TITLEBAR_PLAIN 0
#define TITLEBAR_SHADED 1
#define CLICK_TO_FOCUS 0
#define FOCUS_FOLLOWS_MOUSE 1
#define FOCUS_UNDER_MOUSE 2
#define FOCUS_STRICTLY_UNDER_MOUSE 3
class KWinFocusConfigForm : public QWidget, public Ui::KWinFocusConfigForm
{
@ -99,6 +88,7 @@ private slots:
void autoRaiseOnTog(bool);//CT 23Oct1998
void delayFocusOnTog(bool);
void updateActiveMouseScreen();
void updateMultiScreen();
void changed() {
emit KCModule::changed(true);
}