bambulab / BambuStudio

PC Software for BambuLab and other 3D printers
GNU Affero General Public License v3.0
2.04k stars 276 forks source link

Bambu Studio steals focus when a print starts. #3046

Open AdrianGarside opened 10 months ago

AdrianGarside commented 10 months ago

Bambu Studio Version

1.7.6.92

Where is the application from?

Bambu Lab Official website

OS version

Windows 11

Additional system information

No response

Printer

P1P & X1C

How to reproduce

Not sure of the exact repro but it's something like this:

Open two instances of BambuStudio Set one to the P1P and trigger a print. Set second to the X1C and trigger a print. Finish prints and go back to start next prints.

BUG: The printer selected second randomly gets switched to in the first instance out of the blue.

This behavior is driving me nuts.

Actual results

Bambu Studio changes the printer on me out of the blue, randomly as far as I can tell (but I'm sure it's not random - just feels like it).

Expected results

A running instance of Bambu Studio should never change the selected printer automatically.

Project file & Debug log uploads

.

Checklist of files to include

walterwongbbl commented 10 months ago

Hi. @AdrianGarside I will help you solve this problem. May I ask if you are the only one using your account, and if someone else has switched to your printer.

AdrianGarside commented 10 months ago

No these are both my printers and I am the only one with access to my account.

AdrianGarside commented 10 months ago

So I think my initial interpretation of what was going on was incorrect. When I was seeing this I had all my instances of Bambu Studio arranged in the central 1/3 of my ultrawide monitor. To better understand things I repositioned the P1P instance in the left 1/3 and kept the X1C instance in the middle 1/3.

And so far I haven't seen the printer change unexpected in those instances. However, I have seen other instances of Bambu Studio randomly jump to the foreground and steal focus. And since in my original repro I had the same 3mf loaded into both I think what actually happened is the 'other' instance randomly jumped to the foreground and stole focus making me believe that the printer had changed on me (since that was the only difference between the two instances).

I have not yet worked out what is causing a background instance of Bambu Studio to jump to the foreground / top of the window stack.

walterwongbbl commented 10 months ago

Hi @AdrianGarside We are unable to locate the issue based on description. If you encounter it again, please provide a screenshot or video. Thank you.

AdrianGarside commented 10 months ago

App windows don't jump to the foreground and steal focus by themselves. You must have code there to do that somewhere. Maybe in response to a print completing?

walterwongbbl commented 10 months ago

@AdrianGarside So you would like to switch to the window of the printer that has finished printing, is that correct?

AdrianGarside commented 10 months ago

No, I don't want Bambu Studio to force a background instance of itself to the foreground and interrupt (and confuse) my interaction with the already foreground instance.

walterwongbbl commented 10 months ago

@AdrianGarside Is everything okay so far?

AdrianGarside commented 10 months ago

@walterwongbbl It's less obvious now that I keep my different instances separate as the instance stealing focus no longer jumps on top of the one I'm interacting with. But I just split them across virtual desktops to make it even easier to manage the different prints I have going / want to queue next. And that made a consistent misbehavior obvious. When I start a print and move onto interacting with another instance, when the first instance switches to the device pane it steals focus. Which with virtual desktops in the mix is extremely obvious as that misbehavior now moves me to the virtual desktop that instance is on.

Also I did upgrade the latest 1.8.2 version so I'm on the latest when I see that misbehavior.

AdrianGarside commented 10 months ago

Another observation. This also repros the problem:

  1. Start a print in one Bambu Studio instance.
  2. Switch focus to a non-Bambu Studio window and do some work.
  3. Click on a different Bambu Studio instance later. BUG: Instead of switching focus to the selected instance, it switches focus to the original Bambu Studio instance from #1. With virtual desktops in the mix this is extremely obvious.
AdrianGarside commented 10 months ago

And it's even more amusing than that. I'd started two prints from two separate instances of bambu studio on the other virtual desktop. The second time I tried to switch focus to the 3rd instance on my main desktop also stole focus and switched back to one of the instances on that second virtual desktop. Seems like there's somehow a queue of focus stealing being set up!

AdrianGarside commented 10 months ago

Gah, no it's worse than that. I've now been switched to that 2nd virtual desktop 3 times! So it's not even 1:1 with print started.

walterwongbbl commented 10 months ago

@AdrianGarside We will try to reproduce this issue

459below commented 9 months ago

I have the same misbehavior on BambuStudio_linux_fedora_v01.08.02.56-20231213.AppImage

Any time the printer starts or finishes a print the window of Bambu Studio jumps to the top of the windows, ripping me out of what I am actually doing. And it does that two to three times each print.

walterwongbbl commented 9 months ago

@459below Was the Bambu program minimized at that time?

459below commented 9 months ago

The BambuStudio window just now jumped right to the front of my windows / focus multiple times during a single print again. It happens when the window is minimized, or not on top and even when it is on a separate virtual workspace. It happens when the print starts calibration and at least twice when the print has finishes. I am using "LAN only mode", Flatpak Bambu Studio 1.8.4, and Gnome 3 here.

walterwongbbl commented 9 months ago

@459below Thank you very much. We will try to reproduce this issue

glbyers commented 7 months ago

I'm experiencing the same behaviour with Bambu Studio 1.8.4.51 installed from flatpak on Linuux & i have to say, it's really peeing me off. Have it running on my workstation while I'm trying to work on another virtual desktop, and every time there's some change, Bambu Studio steals focus. When doing a multi material print, this can happen 100s of times in the space of a few hours, making for an incredibly frustrating experience; like this computers sole task is to take care of Bambu Studio!

Please fix. It's driving me up the wall.

matt-fff commented 7 months ago

I'm running into the same issue with the AMS. Constantly steals focus. I'll be typing in some other window and Bambu Studio interrupts what I'm doing - it usually takes me a bit to figure out why my inputs aren't working, since I have so many monitors.

The only current solution is to close Bambu Studio immediately after starting a print.

reefball commented 3 months ago

I have exactly the same problem, I have 3 bambu printers and 3 monitors usually running multiple instances of Bambu Studio and the software behaves very badly not only stealing focus sometimes at seaming random times but it also leaves a lot of widows open from print notifications that have been resolved either on the printer screens themselves or by for example rebooting the printer, restarting a print etc. It is quite annoying that it is difficult to close all these windows because unless the curser is over that particular closing X box for a very long time it won't regain it's focus on that particular window. I think that somehow Bambu Studio is not running specific individual instances of the program when opened for a different printer and it thinks it's in the same program and get's confused with the focus. Since I have 3 different monitors on my computer perhaps that is the common denomiator as I saw that others on this thread have similar setups.

gratux commented 2 months ago

I am also experiencing this issue. I am using Arch Linux with the i3 window manager.

From what i can tell, when the application is on the "Device" tab, it will continuously steal focus and move on top of other windows on the same workspace. This means if i am typing a comment under this very Github issue with Bambu Studio open on my second monitor, my mouse and keyboard focus will jump to the slicer pretty much on every layer change (it seems to me it is related with the AMS actions on the right side of the window) and interrupt my typing.

If i am on a different workspace (10) on the same monitor as Bambu Studio (1), it will at least not change my workspace, but it still requests to be focused (red). image

Whether the camera stream is running or not does not change anything. However, if i manually click out of the Device tab (for example i switch to Preview instead), this issue seems to stop.

Note this is with a single instance of Bambu Studio running, i generally do not use multiple instances.