Bug 437679 - Dragged windows do not become active and during drag go behind active one
Summary: Dragged windows do not become active and during drag go behind active one
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-25 18:58 UTC by Tim
Modified: 2021-06-12 14:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Latte Layout (15.26 KB, text/plain)
2021-05-25 19:20 UTC, Tim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim 2021-05-25 18:58:13 UTC
SUMMARY
Borderless maximized windows:
When using 2+ monitors with 2+ maximized windows, the last selected one will be dragged, not the one corresponding to the dock

STEPS TO REPRODUCE
1. Maximize two windows on two different screens
2. Select one of them
3. Drag the other one via latte (without clicking on it!)

OBSERVED RESULT
The first one gets dragged


EXPECTED RESULT
The 2nd one should get dragged

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Garuda Linux
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Comment 1 Michail Vourlakos 2021-05-25 19:11:09 UTC
1. I take as granted that you are using Latte 0.9.91 anything lower is not considered valid
2. Behavior advanced settings -> Actions -> Track -> Active Window From Current Screen

have you set [2] properly?
Comment 2 Tim 2021-05-25 19:15:14 UTC
(In reply to Michail Vourlakos from comment #1)
> 1. I take as granted that you are using Latte 0.9.91 anything lower is not
> considered valid
> 2. Behavior advanced settings -> Actions -> Track -> Active Window From
> Current Screen
> 
> have you set [2] properly?

Yes, either of my docks have it set to "Active Window From Current Screen".
Comment 3 Michail Vourlakos 2021-05-25 19:19:17 UTC
Send me also your layout file in order to reproduce
Comment 4 Tim 2021-05-25 19:20:47 UTC
Created attachment 138785 [details]
Latte Layout
Comment 5 Tim 2021-05-25 19:29:29 UTC
(In reply to Michail Vourlakos from comment #3)
> Send me also your layout file in order to reproduce

In case you didn't see it,  I attached the layout (I hope this is no spam)
Comment 6 Michail Vourlakos 2021-05-25 19:33:36 UTC
your layout file works just fine in my system.

1. run in cmd "latte-dock -v" what is your latte version?
2. Are you using Global Scale in your screens?
3. wayland or x11?
Comment 7 Tim 2021-05-25 19:38:12 UTC
I am using lattedock 0.9.91 on x11 and left my global scale option untouched at 100%(In reply to Michail Vourlakos from comment #6)
> your layout file works just fine in my system.
> 
> 1. run in cmd "latte-dock -v" what is your latte version?
> 2. Are you using Global Scale in your screens?
> 3. wayland or x11?

I am using lattedock 0.9.91 on x11 and left my global scale option untouched at 100%
Well I don't mean it doesn't work as intended, it's just, that latte is behaving weird with more than one maximized borderless window (Via the latte settings) - I thought this had nothing to do with the layout
Comment 8 Michail Vourlakos 2021-05-25 19:53:02 UTC
(In reply to Tim from comment #7)
> I am using lattedock 0.9.91 on x11 and left my global scale option untouched
> at 100%(In reply to Michail Vourlakos from comment #6)
> > your layout file works just fine in my system.
> > 
> > 1. run in cmd "latte-dock -v" what is your latte version?
> > 2. Are you using Global Scale in your screens?
> > 3. wayland or x11?
> 
> I am using lattedock 0.9.91 on x11 and left my global scale option untouched
> at 100%
> Well I don't mean it doesn't work as intended, it's just, that latte is
> behaving weird with more than one maximized borderless window (Via the latte
> settings) - I thought this had nothing to do with the layout

please provide a video showing the issue. Your summary is not reproducable in my system or I do not have understood what you are trying to describe. I also use borderless maximized windows always in my layouts. for the video please avoid youtube and use google drive or dropbox link.
Comment 9 Michail Vourlakos 2021-05-25 19:53:17 UTC
waiting video demonstrating the issue
Comment 10 Tim 2021-05-25 20:08:42 UTC
(In reply to Michail Vourlakos from comment #9)
> waiting video demonstrating the issue

Okay, I am very sorry to have wasted your time, I am just confused, it's pretty late in the evening...

https://streamable.com/twystw - I present to you; My tired brain
Comment 11 Michail Vourlakos 2021-05-25 20:15:49 UTC
(In reply to Tim from comment #10)
> (In reply to Michail Vourlakos from comment #9)
> > waiting video demonstrating the issue
> 
> Okay, I am very sorry to have wasted your time, I am just confused, it's
> pretty late in the evening...
> 
> https://streamable.com/twystw - I present to you; My tired brain

this has nothing to do with multiple screens and nothing to do with borderless maximized windows. 

That behavior is intentional. Top panels are used also to contain window titlebars, buttons etc.

The behavior provided is for last active window and not for last maximized window.
Comment 12 Tim 2021-05-26 10:12:06 UTC
(In reply to Michail Vourlakos from comment #11)
> (In reply to Tim from comment #10)
> > (In reply to Michail Vourlakos from comment #9)
> > > waiting video demonstrating the issue
> > 
> > Okay, I am very sorry to have wasted your time, I am just confused, it's
> > pretty late in the evening...
> > 
> > https://streamable.com/twystw - I present to you; My tired brain
> 
> this has nothing to do with multiple screens and nothing to do with
> borderless maximized windows. 
> 
> That behavior is intentional. Top panels are used also to contain window
> titlebars, buttons etc.
> 
> The behavior provided is for last active window and not for last maximized
> window.

Okay, I might not be as confused, as I thought, here I cought it on camera:
https://streamable.com/y7zcwi
Comment 13 Tim 2021-05-26 10:13:38 UTC
Dammit, the video processing got messed up, here is a working link: https://streamable.com/xoaeq3
Comment 15 Michail Vourlakos 2021-05-26 11:29:32 UTC
(In reply to Tim from comment #14)
> https://github.com/UltraBlackLinux/scuffed-private-file-host/blob/master/
> simplescreenrecorder-2021-05-26_12.10.05.mp4
> 
> Streamable sucks, here my very private file host

I dont see any issue in the video. Do you mean that dragged maximized window goes behind the active window?
Comment 16 Tim 2021-05-26 11:31:08 UTC
(In reply to Michail Vourlakos from comment #15)
> (In reply to Tim from comment #14)
> > https://github.com/UltraBlackLinux/scuffed-private-file-host/blob/master/
> > simplescreenrecorder-2021-05-26_12.10.05.mp4
> > 
> > Streamable sucks, here my very private file host
> 
> I dont see any issue in the video. Do you mean that dragged maximized window
> goes behind the active window?

yeah, the window doesn't get selected/activated, like it would, when dragging a window's borders
Comment 17 Michail Vourlakos 2021-05-26 11:33:26 UTC
(In reply to Tim from comment #16)
> (In reply to Michail Vourlakos from comment #15)
> > (In reply to Tim from comment #14)
> > > https://github.com/UltraBlackLinux/scuffed-private-file-host/blob/master/
> > > simplescreenrecorder-2021-05-26_12.10.05.mp4
> > > 
> > > Streamable sucks, here my very private file host
> > 
> > I dont see any issue in the video. Do you mean that dragged maximized window
> > goes behind the active window?
> 
> yeah, the window doesn't get selected/activated, like it would, when
> dragging a window's borders

this needs investigation if it can be possible especially under wayland...
Comment 18 Michail Vourlakos 2021-05-26 15:44:48 UTC
Git commit 4e2c6da5146916c73022fb7694a79a947ec91600 by Michail Vourlakos.
Committed on 26/05/2021 at 15:43.
Pushed by mvourlakos into branch 'master'.

activate dragged window before moving

M  +4    -1    app/wm/tracker/lastactivewindow.cpp

https://invent.kde.org/plasma/latte-dock/commit/4e2c6da5146916c73022fb7694a79a947ec91600
Comment 19 Michail Vourlakos 2021-05-26 15:45:17 UTC
you can check it out in latest master and tell me if it is ok now...
Comment 20 Tim 2021-05-26 17:28:29 UTC
(In reply to Michail Vourlakos from comment #19)
> you can check it out in latest master and tell me if it is ok now...

I finally realized, that I am using the chaotic-aur git build, and that's why I didn't recieve the update yet - I got it now.

I like your solution - It doesn't actually activate the window, but it keeps it in front (intentional?) - Anyways, it works, thank you so much for fixing this!
Sorry again for the confusion from before...
Comment 21 Tim 2021-06-12 14:01:35 UTC
Hmm, I have noticed another problem with your solution:
Since you don't actually activate the window, but still keep it in front, there are some cases like this: https://streamable.com/92m4pb
Is this fixable? I find it pretty annoying.
Comment 22 Michail Vourlakos 2021-06-12 14:16:23 UTC
Describe the problem.
Comment 23 Tim 2021-06-12 14:24:26 UTC
(In reply to Michail Vourlakos from comment #22)
> Describe the problem.

Oh sorry, I hoped it was kind of clear...
So I have the window on the left activated, and I am dragging the window on the right over the window on the left - You'd think it would activate and jump into the front, but actually no, the window below is active, and when using latte to drag the window, it gets dragged and not the window on the very top.
Comment 24 Michail Vourlakos 2021-06-12 14:37:18 UTC
Git commit 2aec29a85555edda7aa2e29a25798cf44344eccf by Michail Vourlakos.
Committed on 12/06/2021 at 14:36.
Pushed by mvourlakos into branch 'master'.

activate dragged window on start

--this way the window is activated properly
and its activation is not canceled from move
action

M  +4    -4    app/wm/tracker/lastactivewindow.cpp

https://invent.kde.org/plasma/latte-dock/commit/2aec29a85555edda7aa2e29a25798cf44344eccf
Comment 25 Tim 2021-06-12 14:57:37 UTC
(In reply to Michail Vourlakos from comment #24)
> Git commit 2aec29a85555edda7aa2e29a25798cf44344eccf by Michail Vourlakos.
> Committed on 12/06/2021 at 14:36.
> Pushed by mvourlakos into branch 'master'.
> 
> activate dragged window on start
> 
> --this way the window is activated properly
> and its activation is not canceled from move
> action
> 
> M  +4    -4    app/wm/tracker/lastactivewindow.cpp
> 
> https://invent.kde.org/plasma/latte-dock/commit/
> 2aec29a85555edda7aa2e29a25798cf44344eccf

Thanks, that works perfectly!