Skip to content

Commit

Permalink
fix order among windows of an application group sometimes not applie…
Browse files Browse the repository at this point in the history
…d correctly
  • Loading branch information
nclarius committed May 26, 2022
1 parent 2cdaf60 commit 7cd212a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.bbcode
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[h2]v1.3[/h2]
[list]\n[*] fix order among windows of an application group sometimes not applied correctly
[/list]

[h2]v1.2[/h2]
[list]\n[*] fix application group sometimes not raised
[/list]
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v1.3
- fix order among windows of an application group sometimes not applied correctly

## v1.2
- fix application group sometimes not raised

Expand Down
2 changes: 1 addition & 1 deletion README.bbcode
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Automatically raises all other visible windows of the same application together when activating one of them, effectively creating application groups to task-switch between.

[b]Please make sure to install the most recent version (v1.2) and to not use Discover for installation.[/b] For more information on installation, setup and usage as well as any requests, please visit [url=https://github.com/nclarius/kwin-application-switcher]the GitHub page[/url].
[b]Please make sure to install the most recent version (v1.3) and to not use Discover for installation.[/b] For more information on installation, setup and usage as well as any requests, please visit [url=https://github.com/nclarius/kwin-application-switcher]the GitHub page[/url].

This extension gives rise to an application-centric task switching workflow as known from environments such as GNOME or MacOS, where an application’s windows are treated as a group, and task switching can take place at two levels: one mode for switching applications and one mode for switching between windows of an application.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Seen in the screencast: Switching from Konsole back to Dolphin also brings the o

### Installation via graphical interface

**Please make sure to select the most recent version (v1.2)** in the installation process.
**Please make sure to select the most recent version (v1.3)** in the installation process.

A [bug](https://bugs.kde.org/show_bug.cgi?id=453521) in Discover causes a wrong version to be installed, so using the installation module in System Settings instead is recommended.

Expand Down
Binary file not shown.
26 changes: 1 addition & 25 deletions contents/code/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,7 @@ function getAppGroup(current) {


///////////////////////
// keep track of auto-raised windows
///////////////////////

// [dolphin window 1, dolphin window 2, ...]
var autoActivated = [];

function addAutoActivated(current) {
autoActivated = autoActivated.filter(window => window &&
window != current);
autoActivated.push(current);
}

function clearAutoActivated() {
autoActivated = [];
}

///////////////////////
// application switching
// main
///////////////////////

// when client is activated, auto-raise other windows of the same applicaiton
Expand All @@ -125,22 +108,15 @@ workspace.clientActivated.connect(active => {
debug("ignored");
return;
}
// abort if current activation was due to auto-raise
if (autoActivated.includes(active)) {
debug("auto-raised");
return;
}
updateAppGroups(active);

// if application was switched
debug("previous app", getPrevActiveApp());
if (getApp(active) != getPrevActiveApp()) {
debug("app switched");
clearAutoActivated();
// auto-raise other windows of same application
for (let window of getAppGroup(active)) {
debug("auto-raising", window.caption);
addAutoActivated(window);
workspace.activeClient = window;
}
setPrevActiveApp(active);
Expand Down
2 changes: 1 addition & 1 deletion metadata.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Comment=Collectively raises all windows of the same application when switching t
Icon=preferences-system-windows

X-KDE-PluginInfo-Name=applicationswitcher
X-KDE-PluginInfo-Version=1.2
X-KDE-PluginInfo-Version=1.3
X-KDE-PluginInfo-Author=Natalie Clarius
X-KDE-PluginInfo-Email[email protected]
X-KDE-PluginInfo-License=GPLv3.0
Expand Down

0 comments on commit 7cd212a

Please sign in to comment.