Bug 448732 - Windows using Xorg or XWayland are not brought forward when clicked on using the Task Manager while Show Desktop effect is active
Summary: Windows using Xorg or XWayland are not brought forward when clicked on using ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 5.25.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-01-18 17:32 UTC by guimarcalsilva
Modified: 2023-11-27 00:12 UTC (History)
2 users (show)

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


Attachments
Windows previously opened are not brought forward (3.25 MB, video/mp4)
2022-01-18 17:32 UTC, guimarcalsilva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description guimarcalsilva 2022-01-18 17:32:30 UTC
Created attachment 145625 [details]
Windows previously opened are not brought forward

SUMMARY

Windows are not brought into the foreground after using the Show Desktop button if the app you're clicking on was already open. Sorry if I'm reporting on the wrong component. Check the video for more details.

STEPS TO REPRODUCE
1. Open app 1 and leave it on the screen
2. Open app 2 and also leave it visible
3. Click the Show Desktop Button
4. Click on app 1 in the taskbar

OBSERVED RESULT

App 2 will still be on top even if you click on the app 1 icon.

EXPECTED RESULT

The app the user clicked on in the taskbar should be on top. Please note the Show Desktop function brings the right window to the foreground if such window was minimized when the button was triggered. This bug applies to windows that were already on the screen and got minimized by the effect.

SOFTWARE/OS VERSIONS

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Kernel Version: 5.13.0-25-generic (64-bit)
Graphics Platform: X11
Processors: 6 × Intel® Core™ i5-9400F CPU @ 2.90GHz
Memory: 7,6 GiB of RAM
Graphics Processor: Radeon RX 570 Series

ADDITIONAL INFORMATION

Happens with Xorg and Wayland.
Comment 1 Nate Graham 2022-01-21 02:02:31 UTC
Hmm, this is working for me with current git master when triggering the effect btom from the panel applet and also the Meta+D global keyboard shortcut.
Comment 2 Krešimir Čohar 2022-01-26 03:07:01 UTC
I can confirm this bug on Plasma 5.23.5 using both latte and a plasma panel, it brings into focus properly the window you clicked on only if it's minimized. 

If the window isn't minimized, something strange happens - clicking on it brings it to just below the window that was in focus before you trigger the Show Desktop effect, and the focus remains on the window on top (the window that was in focus before you triggered the effect).
Comment 3 Krešimir Čohar 2022-01-26 03:09:15 UTC
(In reply to Krešimir Čohar from comment #2)
> I can confirm this bug on Plasma 5.23.5 using both latte and a plasma panel,
> it brings into focus properly the window you clicked on only if it's
> minimized. 
> 
> If the window isn't minimized, something strange happens - clicking on it
> brings it to just below the window that was in focus before you trigger the
> Show Desktop effect, and the focus remains on the window on top (the window
> that was in focus before you triggered the effect).

I just tested it again and yes, it brings the focus back to the window that was in focus before you triggered the effect. The window below is both below (not on top) AND out of focus.
Comment 4 guimarcalsilva 2022-01-26 04:10:57 UTC
(In reply to Krešimir Čohar from comment #3)
> (In reply to Krešimir Čohar from comment #2)
> > I can confirm this bug on Plasma 5.23.5 using both latte and a plasma panel,
> > it brings into focus properly the window you clicked on only if it's
> > minimized. 
> > 
> > If the window isn't minimized, something strange happens - clicking on it
> > brings it to just below the window that was in focus before you trigger the
> > Show Desktop effect, and the focus remains on the window on top (the window
> > that was in focus before you triggered the effect).
> 
> I just tested it again and yes, it brings the focus back to the window that
> was in focus before you triggered the effect. The window below is both below
> (not on top) AND out of focus.

Yes. This happens. I noticed I can reliably reproduce the issue with Chromium-based browsers (tested with Vivaldi and Chromium), but strangely enough, it's working correctly for me with other apps.

Nate Grahan (or another developer), can you try reproducing the issue on your end again but switching between a Chromium-based browser and another app? If you click on a browser window that is already visible you should see it doesn't get brought forward like other apps.
Comment 5 Krešimir Čohar 2022-01-26 04:27:18 UTC
(In reply to guimarcalsilva from comment #4)
> (In reply to Krešimir Čohar from comment #3)
> > (In reply to Krešimir Čohar from comment #2)
> > > I can confirm this bug on Plasma 5.23.5 using both latte and a plasma panel,
> > > it brings into focus properly the window you clicked on only if it's
> > > minimized. 
> > > 
> > > If the window isn't minimized, something strange happens - clicking on it
> > > brings it to just below the window that was in focus before you trigger the
> > > Show Desktop effect, and the focus remains on the window on top (the window
> > > that was in focus before you triggered the effect).
> > 
> > I just tested it again and yes, it brings the focus back to the window that
> > was in focus before you triggered the effect. The window below is both below
> > (not on top) AND out of focus.
> 
> Yes. This happens. I noticed I can reliably reproduce the issue with
> Chromium-based browsers (tested with Vivaldi and Chromium), but strangely
> enough, it's working correctly for me with other apps.
> 
> Nate Grahan (or another developer), can you try reproducing the issue on
> your end again but switching between a Chromium-based browser and another
> app? If you click on a browser window that is already visible you should see
> it doesn't get brought forward like other apps.

On my end, the bug doesn't discriminate and it happens with all my windows/applications.
Comment 6 guimarcalsilva 2022-01-26 04:39:13 UTC
(In reply to Krešimir Čohar from comment #5)
> (In reply to guimarcalsilva from comment #4)
> > (In reply to Krešimir Čohar from comment #3)
> > > (In reply to Krešimir Čohar from comment #2)
> > > > I can confirm this bug on Plasma 5.23.5 using both latte and a plasma panel,
> > > > it brings into focus properly the window you clicked on only if it's
> > > > minimized. 
> > > > 
> > > > If the window isn't minimized, something strange happens - clicking on it
> > > > brings it to just below the window that was in focus before you trigger the
> > > > Show Desktop effect, and the focus remains on the window on top (the window
> > > > that was in focus before you triggered the effect).
> > > 
> > > I just tested it again and yes, it brings the focus back to the window that
> > > was in focus before you triggered the effect. The window below is both below
> > > (not on top) AND out of focus.
> > 
> > Yes. This happens. I noticed I can reliably reproduce the issue with
> > Chromium-based browsers (tested with Vivaldi and Chromium), but strangely
> > enough, it's working correctly for me with other apps.
> > 
> > Nate Grahan (or another developer), can you try reproducing the issue on
> > your end again but switching between a Chromium-based browser and another
> > app? If you click on a browser window that is already visible you should see
> > it doesn't get brought forward like other apps.
> 
> On my end, the bug doesn't discriminate and it happens with all my
> windows/applications.

I think I got it. It's a problem with X and Xwayland. On a Wayland session, native Wayland windows switch normally, but it doesn't work with Xwayland windows on a Wayland session and the bug is always present on an X session.

Devs reading this. Try this on an X session or between native Wayland and XWayland windows.
Comment 7 guimarcalsilva 2023-11-27 00:12:19 UTC
This seems to be fixed on Plasma 6