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

After v0.10.0 can't interact with windows that have UI Access #515

Closed
rampaa opened this issue Mar 26, 2023 · 9 comments
Closed

After v0.10.0 can't interact with windows that have UI Access #515

rampaa opened this issue Mar 26, 2023 · 9 comments
Labels
bug Something isn't working priority: normal

Comments

@rampaa
Copy link

rampaa commented Mar 26, 2023

Magpie version 程序版本

0.10.0

Windows version 系统版本

Windows 10 22H2

Related screenshot (optional) 相关截图(可选)

HYmvhE2nXx
hcHuSRdZAj

Reproduction steps 复现步骤

  1. Open a program that has UI Access, e.g. On-Screen Keyboard
  2. Shrink it vertically and place it at the top side of your screen (see the screenshots)
  3. Scale a game with Magpie

You will be able to see the window that has UI Access even after you scale the game with Magpie (as expected) but you won't be able to interact with it. Before Magpie v0.10.0 (e.g. v0.10.0-preview2), we could interact with the window that has UI Access as well.

Interestingly enough, if you place the window that has UI access at the center of your screen, you will be able to interact with it.

Log files 日志文件

magpie.log

@rampaa rampaa added the bug Something isn't working label Mar 26, 2023
@rampaa rampaa changed the title Can't interact with a window that has UI Access After v0.10.0 can't interact with windows that have UI Access Mar 26, 2023
@Blinue
Copy link
Owner

Blinue commented Mar 27, 2023

I believe that this bug was introduced during the fixing of #422. I will fix it soon.

I also want to implement a mechanism for Magpie to collaborate with other programs. While windows with UIAccess permissions can currently stay on top during scaling, if I decide to support touch input, Magpie would also require UIAccess permissions, which would break these programs. This is a game of walls and ladders.

@rampaa
Copy link
Author

rampaa commented Mar 27, 2023

I will fix it soon.

Nice!

I also want to implement a mechanism for Magpie to collaborate with other programs.

Do you have anything concrete in mind? I've developed a program called JL that let's you look up Japanese words and it works with Magpie quite well (it makes itself the topmost window on every clipboard change and you can interact with it with your mouse without it getting the focus) but I wonder if the experience can be made even smoother somehow.

if I decide to #218, Magpie would also require UIAccess permissions, which would break these programs

If you ever decide to do that, please consider supplying an external manifest file so that we can use it without granting it the UI Access. (In case of JL, it would still be able to stay on top Magpie through the aforementioned method but users would need to grant JL the UI Access as well, which as you may know has some pretty inconvenient conditions that must be met.)

@Blinue
Copy link
Owner

Blinue commented Mar 28, 2023

Do you have anything concrete in mind? I've developed a program called JL that let's you look up Japanese words and it works with Magpie quite well (it makes itself the topmost window on every clipboard change and you can interact with it with your mouse without it getting the focus) but I wonder if the experience can be made even smoother somehow.

For example,

  • Magpie will not end scaling when your program gains focus.
  • Magpie will maintain the Z-axis order to ensure that your program is not obscured.
  • You can obtain the scaling factor to display the overlay in the correct position.

If you ever decide to do that, please consider supplying an external manifest file so that we can use it without granting it the UI Access. (In case of JL, it would still be able to stay on top Magpie through the aforementioned method but users would need to grant JL the UI Access as well, which as you may know has some pretty inconvenient conditions that must be met.)

I plan to create a separate program with UIAccess privilege, which can be called when high privilege operations are needed. This way, Magpie itself doesn't need to have UIAccess privilege.

@Blinue Blinue added this to Magpie Mar 28, 2023
@Blinue Blinue moved this to In Progress in Magpie Mar 28, 2023
@Blinue Blinue moved this from In Progress to Todo in Magpie Mar 28, 2023
@Blinue Blinue moved this from Todo to In Progress in Magpie Mar 29, 2023
@Blinue
Copy link
Owner

Blinue commented Mar 29, 2023

无标题

I can’t reproduce the issue on Win11. Magpie works fine with on-screen keyboard, but is incompatible with Magnifier.
Are you running the game as administrator?

@rampaa
Copy link
Author

rampaa commented Mar 29, 2023

Are you running the game as administrator?

Nope. But the bug only seems to happen if I don't run Magpie as administrator. Try shrinking the On-Screen Keyboard vertically as much as possible and run Magpie without the administrator privilege and hopefully you will be able to reproduce it.

(If I run the game as administrator but don't run Magpie as administrator, it seems like Magpie cannot auto scale the game when it's in the foreground. Should I open another issue for this, or is this the expected behavior?)

@Blinue
Copy link
Owner

Blinue commented Mar 29, 2023

(If I run the game as administrator but don't run Magpie as administrator, it seems like Magpie cannot auto scale the game when it's in the foreground. Should I open another issue for this, or is this the expected behavior?)

This bug has been fixed in the latest dev branch. However, if you want to scale windows with administrator privileges, it's recommended to run Magpie as administrator to avoid potential issues.

@rampaa
Copy link
Author

rampaa commented Mar 30, 2023

Correction: The bug is also present in v0.10.0-preview2, I've just didn't notice it because I've always run it as administrator. (I've started to run Magpie without administrator privileges mostly due to #511.) Apologies for the misdirection. The bug is not present in v0.9.1 though.

Blinue added a commit that referenced this issue Apr 3, 2023
@Blinue
Copy link
Owner

Blinue commented Apr 3, 2023

Does this build fix the issue?

@rampaa
Copy link
Author

rampaa commented Apr 3, 2023

Yes, it does fix the issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: normal
Projects
Archived in project
Development

No branches or pull requests

2 participants