diff --git a/commentary.org b/commentary.org index c89554bc7293a9ae071064a7a873fa0229f3b819..c0c3d221e14396d281dd2d13a9b8d11acd79ed82 100644 --- a/commentary.org +++ b/commentary.org @@ -1,6 +1,5 @@ * TODO Make rules for tiling -** HACK Ignore yakuake and menus/dialogs for tiling - Waiting for KDE 4.11 which allows configuration for kwin scripts +** DONE HACK Ignore yakuake and menus/dialogs for tiling ** DONE Add useractionsmenu * DONE Resize tiles Hacked for Spirallayout, working for Halflayout @@ -22,6 +21,8 @@ ** This was the result of removing an element from an array and afterwards accessing it by index * DONE Retile on minimize +* TODO Avoid struts + Never noticed because I set the panel to autohide * TODO Testing ** Weird apps (mplayer, gimp) ** Weird configurations diff --git a/contents/code/tests.js b/contents/code/tests.js index 00d3aee8b77719c974e102619a7b9f6f51c1e778..ef7735a245761c07566c300840bd568604e8a1c5 100644 --- a/contents/code/tests.js +++ b/contents/code/tests.js @@ -40,3 +40,17 @@ success2 = false; testSignal.disconnect(testSlot2); testSignal.emit(1, 2, "test"); print("Signal test 2: " + (success1 && !success2 ? "SUCCESS" : "FAILURE")); + +var isConfig = function(name, defaultValue) { + print("Reading", name); + c = readConfig(name, defaultValue); + print("Read", name); + if (c == null) { + print("Configuration option", name, "not defined"); + } else { + print("Configuration option", name, ": ", c); + } +} + +print("Testing configuration"); +isConfig("floaters", ""); diff --git a/contents/code/tilelist.js b/contents/code/tilelist.js index dd5a3298cbfd416b51525a5677d73a6f40514949..ad9fa9683590f51fb1beaa5628762e0854089e86 100644 --- a/contents/code/tilelist.js +++ b/contents/code/tilelist.js @@ -125,6 +125,7 @@ TileList.prototype.addClient = function(client) { this.tiles[tileIndex].clients.push(client); } } else { + print("Adding client",client.resourceClass.toString(), "to a new tile"); // If not, create a new tile this._addTile(client); } @@ -252,10 +253,16 @@ TileList.prototype._identifyNewTiles = function() { * all, e.g. the panel. */ TileList._isIgnored = function(client) { - // NOTE: Application workarounds should be put here - // TODO: Hook this up to the rules - var floaters = Array("yakuake", "krunner", "Plasma", "Plasma-desktop", "plasma-desktop", "Plugin-container", "plugin-container"); + // Application workarounds should be put here + // Qt gives us a method-less QVariant(QStringList) if we ask for an array + // Ask for a string instead (which can and should still be a StringList for the UI) + var fl = "yakuake,krunner,Plasma,Plasma-desktop,plasma-desktop,Plugin-container,plugin-container,Wine"; + // TODO: This could break if an entry contains whitespace or a comma - it needs to be validated on the qt side + var floaters = String(readConfig("floaters", fl)).replace(/ /g,"").split(","); + print("Floaters: ",floaters); + print(client.resourceClass.toString()); if (floaters.indexOf(client.resourceClass.toString()) > -1) { + print("Client floating"); client.syncTabGroupFor("kwin_tiling_floats", true); return true; } diff --git a/contents/config/main.xml b/contents/config/main.xml index 626a7f074ec3a88dbe9eea47ce3784505c92b9af..12a8f8a4a12f3db35f04e147f481d689ec0a2062 100644 --- a/contents/config/main.xml +++ b/contents/config/main.xml @@ -5,8 +5,9 @@ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > <kcfgfile name=""/> <group name=""> - <entry name="FadeToBlack" type="Bool"> - <default>false</default> + <entry name="floaters" type="StringList"> + <label>The windows (by class) that should float</label> + <default>yakuake,Plasma,Plasma-desktop,krunner,plugin-container</default> </entry> </group> </kcfg> diff --git a/contents/ui/config.ui b/contents/ui/config.ui index 93e500da09e64aa65533470d0605123e2121b699..b685b09f32dd588b70d8df9ccb219005efbf7217 100644 --- a/contents/ui/config.ui +++ b/contents/ui/config.ui @@ -11,13 +11,6 @@ </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QCheckBox" name="kcfg_FadeToBlack"> - <property name="text"> - <string>Fade to black (fullscreen splash screens only)</string> - </property> - </widget> - </item> <item> <spacer name="verticalSpacer"> <property name="orientation"> @@ -31,8 +24,22 @@ </property> </spacer> </item> + <item> + <widget class="KEditListBox" name="kcfg_floaters"> + <property name="buttons"> + <set>KEditListBox::Add|KEditListBox::Remove</set> + </property> + </widget> + </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>KEditListBox</class> + <extends>QGroupBox</extends> + <header>keditlistbox.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/metadata.desktop b/metadata.desktop index 264d904f7c48591b873447dc1c396761bc960d76..f159c004e3542569d2f1002120563d6e13a3efc1 100644 --- a/metadata.desktop +++ b/metadata.desktop @@ -8,9 +8,9 @@ X-KWin-Exclude-Listing=false X-KDE-PluginInfo-Author=Fabian Homborg X-KDE-PluginInfo-Email=FHomborg@gmail.com -X-KDE-PluginInfo-Name=tiling -X-KDE-PluginKeyword=tiling -X-KDE-ParentComponents=tiling +X-KDE-PluginInfo-Name=kwin-script-tiling +X-KDE-PluginKeyword=kwin-script-tiling +X-KDE-ParentComponents=kwin-script-tiling X-KDE-PluginInfo-Version=0.2 X-KDE-PluginInfo-Depends=