Bug 431242 - Switching between activities doesn't map/unmap windows on active/passive activities
Summary: Switching between activities doesn't map/unmap windows on active/passive acti...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kwin
Classification: Plasma
Component: activities (show other bugs)
Version: 5.18.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-06 22:52 UTC by Antenore Gatta
Modified: 2023-08-21 19:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antenore Gatta 2021-01-06 22:52:45 UTC
SUMMARY

When minimizing a window a signal/event is emitted to say that the window is not visible anymore, the other way around, when we maximize the window another signal is emitted.

In Qt should be the visibilityChanged signal of the QWindow class, in GTK are the map-event and unmap-event signals.

I was expecting the same behavior when switching between activities (and most probably with workplaces), but that doesn't happen, switching between activities, doesn't trigger any event on the windows, that are always as visible.


STEPS TO REPRODUCE

I observed this behavior developing a GTK application, where 
I connect the signal (map|unmap)-event to the main window, I guess, in Qt, I'd do the same with the visibilityChanged signal, but I cannot find if KDE have dedicated signal functions. In Xorg are the XUnmapEvent and XMapEvent.

OBSERVED RESULT

Switching between activities doesn't trigger those signals

EXPECTED RESULT

Switching between activities and probably workplaces, should trigger those signals


SOFTWARE/OS VERSIONS

Operating System: Fedora 32
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.75.0
Qt Version: 5.14.2
Kernel Version: 5.9.16-100.fc32.x86_64
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-8650U CPU @ 1.90GHz
Memory: 30.9 GiB of RAM

ADDITIONAL INFORMATION

In GNOME seems to work switching between workplaces, but I couldn't test myself as I ditched GNOME for the good.

I'm wondering if the same signals should be triggered when the monitor(s) goes offline, like with the power saving, screensaver, etc.
Comment 1 Antenore Gatta 2021-01-06 23:04:58 UTC
I forgot to mention the reason of having these signals.

My use case is a remote desktop client for RDP.

RDP supports a mechanism known as Suppress Output PDU (TS_SUPPRESS_OUTPUT_PDU) to tell the server to not send any frame data, when the window gets minimized.

This saves quite a lot of bandwidth, especially if the remote PC or server is doing a lot of screen updates. When you minimize a window, you don't want that something still draws on it without a good reason, and the same should happen whenever a window is not visible (switching between workplaces, activities, screensaver, etc).

The same use case can be applied to any application that draws on a widget quite regularly, think about games, internet browser, etc. The developer may want to catch the map and unmap events to know when to stop and start again to draw things in his/her widgets.
Comment 2 joelsonejr 2023-08-09 15:57:16 UTC
Hello. 
Do you think that this report relates to a KDE Bug or to a Wishlist / Request?
Comment 3 joelsonejr 2023-08-21 19:10:59 UTC
I'm afraid Plasma 5.18.5 is unfortunately no longer eligible for support or maintenance from KDE.
Plasma is a fast-moving project, and bugs in one version are often fixed in the next one. Please update to Plasma 5.27 as soon as your distro offers it to you. If you need support for Plasma 5.18.5, please contact your distro, who bears the responsibility of providing support for older non-LTS releases.
If this issue is still reproducible in either Plasma 5.27 (the current LTS version) or Plasma 5.27.7 (the latest released version), feel free to re-open this bug report.
Thanks for understanding!