summaryrefslogtreecommitdiffstats
path: root/kwin/data
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kwin/data
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin/data')
-rw-r--r--kwin/data/Makefile.am25
-rw-r--r--kwin/data/fsp_workarounds_1.kwinrules41
-rw-r--r--kwin/data/kwin.upd14
-rw-r--r--kwin/data/kwin3_plugin.pl8
-rw-r--r--kwin/data/kwin3_plugin.upd4
-rw-r--r--kwin/data/kwin_focus1.sh13
-rw-r--r--kwin/data/kwin_focus1.upd5
-rw-r--r--kwin/data/kwin_focus2.sh8
-rw-r--r--kwin/data/kwin_focus2.upd5
-rw-r--r--kwin/data/kwin_fsp_workarounds_1.upd8
-rw-r--r--kwin/data/kwiniconify.upd8
-rw-r--r--kwin/data/kwinsticky.upd8
-rw-r--r--kwin/data/kwinupdatewindowsettings.upd7
-rwxr-xr-xkwin/data/pluginlibFix.pl8
-rw-r--r--kwin/data/pop.wavbin0 -> 4068 bytes
-rw-r--r--kwin/data/update_default_rules.cpp56
-rw-r--r--kwin/data/update_window_settings.cpp168
17 files changed, 386 insertions, 0 deletions
diff --git a/kwin/data/Makefile.am b/kwin/data/Makefile.am
new file mode 100644
index 000000000..abdc244f2
--- /dev/null
+++ b/kwin/data/Makefile.am
@@ -0,0 +1,25 @@
+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
+
+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 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.kwinrules
+kwin_default_rulesdir = $(kde_datadir)/kwin/default_rules
diff --git a/kwin/data/fsp_workarounds_1.kwinrules b/kwin/data/fsp_workarounds_1.kwinrules
new file mode 100644
index 000000000..11aa0b563
--- /dev/null
+++ b/kwin/data/fsp_workarounds_1.kwinrules
@@ -0,0 +1,41 @@
+[1]
+Description=(Default) Disable focus stealing prevention for XV
+Description[bg]=(По подразбиране) Изключване открадването на фокуса за XV
+Description[ca]=(Omissió) Desactiva la prevenció del robatori de focus pel XV
+Description[da]=(Standard) Deaktivér forhindring af at stjæle fokus for XV
+Description[de]=(Voreinstellung) Vorbeugung gegen Fokusverlust für XV
+Description[el]=(Προκαθορισμένο) Απενεργοποίηση αποτροπής κλεψίματος εστίασης για το XV
+Description[eo]=(Defaŭlta) Malebligu la preventon de fokus-elprenado por XV
+Description[es]=(Predefinido) Deshabilitar la prevención de robo del foco para XV
+Description[et]=(Vaikimisi) keelatakse XV fookuse röövimise vältimine
+Description[fr]=(Défaut) Désactive le vol du focus pour XV
+Description[fy]=(standert) Foarkomme fan ôfpakke fan toetseboerdfokus foar XV
+Description[hr]=(Zadano) Onemogući sprečavanje preuzimanja fokusa za XV
+Description[hu]=(Alapértelmezés) A fókuszelvételi védelem kikapcsolása az XV-nél
+Description[is]=(Sjálfgefið) Aftengja vörn gegn fókusþjófnaði fyrir XV
+Description[it]=(Predefinita) Disabilita la prevenzione della cattura del fuoco per XV
+Description[ja]=(デフォルト) XV のフォーカス移動防止を無効にする
+Description[km]=(លំនាំដើម) បិទ​ការ​ផ្ដោតអារម្មណ៍ ដោយ​លួច​ការពារ​សម្រាប់ XV
+Description[ko]=(기본값) XV의 초점 뺏아가기 막기 사용하지 않기
+Description[nb]=(Standard) Slå av fokusoverstyring fra XV
+Description[nds]=(Standard) För XV de Fokusverleer-Schuul utmaken
+Description[nl]=(Standaard) Voorkomen van afpakken toetsenbordfocus voor XV
+Description[pl]=(Domyślne) wyłączenie przechwytywania aktywności dla XV
+Description[pt]=(Predefinido) Desactivar a prevenção de roubo do primeiro plano do XV
+Description[pt_BR]=(Padrão) Desativa prevenção de roubo de foco para o XV
+Description[ru]=(по умолчанию) отключить предотвращение потери для XV
+Description[sk]=(Štandard) Znemožniť kradnutie aktivity okna XV
+Description[sl]=(privzeto) Onemogoči preprečevanje kraje fokusa za XV
+Description[sr]=(Подразумевано) Искључи спречавање преузимања фокуса за XV
+Description[sr@Latn]=(Podrazumevano) Isključi sprečavanje preuzimanja fokusa za XV
+Description[sv]=(Förval) Inaktivera möjlighet att förhindra stöld av fokus för XV
+Description[wa]=(Prémetou) Dismete li hapaedje di focus po XV
+Description[zh_TW]=(預設)為 XV 關閉避免焦點被偷的功能
+fsplevel=0
+fsplevelrule=2
+wmclass=^xv .*
+wmclasscomplete=true
+wmclassmatch=3
+
+[General]
+count=1
diff --git a/kwin/data/kwin.upd b/kwin/data/kwin.upd
new file mode 100644
index 000000000..a987c513b
--- /dev/null
+++ b/kwin/data/kwin.upd
@@ -0,0 +1,14 @@
+Id=kde3.0r1
+File=kwinrc
+Options=overwrite
+Script=pluginlibFix.pl,perl
+
+# Xinerama fixups
+Id=kde3.2Xinerama
+File=kwinrc,kdeglobals
+Group=Windows
+Key=XineramaEnabled
+Key=XineramaMovementEnabled
+Key=XineramaPlacementEnabled
+Key=XineramaMaximizeEnabled
+
diff --git a/kwin/data/kwin3_plugin.pl b/kwin/data/kwin3_plugin.pl
new file mode 100644
index 000000000..791ea7f33
--- /dev/null
+++ b/kwin/data/kwin3_plugin.pl
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+foreach (<>) {
+ if(/^PluginLib=kwin_(.*)$/) {
+ print "PluginLib=kwin3_$1\n";
+ next;
+ }
+ print $_;
+}
diff --git a/kwin/data/kwin3_plugin.upd b/kwin/data/kwin3_plugin.upd
new file mode 100644
index 000000000..faf7b7971
--- /dev/null
+++ b/kwin/data/kwin3_plugin.upd
@@ -0,0 +1,4 @@
+Id=kde3.2
+File=kwinrc
+Options=overwrite
+Script=kwin3_plugin.pl,perl
diff --git a/kwin/data/kwin_focus1.sh b/kwin/data/kwin_focus1.sh
new file mode 100644
index 000000000..6ffe0e039
--- /dev/null
+++ b/kwin/data/kwin_focus1.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+was=
+while read line; do
+ if echo "$line" | grep '^IgnoreFocusStealingClasses=' >/dev/null 2>/dev/null; then
+ echo "$line" | sed 's/\(^IgnoreFocusStealingClasses=.*$\)/\1,kio_uiserver/'
+ was=1
+ else
+ echo "$line"
+ fi
+done
+if test -z "$was"; then
+ echo "IgnoreFocusStealingClasses=kio_uiserver"
+fi
diff --git a/kwin/data/kwin_focus1.upd b/kwin/data/kwin_focus1.upd
new file mode 100644
index 000000000..902ac0fad
--- /dev/null
+++ b/kwin/data/kwin_focus1.upd
@@ -0,0 +1,5 @@
+Id=kwin_focus1
+File=kwinrc
+Group=Windows
+Options=overwrite
+Script=kwin_focus1.sh,sh
diff --git a/kwin/data/kwin_focus2.sh b/kwin/data/kwin_focus2.sh
new file mode 100644
index 000000000..c3d6f9eea
--- /dev/null
+++ b/kwin/data/kwin_focus2.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+while read line; do
+ if echo "$line" | grep '^IgnoreFocusStealingClasses=' >/dev/null 2>/dev/null; then
+ echo "$line" | sed 's/,kded//' | sed 's/kded,//' | sed 's/,kget//' | sed 's/kget,//'
+ else
+ echo "$line"
+ fi
+done
diff --git a/kwin/data/kwin_focus2.upd b/kwin/data/kwin_focus2.upd
new file mode 100644
index 000000000..681c2c404
--- /dev/null
+++ b/kwin/data/kwin_focus2.upd
@@ -0,0 +1,5 @@
+Id=kwin_focus2
+File=kwinrc
+Group=Windows
+Options=overwrite
+Script=kwin_focus2.sh,sh
diff --git a/kwin/data/kwin_fsp_workarounds_1.upd b/kwin/data/kwin_fsp_workarounds_1.upd
new file mode 100644
index 000000000..2d725d2d2
--- /dev/null
+++ b/kwin/data/kwin_fsp_workarounds_1.upd
@@ -0,0 +1,8 @@
+Id=kde351
+# the file is intentionally a dummy, as the binary will update kwinrulesrc,
+# file kwinrules_update will just remember it has been done
+File=kwinrules_update
+Group=Dummy
+Options=overwrite
+ScriptArguments=fsp_workarounds_1.kwinrules
+Script=kwin_update_default_rules
diff --git a/kwin/data/kwiniconify.upd b/kwin/data/kwiniconify.upd
new file mode 100644
index 000000000..1946a1a91
--- /dev/null
+++ b/kwin/data/kwiniconify.upd
@@ -0,0 +1,8 @@
+Id=iconifyupd3.1
+File=kwin.eventsrc
+Group=iconify,minimize
+AllKeys
+Group=deiconify,unminimize
+AllKeys
+RemoveGroup=iconify
+RemoveGroup=deiconify
diff --git a/kwin/data/kwinsticky.upd b/kwin/data/kwinsticky.upd
new file mode 100644
index 000000000..3dc37ba47
--- /dev/null
+++ b/kwin/data/kwinsticky.upd
@@ -0,0 +1,8 @@
+Id=stickyupd3.1
+File=kwin.eventsrc
+Group=sticky,on_all_desktops
+AllKeys
+Group=unsticky,not_on_all_desktops
+AllKeys
+RemoveGroup=sticky
+RemoveGroup=unsticky
diff --git a/kwin/data/kwinupdatewindowsettings.upd b/kwin/data/kwinupdatewindowsettings.upd
new file mode 100644
index 000000000..4e5e6f28a
--- /dev/null
+++ b/kwin/data/kwinupdatewindowsettings.upd
@@ -0,0 +1,7 @@
+Id=kde33b1
+# the file is intentionally a dummy, as the binary will update kwinrc and kwinrulesrc
+# the kwin_update will just remember it has been done
+File=kwin_update
+Group=Dummy
+Options=overwrite
+Script=kwin_update_window_settings
diff --git a/kwin/data/pluginlibFix.pl b/kwin/data/pluginlibFix.pl
new file mode 100755
index 000000000..cb3859aeb
--- /dev/null
+++ b/kwin/data/pluginlibFix.pl
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+foreach (<>) {
+ if(/^PluginLib=libkwin(.*)$/) {
+ print "PluginLib=kwin_$1\n";
+ next;
+ }
+ print $_;
+}
diff --git a/kwin/data/pop.wav b/kwin/data/pop.wav
new file mode 100644
index 000000000..adf5c6c21
--- /dev/null
+++ b/kwin/data/pop.wav
Binary files differ
diff --git a/kwin/data/update_default_rules.cpp b/kwin/data/update_default_rules.cpp
new file mode 100644
index 000000000..78adc6164
--- /dev/null
+++ b/kwin/data/update_default_rules.cpp
@@ -0,0 +1,56 @@
+/*****************************************************************
+ KWin - the KDE window manager
+ This file is part of the KDE project.
+
+Copyright (C) 2005 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.
+******************************************************************/
+
+// read addtional window rules and add them to kwinrulesrc
+
+#include <dcopclient.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kinstance.h>
+#include <kstandarddirs.h>
+
+int main( int argc, char* argv[] )
+ {
+ if( argc != 2 )
+ return 1;
+ KInstance inst( "kwin_update_default_rules" );
+ QString file = locate( "data", QString( "kwin/default_rules/" ) + argv[ 1 ] );
+ if( file.isEmpty())
+ {
+ kdWarning() << "File " << argv[ 1 ] << " not found!" << endl;
+ return 1;
+ }
+ KConfig src_cfg( file );
+ KConfig dest_cfg( "kwinrulesrc" );
+ src_cfg.setGroup( "General" );
+ dest_cfg.setGroup( "General" );
+ int count = src_cfg.readNumEntry( "count", 0 );
+ int pos = dest_cfg.readNumEntry( "count", 0 );
+ for( int group = 1;
+ group <= count;
+ ++group )
+ {
+ QMap< QString, QString > entries = src_cfg.entryMap( QString::number( group ));
+ ++pos;
+ dest_cfg.deleteGroup( QString::number( pos ));
+ dest_cfg.setGroup( QString::number( pos ));
+ for( QMap< QString, QString >::ConstIterator it = entries.begin();
+ it != entries.end();
+ ++it )
+ dest_cfg.writeEntry( it.key(), *it );
+ }
+ dest_cfg.setGroup( "General" );
+ dest_cfg.writeEntry( "count", pos );
+ src_cfg.sync();
+ dest_cfg.sync();
+ DCOPClient client;
+ client.attach();
+ client.send("kwin*", "", "reconfigure()", "");
+ }
diff --git a/kwin/data/update_window_settings.cpp b/kwin/data/update_window_settings.cpp
new file mode 100644
index 000000000..369c1e4ea
--- /dev/null
+++ b/kwin/data/update_window_settings.cpp
@@ -0,0 +1,168 @@
+/*****************************************************************
+ KWin - the KDE window manager
+ This file is part of the KDE project.
+
+Copyright (C) 2004 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.
+******************************************************************/
+
+// updates per-window settings from KDE3.2 to KDE3.3
+
+#include <netwm_def.h>
+#include <kconfig.h>
+#include <kinstance.h>
+#include <dcopclient.h>
+
+struct SessionInfo
+ {
+ QCString sessionId;
+ QCString windowRole;
+ QCString wmCommand;
+ QCString wmClientMachine;
+ QCString resourceName;
+ QCString resourceClass;
+
+ QRect geometry;
+ QRect restore;
+ QRect fsrestore;
+ int maximized;
+ int fullscreen;
+ int desktop;
+ bool minimized;
+ bool onAllDesktops;
+ bool shaded;
+ bool keepAbove;
+ bool keepBelow;
+ bool skipTaskbar;
+ bool skipPager;
+ bool userNoBorder;
+ NET::WindowType windowType;
+ bool active; // means 'was active in the saved session', not used otherwise
+ bool fake; // fake session, i.e. 'save window settings', not SM restored
+ };
+
+QPtrList<SessionInfo> fakeSession;
+
+static const char* const window_type_names[] =
+ {
+ "Unknown", "Normal" , "Desktop", "Dock", "Toolbar", "Menu", "Dialog",
+ "Override", "TopMenu", "Utility", "Splash"
+ };
+ // change also the two functions below when adding new entries
+
+NET::WindowType txtToWindowType( const char* txt )
+ {
+ for( int i = NET::Unknown;
+ i <= NET::Splash;
+ ++i )
+ if( qstrcmp( txt, window_type_names[ i + 1 ] ) == 0 ) // +1
+ return static_cast< NET::WindowType >( i );
+ return static_cast< NET::WindowType >( -2 ); // undefined
+ }
+
+void loadFakeSessionInfo( KConfig* config )
+ {
+ fakeSession.clear();
+ config->setGroup("FakeSession" );
+ int count = config->readNumEntry( "count" );
+ for ( int i = 1; i <= count; i++ )
+ {
+ QString n = QString::number(i);
+ SessionInfo* info = new SessionInfo;
+ fakeSession.append( info );
+ info->windowRole = config->readEntry( QString("windowRole")+n ).latin1();
+ info->resourceName = config->readEntry( QString("resourceName")+n ).latin1();
+ info->resourceClass = config->readEntry( QString("resourceClass")+n ).lower().latin1();
+ info->wmClientMachine = config->readEntry( QString("clientMachine")+n ).latin1();
+ info->geometry = config->readRectEntry( QString("geometry")+n );
+ info->restore = config->readRectEntry( QString("restore")+n );
+ info->fsrestore = config->readRectEntry( QString("fsrestore")+n );
+ info->maximized = config->readNumEntry( QString("maximize")+n, 0 );
+ info->fullscreen = config->readNumEntry( QString("fullscreen")+n, 0 );
+ info->desktop = config->readNumEntry( QString("desktop")+n, 0 );
+ info->minimized = config->readBoolEntry( QString("iconified")+n, FALSE );
+ info->onAllDesktops = config->readBoolEntry( QString("sticky")+n, FALSE );
+ info->shaded = config->readBoolEntry( QString("shaded")+n, FALSE );
+ info->keepAbove = config->readBoolEntry( QString("staysOnTop")+n, FALSE );
+ info->keepBelow = config->readBoolEntry( QString("keepBelow")+n, FALSE );
+ info->skipTaskbar = config->readBoolEntry( QString("skipTaskbar")+n, FALSE );
+ info->skipPager = config->readBoolEntry( QString("skipPager")+n, FALSE );
+ info->userNoBorder = config->readBoolEntry( QString("userNoBorder")+n, FALSE );
+ info->windowType = txtToWindowType( config->readEntry( QString("windowType")+n ).latin1());
+ info->active = false;
+ info->fake = true;
+ }
+ config->deleteGroup( "FakeSession" );
+ }
+
+void writeRules( KConfig& cfg )
+ {
+ cfg.setGroup( "General" );
+ int pos = cfg.readNumEntry( "count" );
+ for ( SessionInfo* info = fakeSession.first(); info; info = fakeSession.next() )
+ {
+ if( info->resourceName.isEmpty() && info->resourceClass.isEmpty())
+ continue;
+ ++pos;
+ cfg.setGroup( QString::number( pos ));
+ cfg.writeEntry( "description", ( const char* ) ( info->resourceClass + " (KDE3.2)" ));
+ cfg.writeEntry( "wmclass", ( const char* )( info->resourceName + ' ' + info->resourceClass ));
+ cfg.writeEntry( "wmclasscomplete", true );
+ cfg.writeEntry( "wmclassmatch", 1 ); // 1 == exact match
+ if( !info->windowRole.isEmpty())
+ {
+ cfg.writeEntry( "windowrole", ( const char* ) info->windowRole );
+ cfg.writeEntry( "windowrolematch", 1 );
+ }
+ if( info->windowType == static_cast< NET::WindowType >( -2 )) // undefined
+ {} // all types
+ if( info->windowType == NET::Unknown )
+ cfg.writeEntry( "types", NET::NormalMask );
+ else
+ cfg.writeEntry( "types", 1 << info->windowType );
+ cfg.writeEntry( "position", info->geometry.topLeft());
+ cfg.writeEntry( "positionrule", 4 ); // 4 == remember
+ cfg.writeEntry( "size", info->geometry.size());
+ cfg.writeEntry( "sizerule", 4 );
+ cfg.writeEntry( "maximizevert", info->maximized & NET::MaxVert );
+ cfg.writeEntry( "maximizevertrule", 4 );
+ cfg.writeEntry( "maximizehoriz", info->maximized & NET::MaxHoriz );
+ cfg.writeEntry( "maximizehorizrule", 4 );
+ cfg.writeEntry( "fullscreen", info->fullscreen );
+ cfg.writeEntry( "fullscreenrule", 4 );
+ cfg.writeEntry( "desktop", info->desktop );
+ cfg.writeEntry( "desktoprule", 4 );
+ cfg.writeEntry( "minimize", info->minimized );
+ cfg.writeEntry( "minimizerule", 4 );
+ cfg.writeEntry( "shade", info->shaded );
+ cfg.writeEntry( "shaderule", 4 );
+ cfg.writeEntry( "above", info->keepAbove );
+ cfg.writeEntry( "aboverule", 4 );
+ cfg.writeEntry( "below", info->keepBelow );
+ cfg.writeEntry( "belowrule", 4 );
+ cfg.writeEntry( "skiptaskbar", info->skipTaskbar );
+ cfg.writeEntry( "skiptaskbarrule", 4 );
+ cfg.writeEntry( "skippager", info->skipPager );
+ cfg.writeEntry( "skippagerrule", 4 );
+ cfg.writeEntry( "noborder", info->userNoBorder );
+ cfg.writeEntry( "noborderrule", 4 );
+ }
+ cfg.setGroup( "General" );
+ cfg.writeEntry( "count", pos );
+ }
+
+int main()
+ {
+ KInstance inst( "kwin_update_window_settings" );
+ KConfig src_cfg( "kwinrc" );
+ KConfig dest_cfg( "kwinrulesrc" );
+ loadFakeSessionInfo( &src_cfg );
+ writeRules( dest_cfg );
+ src_cfg.sync();
+ dest_cfg.sync();
+ DCOPClient client;
+ client.attach();
+ client.send("kwin*", "", "reconfigure()", "");
+ }