kwin-tiling icon indicating copy to clipboard operation
kwin-tiling copied to clipboard

Pager is not updated when a window moved to another desktop

Open ilkerhk opened this issue 6 years ago • 3 comments

This is really a minor issue that doesn't affect the functionality at all. It is a cosmetic issue but maybe its fix is also something simple.

I am using pager to see window layouts. When a window is moved to a virtual desktop (other than the current one) the window size/locations are not updated in the pager. See the images to see what I mean. The first image shows initial layout. Then when I moved konsole into second desktop. In the second image, you can see the layout in pager not updated in desktop 2 and 3.

img1

img2

ilkerhk avatar Apr 05 '18 00:04 ilkerhk

It is a cosmetic issue but maybe its fix is also something simple.

It's probably not. It would require us to do the tiling computations earlier (currently we only do them once you switch to that desktop), and I think that'd require a bit of refactoring in the code.

I'm not gonna do that, but if anyone else wants to try, feel free!

faho avatar Apr 07 '18 19:04 faho

I am writing this comment to ask for an idea for a workaround.

This same issue happens when I connect my laptop to an external monitor if it has different resolution. This time on all desktop layouts mess up.

As a workaround, on monitor connect I am running a script which first restarts plasma and then visits each desktop in a loop using "wmctrl -s"Going to that desktop also fixes pager but this is really poor mans way. Does anyone know a better solution?

What I want to do is to repaint (or refresh) a virtual desktop and pager without actually visiting the desktop. (So I want to stay in desktop #1 but repaint others). I tried xrefresh, xrandr etc. but couldn't find anything. I am guessing there must be a way to this specific to KDE maybe?

thanks.

ilkerhk avatar Dec 13 '18 10:12 ilkerhk

Here is a few lines of change (in tilingmanager.js and tilelist.js) that I am using for the last week or so for the above issues. It is probably not ideal/good way to fix but, I tested for a while and it seems to be working for me after below changes. (Sorry I don't know how to do a patch proposal so I am writing this note.)

EDIT: I realized below is a less ugly way.

In tilelist.js, in Tile.prototype.setClientGeometry, remove below if statement

if (this._currentDesktop != workspace.currentDesktop
             && this._currentDesktop != -1)
   {return;} 

In Tile.prototype.onClientDesktopChanged, after line "this.desktopChanged.emit(oldDesktop, this._currentDesktop);" add

var tmp = workspace.currentDesktop;
if (workspace.currentDesktop != oldDesktop) {workspace.currentDesktop = oldDesktop;}
if (workspace.currentDesktop != this._currentDesktop) {workspace.currentDesktop = this._currentDesktop;}
if (workspace.currentDesktop != tmp) {workspace.currentDesktop = tmp }

ilkerhk avatar Jan 16 '19 17:01 ilkerhk