Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window keeps raising itself on gaining focus #888

Closed
VanessaE opened this issue Jan 18, 2021 · 6 comments
Closed

Window keeps raising itself on gaining focus #888

VanessaE opened this issue Jan 18, 2021 · 6 comments
Labels
fix is live in the last release Please download /build the last release and try to reproduce. problem

Comments

@VanessaE
Copy link

VanessaE commented Jan 18, 2021

Version

git commit b6d3143

Operating system type + version

Debian Bullseye/testing, XFCE 4.16

3D printer brand / version + firmware version (if known)

N/A

Behavior

As is common on Linux systems, I have my desktop set to focus-follows-mouse, don't raise windows on clicking, and don't raise on gaining focus. When I need to, I intentionally raise or bury a window with ALT plus one of the mouse buttons.

However, SuperSlicer frequently raises itself after gaining and then losing focus, after a very short delay, even if I do nothing other than slide the mouse pointer across it while aiming for something else sitting on top of it.

You can reproduce this pretty simply: Open SuperSlicer, then open a terminal or some other simple thing, and place it above the SuperSlicer window. Move your mouse back and forth between the two, causing them to repeatedly gain and lose focus, then stop moving, leaving the mouse pointer on the terminal window. After a moment, SuperSlicer will raise itself.

This also affects Prusaslicer (prusa3d#5620), but not any other application on my system.

This is a relatively new phenomenon -- I cannot be 100% certain, but I think it started some time between commits 996a42f and b6d3143. The former is the commit I was using last before updating today, and I could swear that I wasn't able to reproduce this phenomenon before today (i.e. when I filed the Prusaslicer bug).

Project File (.3MF) where problem occurs

N/A

@supermerill
Copy link
Owner

seems something pulled from the PS2.3 code.

@VanessaE
Copy link
Author

Oh my G*D, someone PLEASE find the cause of this and fix it. It is by far the most annoying thing ever to have a program pop up in my face repeatedly after I bury/hide it.

@RealDeuce
Copy link
Sponsor

On my XFCE desktop (which uses click-to-focus), this occurs only when I use ALT-Tab to switch focus, it does not occur when I use the mouse to change focus.

Highly annoying though.

@RealDeuce
Copy link
Sponsor

RealDeuce commented Sep 1, 2021

Looks like it was introduced with this commit: 20f5b7a

"Keep your fingers crossed that it will not break something else."

@RealDeuce
Copy link
Sponsor

Specifically, adding CallAfter() appears to be the cause... calling them immediately rather than using CallAfter() appears to work.

@RealDeuce
Copy link
Sponsor

Pr submitted upstream

@supermerill supermerill added the fixed for the next version That means that you should be able to test it in the latest nightly build label Sep 5, 2021
supermerill pushed a commit that referenced this issue Sep 6, 2021
The CallAfter() on Linux causes weird window focus issues.

For me, using ALT-Tab to switch away from PrusaSlicer/SuperSlicer would cause
PrusaSlicer/SuperSlicer to take back focus after about one second.  Stranger
things reportedly occur with focus-follows-mouse.

The #ifdef is there because it is assumed the CallAfter() was added
in 20f5b7a for a good reason.
supermerill pushed a commit that referenced this issue Sep 6, 2021
The CallAfter() on Linux causes weird window focus issues.

For me, using ALT-Tab to switch away from PrusaSlicer/SuperSlicer would cause
PrusaSlicer/SuperSlicer to take back focus after about one second.  Stranger
things reportedly occur with focus-follows-mouse.

The #ifdef is there because it is assumed the CallAfter() was added
in 20f5b7a for a good reason.
@supermerill supermerill added fix is live in the last release Please download /build the last release and try to reproduce. and removed fixed for the next version That means that you should be able to test it in the latest nightly build labels Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix is live in the last release Please download /build the last release and try to reproduce. problem
Projects
None yet
Development

No branches or pull requests

3 participants