From dc3ee2bce4075a05bae6c5afe9585456d5db2193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 1 Mar 2012 11:57:13 +0100 Subject: [PATCH] Drop kwin config updates from KDE 3.x times --- data/CMakeLists.txt | 17 +-- data/kwin.upd | 14 --- data/kwin3_plugin.pl | 8 -- data/kwin3_plugin.upd | 4 - data/kwin_focus1.sh | 13 --- data/kwin_focus1.upd | 5 - data/kwin_focus2.sh | 8 -- data/kwin_focus2.upd | 5 - data/kwin_on_off.upd | 5 - data/kwiniconify.upd | 8 -- data/kwinsticky.upd | 8 -- data/kwinupdatewindowsettings.upd | 2 - data/on-off_to_true-false.sh | 5 - data/pluginlibFix.pl | 8 -- data/update_window_settings.cpp | 183 ------------------------------ 15 files changed, 2 insertions(+), 291 deletions(-) delete mode 100644 data/kwin.upd delete mode 100755 data/kwin3_plugin.pl delete mode 100644 data/kwin3_plugin.upd delete mode 100755 data/kwin_focus1.sh delete mode 100644 data/kwin_focus1.upd delete mode 100755 data/kwin_focus2.sh delete mode 100644 data/kwin_focus2.upd delete mode 100644 data/kwin_on_off.upd delete mode 100644 data/kwiniconify.upd delete mode 100644 data/kwinsticky.upd delete mode 100644 data/kwinupdatewindowsettings.upd delete mode 100755 data/on-off_to_true-false.sh delete mode 100755 data/pluginlibFix.pl delete mode 100644 data/update_window_settings.cpp diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 7af23c9058..6033e87c66 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,19 +1,6 @@ set(kwin_xml ${CMAKE_CURRENT_SOURCE_DIR}/../org.kde.KWin.xml) - -########### next target ############### -set(kwin_update_window_settings_SRCS update_window_settings.cpp ) - - - -kde4_add_executable( kwin_update_window_settings ${kwin_update_window_settings_SRCS}) - -target_link_libraries( kwin_update_window_settings ${KDE4_KDECORE_LIBS}) - -install(TARGETS kwin_update_window_settings DESTINATION ${LIB_INSTALL_DIR}/kconf_update_bin/ ) - - ########### next target ############### set(kwin_update_default_rules_SRCS update_default_rules.cpp) @@ -45,6 +32,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 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 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 kwin_remove_delay_focus.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) +install( FILES kwin_fsp_workarounds_1.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 kwin_window_shortcuts.sh kwin_remove_delay_focus.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) diff --git a/data/kwin.upd b/data/kwin.upd deleted file mode 100644 index a987c513b4..0000000000 --- a/data/kwin.upd +++ /dev/null @@ -1,14 +0,0 @@ -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/data/kwin3_plugin.pl b/data/kwin3_plugin.pl deleted file mode 100755 index 791ea7f33b..0000000000 --- a/data/kwin3_plugin.pl +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -foreach (<>) { - if(/^PluginLib=kwin_(.*)$/) { - print "PluginLib=kwin3_$1\n"; - next; - } - print $_; -} diff --git a/data/kwin3_plugin.upd b/data/kwin3_plugin.upd deleted file mode 100644 index faf7b79712..0000000000 --- a/data/kwin3_plugin.upd +++ /dev/null @@ -1,4 +0,0 @@ -Id=kde3.2 -File=kwinrc -Options=overwrite -Script=kwin3_plugin.pl,perl diff --git a/data/kwin_focus1.sh b/data/kwin_focus1.sh deleted file mode 100755 index 6ffe0e0398..0000000000 --- a/data/kwin_focus1.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /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/data/kwin_focus1.upd b/data/kwin_focus1.upd deleted file mode 100644 index 902ac0fada..0000000000 --- a/data/kwin_focus1.upd +++ /dev/null @@ -1,5 +0,0 @@ -Id=kwin_focus1 -File=kwinrc -Group=Windows -Options=overwrite -Script=kwin_focus1.sh,sh diff --git a/data/kwin_focus2.sh b/data/kwin_focus2.sh deleted file mode 100755 index c3d6f9eeaf..0000000000 --- a/data/kwin_focus2.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /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/data/kwin_focus2.upd b/data/kwin_focus2.upd deleted file mode 100644 index 681c2c4043..0000000000 --- a/data/kwin_focus2.upd +++ /dev/null @@ -1,5 +0,0 @@ -Id=kwin_focus2 -File=kwinrc -Group=Windows -Options=overwrite -Script=kwin_focus2.sh,sh diff --git a/data/kwin_on_off.upd b/data/kwin_on_off.upd deleted file mode 100644 index 845aa933fb..0000000000 --- a/data/kwin_on_off.upd +++ /dev/null @@ -1,5 +0,0 @@ -Id=kwin_on_off -File=kwinrc -Group=Windows -Options=overwrite -Script=on-off_to_true-false.sh,sh diff --git a/data/kwiniconify.upd b/data/kwiniconify.upd deleted file mode 100644 index 1946a1a914..0000000000 --- a/data/kwiniconify.upd +++ /dev/null @@ -1,8 +0,0 @@ -Id=iconifyupd3.1 -File=kwin.eventsrc -Group=iconify,minimize -AllKeys -Group=deiconify,unminimize -AllKeys -RemoveGroup=iconify -RemoveGroup=deiconify diff --git a/data/kwinsticky.upd b/data/kwinsticky.upd deleted file mode 100644 index 3dc37ba474..0000000000 --- a/data/kwinsticky.upd +++ /dev/null @@ -1,8 +0,0 @@ -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/data/kwinupdatewindowsettings.upd b/data/kwinupdatewindowsettings.upd deleted file mode 100644 index 7af0cc1f8c..0000000000 --- a/data/kwinupdatewindowsettings.upd +++ /dev/null @@ -1,2 +0,0 @@ -Id=kde33b1 -Script=kwin_update_window_settings diff --git a/data/on-off_to_true-false.sh b/data/on-off_to_true-false.sh deleted file mode 100755 index a141819b18..0000000000 --- a/data/on-off_to_true-false.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -while read line; do - echo "$line" | sed 's@=\s*on\s*$@=true@g' | sed 's@=\s*off\s*$@=false@g' -done diff --git a/data/pluginlibFix.pl b/data/pluginlibFix.pl deleted file mode 100755 index cb3859aeb8..0000000000 --- a/data/pluginlibFix.pl +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -foreach (<>) { - if(/^PluginLib=libkwin(.*)$/) { - print "PluginLib=kwin_$1\n"; - next; - } - print $_; -} diff --git a/data/update_window_settings.cpp b/data/update_window_settings.cpp deleted file mode 100644 index da09d9e033..0000000000 --- a/data/update_window_settings.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2004 Lubos Lunak - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -// updates per-window settings from KDE3.2 to KDE3.3 - -#include -#include -#include -#include -#include -#include -#include -#include -struct SessionInfo - { - QByteArray sessionId; - QByteArray windowRole; - QByteArray wmCommand; - QByteArray wmClientMachine; - QByteArray resourceName; - QByteArray 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; - bool active; // means 'was active in the saved session', not used otherwise - bool fake; // fake session, i.e. 'save window settings', not SM restored - NET::WindowType windowType; - }; - -QList 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(); - KConfigGroup fakeGroup(config, "FakeSession"); - int count = fakeGroup.readEntry( "count",0 ); - for ( int i = 1; i <= count; i++ ) - { - QString n = QString::number(i); - SessionInfo* info = new SessionInfo; - fakeSession.append( info ); - info->windowRole = fakeGroup.readEntry( QString("windowRole")+n, QString() ).toLatin1(); - info->resourceName = fakeGroup.readEntry( QString("resourceName")+n, QString() ).toLatin1(); - info->resourceClass = fakeGroup.readEntry( QString("resourceClass")+n, QString() ).toLower().toLatin1(); - info->wmClientMachine = fakeGroup.readEntry( QString("clientMachine")+n, QString() ).toLatin1(); - info->geometry = fakeGroup.readEntry( QString("geometry")+n, QRect() ); - info->restore = fakeGroup.readEntry( QString("restore")+n, QRect() ); - info->fsrestore = fakeGroup.readEntry( QString("fsrestore")+n, QRect() ); - info->maximized = fakeGroup.readEntry( QString("maximize")+n, 0 ); - info->fullscreen = fakeGroup.readEntry( QString("fullscreen")+n, 0 ); - info->desktop = fakeGroup.readEntry( QString("desktop")+n, 0 ); - info->minimized = fakeGroup.readEntry( QString("iconified")+n, false ); - info->onAllDesktops = fakeGroup.readEntry( QString("sticky")+n, false ); - info->shaded = fakeGroup.readEntry( QString("shaded")+n, false ); - info->keepAbove = fakeGroup.readEntry( QString("staysOnTop")+n, false ); - info->keepBelow = fakeGroup.readEntry( QString("keepBelow")+n, false ); - info->skipTaskbar = fakeGroup.readEntry( QString("skipTaskbar")+n, false ); - info->skipPager = fakeGroup.readEntry( QString("skipPager")+n, false ); - info->userNoBorder = fakeGroup.readEntry( QString("userNoBorder")+n, false ); - info->windowType = txtToWindowType( fakeGroup.readEntry( QString("windowType")+n, QString() ).toLatin1()); - info->active = false; - info->fake = true; - } - config->deleteGroup( "FakeSession" ); - } - -void writeRules( KConfig& cfg ) - { - KConfigGroup cg(&cfg, "General"); - int pos = cg.readEntry( "count",0 ); - - QList::iterator it; - for ( it = fakeSession.begin(); it != fakeSession.end(); ++it) - { - if( (*it)->resourceName.isEmpty() && (*it)->resourceClass.isEmpty()) - continue; - ++pos; - KConfigGroup groupCfg(&cfg, QString::number( pos )); - groupCfg.writeEntry( "description", ( const char* ) ( (*it)->resourceClass + " (KDE3.2)" )); - groupCfg.writeEntry( "wmclass", ( const char* )( (*it)->resourceName + ' ' + (*it)->resourceClass )); - groupCfg.writeEntry( "wmclasscomplete", true ); - groupCfg.writeEntry( "wmclassmatch", 1 ); // 1 == exact match - if( !(*it)->windowRole.isEmpty()) - { - groupCfg.writeEntry( "windowrole", ( const char* ) (*it)->windowRole ); - groupCfg.writeEntry( "windowrolematch", 1 ); - } - if( (*it)->windowType == static_cast< NET::WindowType >( -2 )) // undefined - {} // all types - if( (*it)->windowType == NET::Unknown ) - groupCfg.writeEntry( "types", (int)NET::NormalMask ); - else - groupCfg.writeEntry( "types", 1 << (*it)->windowType ); - groupCfg.writeEntry( "position", (*it)->geometry.topLeft()); - groupCfg.writeEntry( "positionrule", 4 ); // 4 == remember - groupCfg.writeEntry( "size", (*it)->geometry.size()); - groupCfg.writeEntry( "sizerule", 4 ); - groupCfg.writeEntry( "maximizevert", (*it)->maximized & NET::MaxVert ); - groupCfg.writeEntry( "maximizevertrule", 4 ); - groupCfg.writeEntry( "maximizehoriz", (*it)->maximized & NET::MaxHoriz ); - groupCfg.writeEntry( "maximizehorizrule", 4 ); - groupCfg.writeEntry( "fullscreen", (*it)->fullscreen ); - groupCfg.writeEntry( "fullscreenrule", 4 ); - groupCfg.writeEntry( "desktop", (*it)->desktop ); - groupCfg.writeEntry( "desktoprule", 4 ); - groupCfg.writeEntry( "minimize", (*it)->minimized ); - groupCfg.writeEntry( "minimizerule", 4 ); - groupCfg.writeEntry( "shade", (*it)->shaded ); - groupCfg.writeEntry( "shaderule", 4 ); - groupCfg.writeEntry( "above", (*it)->keepAbove ); - groupCfg.writeEntry( "aboverule", 4 ); - groupCfg.writeEntry( "below", (*it)->keepBelow ); - groupCfg.writeEntry( "belowrule", 4 ); - groupCfg.writeEntry( "skiptaskbar", (*it)->skipTaskbar ); - groupCfg.writeEntry( "skiptaskbarrule", 4 ); - groupCfg.writeEntry( "skippager", (*it)->skipPager ); - groupCfg.writeEntry( "skippagerrule", 4 ); - groupCfg.writeEntry( "noborder", (*it)->userNoBorder ); - groupCfg.writeEntry( "noborderrule", 4 ); - } - cg.writeEntry( "count", pos ); - } - -int main() - { - KComponentData 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(); - // Send signal to all kwin instances - QDBusMessage message = - QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); - QDBusConnection::sessionBus().send(message); - }