ArcticaProject / arctica-greeter

Arctica Greeter: Greeter Frontend for LightDM
GNU General Public License v3.0
27 stars 10 forks source link

The magnifier application steals the focus from the password entry #100

Closed tari01 closed 3 months ago

tari01 commented 7 months ago

As the title says, while Magnus is active one cannot type into the entry. I tried a bunch of potential fixes, but nothing productive came out.

sunweaver commented 7 months ago

Patching magnus, maybe? Other magnifiers available?

tari01 commented 7 months ago

Patching magnus, maybe?

Or rewriting it in C, adding features and call it MAGNUM! Magnus is Python and packed with deprecation warnings.

Other magnifiers available?

Neh, I looked very hard. There is one, but it's for KDE. I say let's stick with Gtk.

sunweaver commented 7 months ago

On Mi 06 Dez 2023 10:29:17 CET, Robert Tari wrote:

Patching magnus, maybe?

Or rewriting it in C, adding features and call it MAGNUM! Magnus is Python and packed with deprecation warnings.

Rewriting -> not yet. GNOME has a screen magnifier, probably written
in C. Maybe fork parts of the code and put it into something standalone?

Let's go with the Python version for now and continue from here later.

--

DAS-NETZWERKTEAM c\o Technik- und Ökologiezentrum Eckernförde Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde mobile: +49 (1520) 1976 148 landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: @.***, http://das-netzwerkteam.de

Ionic commented 7 months ago

Is it stealing the focus? Isn't the actual issue that there's no window manager, so that focus requests are just discarded? A different magnifier probably won't help.

tari01 commented 7 months ago

Is it stealing the focus? Isn't the actual issue that there's no window manager, so that focus requests are just discarded? A different magnifier probably won't help.

Actually it would help - if we wrote it or hacked it in a way that the window and its widgets are set to be unfocusable. Then this would simply bounce off:

https://github.com/ArcticaProject/arctica-greeter/blob/6312d50ed472a511040b1c966b0476b236f0c7e9/src/arctica-greeter.vala#L672

But that would be more of a hack than a proper solution.


I think there is a better way, however - one which I tried working on but gave up as I was burning too much time on this already:

https://github.com/ArcticaProject/arctica-greeter/blob/6312d50ed472a511040b1c966b0476b236f0c7e9/src/arctica-greeter.vala#L670

If we could get hold of the Magnus window, we could prevent it from getting focus calls, just like we do with Onboard.

(My approach was to get all toplevel windows, check which one was Magnus and then add the xid to the condition. The problem was finding a property that would distinguish Magnus from the other windows. The window title did not work.)

sunweaver commented 7 months ago

Maybe helpful: in src/arctica-greeter.vala there is a little bit of WM code: https://github.com/ArcticaProject/arctica-greeter/blob/master/src/arctica-greeter.vala#L652

Maybe we you can hack some special case for magnus into it?