Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Karousel: Window Movement Issue in Multi-Screen Setup on plasma 6 git version #37

Closed
Riebeck-one opened this issue Mar 11, 2024 · 10 comments

Comments

@Riebeck-one
Copy link

Karousel shifts all windows to the active screen in a multi-screen setup instead of remaining on the primary screen.

Steps to replicate:

  • Open windows on the primary screen.
  • Click anywhere on another screen.
@Riebeck-one Riebeck-one changed the title Karousel: Window Movement Issue in Multi-Screen Setup Karousel: Window Movement Issue in Multi-Screen Setup on plasma 6 git version Mar 11, 2024
@peterfajdiga
Copy link
Owner

Thanks for the report! I can confirm this bug, but unfortunately in Plasma 6 there doesn't seem to be any way to find out which screen is the primary one.

I'm trying to decide what's the best way to work around this limitation.

@Riebeck-one
Copy link
Author

I just found out about this script for plasma 6 :
https://github.com/wd5gnr/moveallwindowstoscreen6/tree/main
It let's the user send all windows to a selected screen via a keyboard shortcut. Maybe it could help ?
The relevant code seems to be this :

function isRelevant(client) {
    return !client.specialWindow;
}

function moveAllWindowsToScreen(screen) {
    var allClients = workspace.windowList();   // was clientList in v5
    var relevantClients = allClients.filter(function(client) {
        return isRelevant(client);
    });

    for (var i = 0; i < relevantClients.length; ++i) {
        var client = relevantClients[i];
        workspace.sendClientToScreen(client, workspace.screens[screen]);   // was just screen number in v5
    }
}

function moveAllTo0() {moveAllWindowsToScreen(0)}
function moveAllTo1() {moveAllWindowsToScreen(1)}
function moveAllTo2() {moveAllWindowsToScreen(2)}
function moveAllTo3() {moveAllWindowsToScreen(3)}
registerShortcut("Move All Windows To Screen 0", "Move All Windows To Screen 0", "", moveAllTo0);
registerShortcut("Move All Windows To Screen 1", "Move All Windows To Screen 1", "", moveAllTo1);
registerShortcut("Move All Windows To Screen 2", "Move All Windows To Screen 2", "", moveAllTo2);
registerShortcut("Move All Windows To Screen 3", "Move All Windows To Screen 3", "", moveAllTo3);

Maybeworkspace.screens[0]points out to the primary screen ?

@JulioJair
Copy link

JulioJair commented Apr 22, 2024

@peterfajdiga Thanks for your awesome work btw. I've been using Karousel for months. I recently updated to Plasma 6 and found myself in the same exact situation.

If the script that @maxinova found works as expected, it would be nice for the Karousel windows to be fixed to the primary screen

@peterfajdiga
Copy link
Owner

Unfortunately workspace.screens[0] doesn't necessarily point to the primary screen.

@Riebeck-one
Copy link
Author

A possible temporary solution might be to force Karousel to stay on a single screen, regardless of whether it's the primary one. Users could then utilize keyboard shortcuts to switch between different screens.

@peterfajdiga
Copy link
Owner

@Riebeck-one Yes, that would work. But it would be a bit annoying having to switch to your preferred screen after every startup.

Another possible solution/workaround I'm thinking of would be to implement per-screen tiling with a keyboard shortcut to disable tiling on the current screen. This has the same problem of having to do this after every startup, though.

@Benzolio
Copy link

Benzolio commented Jun 4, 2024

Using a laptop with a sometimes connected external monitor, I tend to want to change which screen handles which windows often anyway, so enabling/disabling things after startup is common for me anyway, but when i really whant to automate, it is usually scriptable or handled by Window Rules. I'd imagine having per-screen tiling enabled for all screens should generally be OK, but having the option to configure some options would be good, ie: if the screen for new windows targets the current focus (either the screen of the active window, or the screen where the mouse is pointing, depending on settings.) I'd imagine using KDE window rules would work for most exceptions, such as forcing certain apps to always open on a specific screen, but maybe that could be handled more conveniently in Karousel config Window Rules.
Anyway, when I do have more than one screen, I would like to tile a set of window columns independently on each screen, and be able to drag a window (or move with keyboard shortcuts) from one screen to another.

@peterfajdiga
Copy link
Owner

@Riebeck-one I've implemented the solution you've described, with the keyboard shortcut Meta+Ctrl+Return by default (picked arbitrarily, alternative suggestions welcome).

@Riebeck-one
Copy link
Author

Oh, nice! Can't wait to try this out.

@Riebeck-one
Copy link
Author

@peterfajdiga Just did the update, it's much more comfortable to use now. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants