don't request focus by mouse events in the current event cycle

BUG: 279356
BUG: 286116
REVIEW: 103284
This commit is contained in:
Thomas Lübking 2011-11-28 20:12:58 +01:00
parent 82bf9d2d44
commit 6c934998a5
8 changed files with 9 additions and 32 deletions

View file

@ -45,6 +45,6 @@ install( TARGETS kwin_update_tabbox_qml_settings DESTINATION ${LIB_INSTALL_DIR}/
install( FILES fsp_workarounds_1.kwinrules DESTINATION ${DATA_INSTALL_DIR}/kwin/default_rules ) install( FILES fsp_workarounds_1.kwinrules DESTINATION ${DATA_INSTALL_DIR}/kwin/default_rules )
install( FILES pop.wav DESTINATION ${SOUND_INSTALL_DIR} ) install( FILES pop.wav DESTINATION ${SOUND_INSTALL_DIR} )
install( FILES kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd kwin_on_off.upd kwin_window_shortcuts.upd kwin_update_tabbox_settings.upd kwin_remove_effects.upd kwin_update_tabbox_qml_settings.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( FILES kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd kwin_on_off.upd kwin_window_shortcuts.upd kwin_update_tabbox_settings.upd kwin_remove_effects.upd kwin_update_tabbox_qml_settings.upd kwin_remove_delay_focus.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
install( PROGRAMS pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh on-off_to_true-false.sh kwin_window_shortcuts.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( PROGRAMS pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh on-off_to_true-false.sh kwin_window_shortcuts.sh kwin_remove_delay_focus.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )

View file

@ -0,0 +1,4 @@
#!/bin/sh
if ! `kreadconfig --file kwinrc --group Windows --key DelayFocus --default false` && [ `kreadconfig --file kwinrc --group Windows --key DelayFocusInterval --default 0` != 0 ]; then
kwriteconfig --file kwinrc --group Windows --key DelayFocusInterval 0
fi

View file

@ -0,0 +1,2 @@
Id=Kwin-4.8
Script=kwin_remove_delay_focus.sh

View file

@ -901,10 +901,7 @@ void Client::enterNotifyEvent(XCrossingEvent* e)
// change came because of window changes (e.g. closing a window) - #92290 // change came because of window changes (e.g. closing a window) - #92290
if (options->focusPolicy != Options::FocusFollowsMouse if (options->focusPolicy != Options::FocusFollowsMouse
|| currentPos != workspace()->focusMousePosition()) { || currentPos != workspace()->focusMousePosition()) {
if (options->delayFocus)
workspace()->requestDelayFocus(this); workspace()->requestDelayFocus(this);
else
workspace()->requestFocus(this);
} }
return; return;
} }

View file

@ -52,7 +52,6 @@
#define KWIN_AUTORAISE_INTERVAL "AutoRaiseInterval" #define KWIN_AUTORAISE_INTERVAL "AutoRaiseInterval"
#define KWIN_AUTORAISE "AutoRaise" #define KWIN_AUTORAISE "AutoRaise"
#define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval" #define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval"
#define KWIN_DELAYFOCUS "DelayFocus"
#define KWIN_CLICKRAISE "ClickRaise" #define KWIN_CLICKRAISE "ClickRaise"
#define KWIN_MOVE_RESIZE_MAXIMIZED "MoveResizeMaximizedWindows" #define KWIN_MOVE_RESIZE_MAXIMIZED "MoveResizeMaximizedWindows"
#define KWIN_SHADEHOVER "ShadeHover" #define KWIN_SHADEHOVER "ShadeHover"
@ -206,8 +205,6 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
connect(focusCombo, SIGNAL(activated(int)), this, SLOT(setDelayFocusEnabled())); connect(focusCombo, SIGNAL(activated(int)), this, SLOT(setDelayFocusEnabled()));
delayFocusOn = new QCheckBox(fcsBox);
connect(delayFocusOn, SIGNAL(toggled(bool)), this, SLOT(delayFocusOnTog(bool)));
delayFocus = new KIntNumInput(500, fcsBox); delayFocus = new KIntNumInput(500, fcsBox);
delayFocus->setRange(0, 3000, 100); delayFocus->setRange(0, 3000, 100);
delayFocus->setSteps(100, 100); delayFocus->setSteps(100, 100);
@ -216,7 +213,6 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
delayFocusOnLabel = new QLabel(i18n("Delay focus by:"), this); delayFocusOnLabel = new QLabel(i18n("Delay focus by:"), this);
delayFocusOnLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); delayFocusOnLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
delayFocusOnLabel->setBuddy(delayFocus); delayFocusOnLabel->setBuddy(delayFocus);
gLay->addWidget(delayFocusOn, 3, 0);
gLay->addWidget(delayFocusOnLabel, 3, 1); gLay->addWidget(delayFocusOnLabel, 3, 1);
gLay->addWidget(delayFocus, 3, 2); gLay->addWidget(delayFocus, 3, 2);
@ -235,8 +231,6 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
" it for inactive windows, you need to change the settings" " it for inactive windows, you need to change the settings"
" in the Actions tab.")); " in the Actions tab."));
delayFocusOn->setWhatsThis(i18n("When this option is enabled, there will be a delay after which the"
" window the mouse pointer is over will become active (receive focus)."));
delayFocus->setWhatsThis(i18n("This is the delay after which the window the mouse pointer is over" delayFocus->setWhatsThis(i18n("This is the delay after which the window the mouse pointer is over"
" will automatically receive focus.")); " will automatically receive focus."));
@ -266,7 +260,6 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
// Any changes goes to slotChanged() // Any changes goes to slotChanged()
connect(focusCombo, SIGNAL(activated(int)), SLOT(changed())); connect(focusCombo, SIGNAL(activated(int)), SLOT(changed()));
connect(autoRaiseOn, SIGNAL(clicked()), SLOT(changed())); connect(autoRaiseOn, SIGNAL(clicked()), SLOT(changed()));
connect(delayFocusOn, SIGNAL(clicked()), SLOT(changed()));
connect(clickRaiseOn, SIGNAL(clicked()), SLOT(changed())); connect(clickRaiseOn, SIGNAL(clicked()), SLOT(changed()));
connect(autoRaise, SIGNAL(valueChanged(int)), SLOT(changed())); connect(autoRaise, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(delayFocus, SIGNAL(valueChanged(int)), SLOT(changed())); connect(delayFocus, SIGNAL(valueChanged(int)), SLOT(changed()));
@ -315,11 +308,6 @@ void KFocusConfig::setAutoRaise(bool on)
autoRaiseOn->setChecked(on); autoRaiseOn->setChecked(on);
} }
void KFocusConfig::setDelayFocus(bool on)
{
delayFocusOn->setChecked(on);
}
void KFocusConfig::setClickRaise(bool on) void KFocusConfig::setClickRaise(bool on)
{ {
clickRaiseOn->setChecked(on); clickRaiseOn->setChecked(on);
@ -343,9 +331,8 @@ void KFocusConfig::setDelayFocusEnabled()
int policyIndex = focusCombo->currentIndex(); int policyIndex = focusCombo->currentIndex();
// the delayed focus related widgets are: delayFocus // the delayed focus related widgets are: delayFocus
delayFocusOn->setEnabled(policyIndex != CLICK_TO_FOCUS);
delayFocusOnLabel->setEnabled(policyIndex != CLICK_TO_FOCUS); delayFocusOnLabel->setEnabled(policyIndex != CLICK_TO_FOCUS);
delayFocusOnTog(policyIndex != CLICK_TO_FOCUS && delayFocusOn->isChecked()); delayFocusOnTog(policyIndex != CLICK_TO_FOCUS);
} }
void KFocusConfig::autoRaiseOnTog(bool a) void KFocusConfig::autoRaiseOnTog(bool a)
@ -419,7 +406,6 @@ void KFocusConfig::load(void)
setDelayFocusInterval(k); setDelayFocusInterval(k);
setAutoRaise(cg.readEntry(KWIN_AUTORAISE, false)); setAutoRaise(cg.readEntry(KWIN_AUTORAISE, false));
setDelayFocus(cg.readEntry(KWIN_DELAYFOCUS, false));
setClickRaise(cg.readEntry(KWIN_CLICKRAISE, true)); setClickRaise(cg.readEntry(KWIN_CLICKRAISE, true));
focusPolicyChanged(); // this will disable/hide the auto raise delay widget if focus==click focusPolicyChanged(); // this will disable/hide the auto raise delay widget if focus==click
setDelayFocusEnabled(); setDelayFocusEnabled();
@ -461,8 +447,6 @@ void KFocusConfig::save(void)
cg.writeEntry(KWIN_AUTORAISE, autoRaiseOn->isChecked()); cg.writeEntry(KWIN_AUTORAISE, autoRaiseOn->isChecked());
cg.writeEntry(KWIN_DELAYFOCUS, delayFocusOn->isChecked());
cg.writeEntry(KWIN_CLICKRAISE, clickRaiseOn->isChecked()); cg.writeEntry(KWIN_CLICKRAISE, clickRaiseOn->isChecked());
cg.writeEntry(KWIN_SEPARATE_SCREEN_FOCUS, separateScreenFocus->isChecked()); cg.writeEntry(KWIN_SEPARATE_SCREEN_FOCUS, separateScreenFocus->isChecked());
@ -487,7 +471,6 @@ void KFocusConfig::defaults()
setDelayFocusInterval(0); setDelayFocusInterval(0);
setFocus(CLICK_TO_FOCUS); setFocus(CLICK_TO_FOCUS);
setAutoRaise(false); setAutoRaise(false);
setDelayFocus(false);
setClickRaise(true); setClickRaise(true);
setSeparateScreenFocus(false); setSeparateScreenFocus(false);

View file

@ -95,7 +95,6 @@ private:
void setAutoRaiseInterval(int); void setAutoRaiseInterval(int);
void setAutoRaise(bool); void setAutoRaise(bool);
void setDelayFocusInterval(int); void setDelayFocusInterval(int);
void setDelayFocus(bool);
void setClickRaise(bool); void setClickRaise(bool);
void setSeparateScreenFocus(bool); void setSeparateScreenFocus(bool);
void setActiveMouseScreen(bool); void setActiveMouseScreen(bool);
@ -109,7 +108,6 @@ private:
QLabel *autoRaiseOnLabel; QLabel *autoRaiseOnLabel;
QCheckBox *autoRaiseOn; QCheckBox *autoRaiseOn;
QLabel *delayFocusOnLabel; QLabel *delayFocusOnLabel;
QCheckBox *delayFocusOn;
QCheckBox *clickRaiseOn; QCheckBox *clickRaiseOn;
KIntNumInput *autoRaise; KIntNumInput *autoRaise;
KIntNumInput *delayFocus; KIntNumInput *delayFocus;

View file

@ -151,12 +151,10 @@ unsigned long Options::updateSettings()
if (focusPolicy == ClickToFocus) { if (focusPolicy == ClickToFocus) {
autoRaise = false; autoRaise = false;
autoRaiseInterval = 0; autoRaiseInterval = 0;
delayFocus = false;
delayFocusInterval = 0; delayFocusInterval = 0;
} else { } else {
autoRaise = config.readEntry("AutoRaise", false); autoRaise = config.readEntry("AutoRaise", false);
autoRaiseInterval = config.readEntry("AutoRaiseInterval", 0); autoRaiseInterval = config.readEntry("AutoRaiseInterval", 0);
delayFocus = config.readEntry("DelayFocus", false);
delayFocusInterval = config.readEntry("DelayFocusInterval", 0); delayFocusInterval = config.readEntry("DelayFocusInterval", 0);
} }

View file

@ -97,11 +97,6 @@ public:
*/ */
int autoRaiseInterval; int autoRaiseInterval;
/**
whether delay focus is enabled or not.
*/
bool delayFocus;
/** /**
delayed focus interval delayed focus interval
*/ */