diff options
Diffstat (limited to 'twin/data')
-rw-r--r-- | twin/data/CMakeLists.txt | 58 | ||||
-rw-r--r-- | twin/data/Makefile.am | 25 | ||||
-rw-r--r-- | twin/data/fsp_workarounds_1.twinrules | 80 | ||||
-rwxr-xr-x | twin/data/pluginlibFix.pl | 8 | ||||
-rw-r--r-- | twin/data/pop.wav | bin | 0 -> 4068 bytes | |||
-rw-r--r-- | twin/data/twin.upd | 14 | ||||
-rw-r--r-- | twin/data/twin3_plugin.pl | 8 | ||||
-rw-r--r-- | twin/data/twin3_plugin.upd | 4 | ||||
-rw-r--r-- | twin/data/twin_focus1.sh | 13 | ||||
-rw-r--r-- | twin/data/twin_focus1.upd | 5 | ||||
-rw-r--r-- | twin/data/twin_focus2.sh | 8 | ||||
-rw-r--r-- | twin/data/twin_focus2.upd | 5 | ||||
-rw-r--r-- | twin/data/twin_fsp_workarounds_1.upd | 8 | ||||
-rw-r--r-- | twin/data/twiniconify.upd | 8 | ||||
-rw-r--r-- | twin/data/twinsticky.upd | 8 | ||||
-rw-r--r-- | twin/data/twinupdatewindowsettings.upd | 7 | ||||
-rw-r--r-- | twin/data/update_default_rules.cpp | 56 | ||||
-rw-r--r-- | twin/data/update_window_settings.cpp | 168 |
18 files changed, 483 insertions, 0 deletions
diff --git a/twin/data/CMakeLists.txt b/twin/data/CMakeLists.txt new file mode 100644 index 000000000..808d65e06 --- /dev/null +++ b/twin/data/CMakeLists.txt @@ -0,0 +1,58 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES + twin.upd twinsticky.upd twiniconify.upd twin3_plugin.upd + twin_focus1.upd twinupdatewindowsettings.upd + twin_focus2.upd twin_fsp_workarounds_1.upd + DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) + +install( PROGRAMS + pluginlibFix.pl twin3_plugin.pl twin_focus1.sh twin_focus2.sh + DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) + +install( FILES + pop.wav + DESTINATION ${SOUND_INSTALL_DIR} ) + +install( FILES + fsp_workarounds_1.twinrules + DESTINATION ${DATA_INSTALL_DIR}/twin/default_rules ) + + +##### twin_update_window_settings (executable) ## + +tde_add_executable( twin_update_window_settings + SOURCES update_window_settings.cpp + LINK tdecore-shared + DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin +) + + +##### twin_update_default_rules (executable) #### + +tde_add_executable( twin_update_default_rules + SOURCES update_default_rules.cpp + LINK tdecore-shared + DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin +) diff --git a/twin/data/Makefile.am b/twin/data/Makefile.am new file mode 100644 index 000000000..81bc0db43 --- /dev/null +++ b/twin/data/Makefile.am @@ -0,0 +1,25 @@ +kconf_PROGRAMS = twin_update_window_settings twin_update_default_rules +kconfdir = $(libdir)/kconf_update_bin + +twin_update_window_settings_SOURCES = update_window_settings.cpp +twin_update_window_settings_LDADD = $(LIB_TDECORE) $(KDE_RPATH) +twin_update_window_settings_LDFLAGS = $(all_libraries) + +twin_update_default_rules_SOURCES = update_default_rules.cpp +twin_update_default_rules_LDADD = $(LIB_TDECORE) $(KDE_RPATH) +twin_update_default_rules_LDFLAGS = $(all_libraries) + +INCLUDES = $(all_includes) + +METASOURCES = AUTO + +sounddir= $(kde_sounddir) +sound_DATA = pop.wav + +update_DATA = twin.upd twinsticky.upd twiniconify.upd twin3_plugin.upd twin_focus1.upd \ + twinupdatewindowsettings.upd twin_focus2.upd twin_fsp_workarounds_1.upd +update_SCRIPTS = pluginlibFix.pl twin3_plugin.pl twin_focus1.sh twin_focus2.sh +updatedir = $(kde_datadir)/kconf_update + +twin_default_rules_DATA = fsp_workarounds_1.twinrules +twin_default_rulesdir = $(kde_datadir)/twin/default_rules diff --git a/twin/data/fsp_workarounds_1.twinrules b/twin/data/fsp_workarounds_1.twinrules new file mode 100644 index 000000000..a5a24ae10 --- /dev/null +++ b/twin/data/fsp_workarounds_1.twinrules @@ -0,0 +1,80 @@ +[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 + +[2] +Description=(Default) Allow focus stealing by the kdesktop run dialog +fsplevel=0 +fsplevelrule=2 +title=Run Command +titlematch=0 +types=32 +wmclass=kdesktop +wmclasscomplete=false +wmclassmatch=1 + +[3] +Description=(Default) Allow focus stealing by the settings test dialog +fsplevel=0 +fsplevelrule=2 +title=Confirm Display Settings - KDE Control Module +titlematch=0 +types=32 +windowrole=mainktimerdialog +windowrolematch=1 +wmclass= +wmclasscomplete=false +wmclassmatch=0 + +[4] +Description=(Default) Hide system modal dialog class from taskbar +fsplevel=0 +fsplevelrule=2 +skiptaskbar=true +skiptaskbarrule=2 +title= +titlematch=0 +types=32 +windowrole=systemmodaldialogclass +windowrolematch=1 +wmclass= +wmclasscomplete=false +wmclassmatch=0 + +[General] +count=4 diff --git a/twin/data/pluginlibFix.pl b/twin/data/pluginlibFix.pl new file mode 100755 index 000000000..95357d1a2 --- /dev/null +++ b/twin/data/pluginlibFix.pl @@ -0,0 +1,8 @@ +#!/usr/bin/perl +foreach (<>) { + if(/^PluginLib=libtwin(.*)$/) { + print "PluginLib=twin_$1\n"; + next; + } + print $_; +} diff --git a/twin/data/pop.wav b/twin/data/pop.wav Binary files differnew file mode 100644 index 000000000..adf5c6c21 --- /dev/null +++ b/twin/data/pop.wav diff --git a/twin/data/twin.upd b/twin/data/twin.upd new file mode 100644 index 000000000..802ad5c44 --- /dev/null +++ b/twin/data/twin.upd @@ -0,0 +1,14 @@ +Id=trinity.0r1 +File=twinrc +Options=overwrite +Script=pluginlibFix.pl,perl + +# Xinerama fixups +Id=trinity.2Xinerama +File=twinrc,kdeglobals +Group=Windows +Key=XineramaEnabled +Key=XineramaMovementEnabled +Key=XineramaPlacementEnabled +Key=XineramaMaximizeEnabled + diff --git a/twin/data/twin3_plugin.pl b/twin/data/twin3_plugin.pl new file mode 100644 index 000000000..f5234bcce --- /dev/null +++ b/twin/data/twin3_plugin.pl @@ -0,0 +1,8 @@ +#!/usr/bin/perl +foreach (<>) { + if(/^PluginLib=twin_(.*)$/) { + print "PluginLib=twin3_$1\n"; + next; + } + print $_; +} diff --git a/twin/data/twin3_plugin.upd b/twin/data/twin3_plugin.upd new file mode 100644 index 000000000..7194b5641 --- /dev/null +++ b/twin/data/twin3_plugin.upd @@ -0,0 +1,4 @@ +Id=trinity.2 +File=twinrc +Options=overwrite +Script=twin3_plugin.pl,perl diff --git a/twin/data/twin_focus1.sh b/twin/data/twin_focus1.sh new file mode 100644 index 000000000..6ffe0e039 --- /dev/null +++ b/twin/data/twin_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/twin/data/twin_focus1.upd b/twin/data/twin_focus1.upd new file mode 100644 index 000000000..b7cc384a7 --- /dev/null +++ b/twin/data/twin_focus1.upd @@ -0,0 +1,5 @@ +Id=twin_focus1 +File=twinrc +Group=Windows +Options=overwrite +Script=twin_focus1.sh,sh diff --git a/twin/data/twin_focus2.sh b/twin/data/twin_focus2.sh new file mode 100644 index 000000000..c3d6f9eea --- /dev/null +++ b/twin/data/twin_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/twin/data/twin_focus2.upd b/twin/data/twin_focus2.upd new file mode 100644 index 000000000..094edd446 --- /dev/null +++ b/twin/data/twin_focus2.upd @@ -0,0 +1,5 @@ +Id=twin_focus2 +File=twinrc +Group=Windows +Options=overwrite +Script=twin_focus2.sh,sh diff --git a/twin/data/twin_fsp_workarounds_1.upd b/twin/data/twin_fsp_workarounds_1.upd new file mode 100644 index 000000000..c451045c5 --- /dev/null +++ b/twin/data/twin_fsp_workarounds_1.upd @@ -0,0 +1,8 @@ +Id=trinity51 +# the file is intentionally a dummy, as the binary will update twinrulesrc, +# file twinrules_update will just remember it has been done +File=twinrules_update +Group=Dummy +Options=overwrite +ScriptArguments=fsp_workarounds_1.twinrules +Script=twin_update_default_rules diff --git a/twin/data/twiniconify.upd b/twin/data/twiniconify.upd new file mode 100644 index 000000000..eae98094b --- /dev/null +++ b/twin/data/twiniconify.upd @@ -0,0 +1,8 @@ +Id=iconifyupd3.1 +File=twin.eventsrc +Group=iconify,minimize +AllKeys +Group=deiconify,unminimize +AllKeys +RemoveGroup=iconify +RemoveGroup=deiconify diff --git a/twin/data/twinsticky.upd b/twin/data/twinsticky.upd new file mode 100644 index 000000000..84fd36788 --- /dev/null +++ b/twin/data/twinsticky.upd @@ -0,0 +1,8 @@ +Id=stickyupd3.1 +File=twin.eventsrc +Group=sticky,on_all_desktops +AllKeys +Group=unsticky,not_on_all_desktops +AllKeys +RemoveGroup=sticky +RemoveGroup=unsticky diff --git a/twin/data/twinupdatewindowsettings.upd b/twin/data/twinupdatewindowsettings.upd new file mode 100644 index 000000000..74b252462 --- /dev/null +++ b/twin/data/twinupdatewindowsettings.upd @@ -0,0 +1,7 @@ +Id=trinity3b1 +# the file is intentionally a dummy, as the binary will update twinrc and twinrulesrc +# the twin_update will just remember it has been done +File=twin_update +Group=Dummy +Options=overwrite +Script=twin_update_window_settings diff --git a/twin/data/update_default_rules.cpp b/twin/data/update_default_rules.cpp new file mode 100644 index 000000000..a5e018ba1 --- /dev/null +++ b/twin/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 twinrulesrc + +#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( "twin_update_default_rules" ); + TQString file = locate( "data", TQString( "twin/default_rules/" ) + argv[ 1 ] ); + if( file.isEmpty()) + { + kdWarning() << "File " << argv[ 1 ] << " not found!" << endl; + return 1; + } + KConfig src_cfg( file ); + KConfig dest_cfg( "twinrulesrc" ); + 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 ) + { + TQMap< TQString, TQString > entries = src_cfg.entryMap( TQString::number( group )); + ++pos; + dest_cfg.deleteGroup( TQString::number( pos )); + dest_cfg.setGroup( TQString::number( pos )); + for( TQMap< TQString, TQString >::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("twin*", "", "reconfigure()", TQString("")); + } diff --git a/twin/data/update_window_settings.cpp b/twin/data/update_window_settings.cpp new file mode 100644 index 000000000..a82e26492 --- /dev/null +++ b/twin/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 + { + TQCString sessionId; + TQCString windowRole; + TQCString wmCommand; + TQCString wmClientMachine; + TQCString resourceName; + TQCString resourceClass; + + TQRect geometry; + TQRect restore; + TQRect 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 + }; + +TQPtrList<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++ ) + { + TQString n = TQString::number(i); + SessionInfo* info = new SessionInfo; + fakeSession.append( info ); + info->windowRole = config->readEntry( TQString("windowRole")+n ).latin1(); + info->resourceName = config->readEntry( TQString("resourceName")+n ).latin1(); + info->resourceClass = config->readEntry( TQString("resourceClass")+n ).lower().latin1(); + info->wmClientMachine = config->readEntry( TQString("clientMachine")+n ).latin1(); + info->geometry = config->readRectEntry( TQString("geometry")+n ); + info->restore = config->readRectEntry( TQString("restore")+n ); + info->fsrestore = config->readRectEntry( TQString("fsrestore")+n ); + info->maximized = config->readNumEntry( TQString("maximize")+n, 0 ); + info->fullscreen = config->readNumEntry( TQString("fullscreen")+n, 0 ); + info->desktop = config->readNumEntry( TQString("desktop")+n, 0 ); + info->minimized = config->readBoolEntry( TQString("iconified")+n, FALSE ); + info->onAllDesktops = config->readBoolEntry( TQString("sticky")+n, FALSE ); + info->shaded = config->readBoolEntry( TQString("shaded")+n, FALSE ); + info->keepAbove = config->readBoolEntry( TQString("staysOnTop")+n, FALSE ); + info->keepBelow = config->readBoolEntry( TQString("keepBelow")+n, FALSE ); + info->skipTaskbar = config->readBoolEntry( TQString("skipTaskbar")+n, FALSE ); + info->skipPager = config->readBoolEntry( TQString("skipPager")+n, FALSE ); + info->userNoBorder = config->readBoolEntry( TQString("userNoBorder")+n, FALSE ); + info->windowType = txtToWindowType( config->readEntry( TQString("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( TQString::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( "twin_update_window_settings" ); + KConfig src_cfg( "twinrc" ); + KConfig dest_cfg( "twinrulesrc" ); + loadFakeSessionInfo( &src_cfg ); + writeRules( dest_cfg ); + src_cfg.sync(); + dest_cfg.sync(); + DCOPClient client; + client.attach(); + client.send("twin*", "", "reconfigure()", TQString("")); + } |