Kir-Antipov / cubes-without-borders

A mod that allows you to play Minecraft in a borderless fullscreen window
MIT License
18 stars 8 forks source link

Prevent foreground #10

Closed Qumojo closed 5 months ago

Qumojo commented 6 months ago

Hi, not sure if it is even possible, I looked everywhere, I even tried my luck with python but I can't seem to find a way to prevent minecraft from coming to the foreground when fullscreen. I love playing the game and watch videos using popout window from chrome/opera browsers, they work usually quite well for every other game at fullscreen, but with no luck with minecraft. Any chance that you may find a way to add an option to your mod that prevent minecraft forcing itself to foreground? Thanks a lot for your mod and the effort put in it!

Kir-Antipov commented 6 months ago

Well, this is how I would expect it to work. More than that, that's how it works on my machine:

Demo

However, I'm on Linux, so, I guess, this is yet another Windows-specific issue. I for the love of me do not understand why and under which circumstances it may be valid for a non-always-on-top window to take over an always-on-top one, if it's not in the "exclusive fullscreen" mode.

Since you say that it works fine with other games, I think there's something to be tweaked on the OpenGL side of things. Will definitely look into it!

qixils commented 5 months ago

The hacky fix for #4 in v1.0.0 also resolves this issue on Windows. Bypassing exclusive fullscreen may cause worse performance but... well that's sorta to be expected from using windowed borderless I think haha

Kir-Antipov commented 5 months ago

Figured this might be the case, so thanks for confirming my thoughts. :) In that case, this is one more reason to bring that hacky-ish solution back. Maybe it might even magically resolve #6 :D

Bypassing exclusive fullscreen may cause worse performance but...

That's always been my belief too. However, everything I've read recently while searching for a better solution for #4 suggests that this might not be the case, at least anymore. Decades ago, there was evidently a huge performance difference between exclusive fullscreen and other types of app rendering, but credit where it's due: after all this time, Windows' rendering pipeline has gotten much better and a bit less finicky, so there shouldn't be as much of a difference, if any difference at all, between different rendering modes anymore.

qixils commented 5 months ago

There certainly is some difference. GSync comes to mind as one feature that won't necessarily work without exclusive fullscreen (depends on settings). But again that's to be expected with windowed fullscreen imo

DeisDev commented 5 months ago

I just compared both versions and I don't really see a noticeable difference in performance. I'm sure it probably depends on hardware but I very much prefer the v.1.00 release. No flicker, it's smooth and it just works.

Kir-Antipov commented 5 months ago

No flicker, it's smooth and it just works.

Thanks for the feedback! This fix will definitely come back in the next release, which will feature actual improvements and new features, unlike v1.1.0, where I accidentally followed best practices in the game industry and proactively made something that worked before worse. Sorry about that :D