On Fri, Jul 10, 2020 at 05:47:32PM +0300, Gabriel Ivăncescu wrote:
On 09/07/2020 19:41, Henri Verbeet wrote:
On Thu, 9 Jul 2020 at 20:51, Rafał Mużyło galtgendo@o2.pl wrote:
On Thu, Jul 09, 2020 at 05:31:34PM +0430, Henri Verbeet wrote:
On Thu, 9 Jul 2020 at 16:12, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
On 08/07/2020 22:36, Rafał Mużyło wrote:
AFAIK, Windows 10 supports multiple desktops / workspaces. Did you try to see what happens in Windows 10 when you switch desktops?
Potentially relevant: https://devblogs.microsoft.com/oldnewthing/20200302-00/?p=103507
Kind of interesting, yet likely orthogonal, as all the time I was (as explicitly noted in the previous post) talking about *X11* virtual desktops.
It was clear that you were talking about X11 virtual desktops, yes. I think ideally we'd map between the two concepts somehow, but the reason I thought that post was potentially relevant was that it describes some of the considerations behind the Windows 10 implementation of virtual desktops.
In my opinion, implementing DWMWA_CLOAKED and then implementing this feature with DWMWA_CLOAKED sounds like the proper solution here. The link Henri posted reveals many reasons why, too.
Rafał, you said that your application pauses when it is minimized by Wine (which is what it does when you switch X11 virtual desktops now), and "disabling" it works. But it works for that particular app.
Other applications might have undesired behavior when disabled, especially because it's not an operation a user can typically do. That's why it's not a good idea (unless Windows also did it, but that's not the case here).
Once again, it would seem someone didn't read the first post.
Right now, wine handles desktop switches by an artificial sequence of minimize/restore. It's not the minimize part that's the problem, it's restore. Now that I think about it, it might just be that 'SetActiveWindow(hwnd)' call... I mean, the problem is that upon getting back to the desktop with the window, the window shouldn't be automatically be given focus if the wm doesn't do it. In the patch I'm skipping minimize step to avoid restoration, but that makes the windows treated by both 'can_activate_window' statics as valid targets for events while being invisible. I'm just using WS_DISABLED to prevent that.
...if it's actually just that SetActiveWindow that's the problem, a cleaner solution would be possible, but I'm not sure how SC_RESTORE works...