Hi,

Olly Betts <[email protected]> writes:

> On Tue, Jun 06, 2023 at 02:12:50PM -0400, Maxim Cournoyer wrote:
>> I researched the problem and found that the feature I wanted was implemented
>> using XTest, which is detected at wxWidgets' build time [1].  Looking at the 
>> Debian
>> package dependencies, I found it did *not* depend on the libxtst6 package.
>>
>> [1]  https://github.com/wxWidgets/wxWidgets/issues/17530
>
> Have you actually tested a wx build with this enabled?

Yes, it's enabled in Guix, and my application works there, on the same
target (on top of Debian), e.g. in the environment:

--8<---------------cut here---------------start------------->8---
guix shell gtk+ python python-wxpython wxwidgets
--8<---------------cut here---------------end--------------->8---

If I step out of the environment and rely on the Debian-provided
(XTest-less) python3-wxgtk4.0/libwxgtk3.0-gtk3-0v5 packages instead, my
application no longer works (pressing the virtual keyboard doesn't cause
any text to appear in a text field, say).

> Comments in that ticket suggest that XTest doesn't work on Wayland and
> "Wayland is used by default in Debian 10 and newer" (10 is buster, the
> current stable release right now which is about to become oldstable):
>
> https://wiki.debian.org/Wayland
>
> It looks like there isn't a Wayland-specific implementation in the
> source and src/unix/uiactionx11.cpp uses X11-specific functions so
> building with --with-xtest may not really solve your problem.
>
> Forcing use of X11 for the app may help, e.g.:
>
>   GDK_BACKEND=x11 ./myapp

My application runs strictly in a X11 environment on top of Raspberry Pi
lite (which is based on Debian Bullseye).  That lite image doesn't come
with much and leaves the user choosing the components, similar to an
Arch Linux system.  I think even if for the default Wayland setup of
Debian building wxWidgets with XTest won't provide much, at least it
will be useful for users sticking to X11 and expecting
https://docs.wxpython.org/wx.UIActionSimulator.html?highlight=uiactionsimulator#wx.UIActionSimulator
to work with GTK+.  At any rate, the size of having XTest in the
distribution of libwxgtk3.0-gtk3-0v5 should be minimal, even if it's not
useful to everyone.  On Guix for example, the libxtst package and all
its transitive (referenced) dependencies weighs only 86 MiB:

--8<---------------cut here---------------start------------->8---
$ guix size libxtst
store item                                                       total    self
/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35              40.6    
38.8  47.5%
/gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib          75.3    
34.7  42.5%
/gnu/store/qabydd2r26gcr9s26hzchip3a3h3zhg4-libxcb-1.15             78.5     
3.0   3.7%
/gnu/store/0hvkv5kvrk7ix29pfnbkyppbdxa7ki7n-libx11-1.8.1            81.2     
2.8   3.4%
/gnu/store/zzyywykw7kriln18rxqd82f0k5kidla7-bash-static-5.1.16       1.8     
1.8   2.2%
/gnu/store/z8kgahaarjpl0b1nzpqmzyrm4bbmnxw3-libxext-1.3.4           81.4     
0.1   0.2%
/gnu/store/xkzw5shd6bchzvhv9d6p08hsny749jdd-libxdmcp-1.1.3          75.4     
0.1   0.2%
/gnu/store/i7lls5jbad877g0fv7s87rlw0dgxp3wm-libxi-1.7.10            81.5     
0.1   0.2%
/gnu/store/ck5m2chijap9c8warmx4af7ppc0wixsx-libxtst-1.2.3           81.6     
0.1   0.1%
/gnu/store/yilf64y14qciml3kkj3506i3n2gmaawb-libxau-1.0.10           75.3     
0.0   0.0%
total: 81.6 MiB
--8<---------------cut here---------------end--------------->8---

which is pretty small and probably composed of things already depended
on by the Debian libwxgtk3.0-gtk3-0v5 package.

[...]

>>    * What was the outcome of this action?
>>
>> This bug/wishlist report.
>
> Hilarious, but more useful answers to these questions would be a
> short python script to allow us to easily check if wx.UIActionSimulator
> is working as you expect or not (e.g. currently this script produces
> no output, with working support it should output "...").

Ha!  I think the small program attached demonstrates it well, if you'd
like to try it.

Attachment: uiactionsim_demo.py
Description: Binary data

>> wx.UIActionSimulator from wxPython/wxWidgets should produce key inputs
>> instead of nothing.  It should work like it does on Guix System.
>
> I notice that configure --help describes this feature as "experimental":
>
>   --enable-uiactionsim    use wxUIActionSimulator (experimental)
>
> That might be an outdated status though.

It's been marked experimental for the last 14 years... :-).

Thanks for your attention, and cheers!

-- 
Maxim

Reply via email to