peterfajdiga / karousel

Scrollable tiling Kwin script
GNU General Public License v3.0
198 stars 3 forks source link

Feature Request - Drag windows in tiling mode #6

Open wesbluemarine opened 11 months ago

wesbluemarine commented 11 months ago

Could it be possible to implement dragging windows in tiling mode without putting them in floating?

peterfajdiga commented 11 months ago

This is doable and it would help improve ease of use. Thanks for letting me know you'd find it useful, as I wasn't really prioritizing this. Still it might take some time before I find the time for this as it's not entirely effortless.

gleyconJ commented 3 months ago

I support! Eagerly awaiting this feature.

kelvie commented 1 week ago

@peterfajdiga any clues for how to do this for those of us that are willing to try to implement this ourselves? Or what mechanisms in the kwin scripting API would allow for this?

This is probably the last piece of the puzzle for me to completely switch my desktop from hyprland back to KDE.

peterfajdiga commented 3 days ago

@kelvie I suppose you'd have to use the interactiveMoveResizeStepped or frameGeometryChanged signal and the move boolean KwinClient property to detect windows being moved.

Then you'd have to figure out the user's intention based on the window's new position (frameGeometry KwinClient property) and adjust the layout accordingly using methods like Window.moveToColumn, Column.moveWindow (doesn't exist yet) or Grid.moveColumn (for single-window columns).

World.do applies the new layout, but you'll have to make sure that you don't try to move the window that the user is currently moving by setting Window.skipArrange (same as is done for resizing).

It would require quite a bit of effort and I'm wondering if that effort would be better spent by creating a separate GUI for rearranging windows - imagine a minimap of all the windows that can be dragged to desired positions. This way the user is not limited by what is currently visible on the screen and it also requires smaller mouse movements. This could be a popup or a plasmoid (like a taskbar - I've already created something like this, but I haven't yet found a method of communication between a plasmoid and a Kwin script). I think QML already has support for dragging items around (like in the Taskbar plasmoid), so in a way this might actually be easier... if we ignore having to create a GUI. Just a thought...

gleyconJ commented 13 hours ago

@kelvie Suponho que você teria que usar o interactiveMoveResizeStepped ou frameGeometryChanged sinal e o move propriedade Boolean KwinClient para detectar janelas sendo movidas.

Então você teria que descobrir a intenção do usuário com base na nova posição da janela (frameGeometry Propriedade KwinClient) e ajuste o layout de acordo usando métodos como Window.moveToColumn, Column.moveWindow (ainda não existe) ou Grid.moveColumn (para colunas de janela única).

World.do aplica o novo layout, mas você terá que se certificar de que não tentará mover a janela que o usuário está movendo atualmente configurando Window.skipArrange (o mesmo que é feito para o redimensionamento).

Seria necessário bastante esforço e estou me perguntando se esse esforço seria melhor gasto criando uma GUI separada para reorganizar janelas - imagine um minimapa de todas as janelas que podem ser arrastadas para as posições desejadas. Desta forma, o usuário não está limitado pelo que está atualmente visível na tela e também requer movimentos menores do mouse. Isso pode ser um pop-up ou um plasmóide (como uma barra de tarefas - EU já criei algo assim, mas ainda não encontrei um método de comunicação entre um plasmóide e um script Kwin). Acho que o QML já tem suporte para arrastar itens (como no plasmóide da barra de tarefas), então, de certa forma, isso pode ser mais fácil... se ignorarmos a necessidade de criar uma GUI. Apenas um pensamento...

No words for this idea (I thought it was incredible!). I vote YES! Looking forward to this feature.