Make it possible add new default window rules that will

be added to user's rules.
Add default rules that turn off focus stealing prevention
for Mozilla family apps and OOo (since they can't handle opening
a window from second instance with FSP active).
When writing groups to kwinrulesrc delete old unused groups first.


svn path=/trunk/KDE/kdebase/workspace/; revision=506472
This commit is contained in:
Luboš Luňák 2006-02-06 20:44:10 +00:00
parent 0fa10f318d
commit 3bee4bff66
4 changed files with 24 additions and 4 deletions

View file

@ -1,11 +1,14 @@
kconf_PROGRAMS = kwin_update_window_settings
kconf_PROGRAMS = kwin_update_window_settings kwin_update_default_rules
kconfdir = $(libdir)/kconf_update_bin
kwin_update_window_settings_SOURCES = update_window_settings.cpp
kwin_update_window_settings_LDADD = $(LIB_KDECORE) $(KDE_RPATH)
kwin_update_window_settings_LDFLAGS = $(all_libraries)
kwin_update_default_rules_SOURCES = update_default_rules.cpp
kwin_update_default_rules_LDADD = $(LIB_KDECORE) $(KDE_RPATH)
kwin_update_default_rules_LDFLAGS = $(all_libraries)
INCLUDES = $(all_includes)
METASOURCES = AUTO
@ -14,7 +17,9 @@ sounddir= $(kde_sounddir)
sound_DATA = pop.wav
update_DATA = kwin.upd kwinsticky.upd kwiniconify.upd kwin3_plugin.upd kwin_focus1.upd \
kwinupdatewindowsettings.upd kwin_focus2.upd
kwinupdatewindowsettings.upd kwin_focus2.upd kwin_fsp_workarounds_1.upd
update_SCRIPTS = pluginlibFix.pl kwin3_plugin.pl kwin_focus1.sh kwin_focus2.sh
updatedir = $(kde_datadir)/kconf_update
kwin_default_rules_DATA = fsp_workarounds_1
kwin_default_rulesdir = $(kde_datadir)/kwin/default_rules

View file

@ -51,6 +51,11 @@ static void loadRules( QList< Rules* >& rules )
static void saveRules( const QList< Rules* >& rules )
{
KConfig cfg( "kwinrulesrc" );
QStringList groups = cfg.groupList();
for( QStringList::ConstIterator it = groups.begin();
it != groups.end();
++it )
cfg.deleteGroup( *it );
cfg.setGroup( "General" );
cfg.writeEntry( "count", rules.count());
int i = 1;

View file

@ -172,6 +172,11 @@ void KCMRulesList::load()
void KCMRulesList::save()
{
KConfig cfg( "kwinrulesrc" );
QStringList groups = cfg.groupList();
for( QStringList::ConstIterator it = groups.begin();
it != groups.end();
++it )
cfg.deleteGroup( *it );
cfg.setGroup( "General" );
cfg.writeEntry( "count", rules.count());
int i = 1;

View file

@ -971,6 +971,11 @@ void Workspace::writeWindowRules()
{
rulesUpdatedTimer.stop();
KConfig cfg( "kwinrulesrc" );
QStringList groups = cfg.groupList();
for( QStringList::ConstIterator it = groups.begin();
it != groups.end();
++it )
cfg.deleteGroup( *it );
cfg.setGroup( "General" );
cfg.writeEntry( "count", rules.count());
int i = 1;