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

Autokey-GTK using X-app is broken when opened from the panel menu #11392

Closed
ineuw opened this issue Jan 2, 2023 · 4 comments
Closed

Autokey-GTK using X-app is broken when opened from the panel menu #11392

ineuw opened this issue Jan 2, 2023 · 4 comments
Labels

Comments

@ineuw
Copy link

ineuw commented Jan 2, 2023

 * Cinnamon version 5.6.5
 * Distribution - Mint 21.1
 * Graphics hardware *and* driver used - onboard intel video standard driver
 * 64 bit

Issue

Autokey-GTK icon menu on the panel has two malfunctions .

  1. The left click of the icon menu should only display one option "Show Main Window". The multiple options menu should appear only with the right mouse button. Currently left and right display the same multi item menu.
  2. When selecting "Show Main Window", after the first time, the window always opens minimized on the panel regardless of the System Settings for windows. All other app window opens maximized as expected.

Steps to reproduce

Set System Settings Windows Behavior Location of newly opened Windows to "Center"
Install Autokey

pip3 install --user https://github.com/autokey/autokey/archive/v0.96.0.zip
  1. May need to log out and in the first time, to see the software appear in the Accessories menu. Start the GTK version and check its Edit/Preferences, and set the icon to be visible in the panel.
  2. These are the installed gtk libraries
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version          Architecture Description
+++-=================-================-============-================================
ii  libgtk-3-0:amd64  3.24.33-1ubuntu2 amd64        GTK graphical user interface library
ii  libgtk2.0-0:amd64 2.24.33-2ubuntu2 amd64        GTK graphical user interface library - old version
@ineuw ineuw added the New label Jan 2, 2023
@mtwebster
Copy link
Member

mtwebster commented Jan 2, 2023

The focus problem is arguably an issue with autokey, though issues like this often also depend on the behavior of individual window managers - it doesn't just occur in Cinnamon, though it can be fixed:

Install dconf-editor (apt install dconf-editor)

Navigate to /org/cinnamon and scroll to the demands-attention-passthru-wm-classes entry. Click on it, uncheck "Use default value", then add 'autokey-gtk' to that list.

This should resolve the focus issue when the window is already opened (there doesn't seem to be any trouble if you 'close' the window each time rather than minimizing or covering it).

Tested with the package manager's version as well (0.95.10-2).


The menu is constructed that way by autokey.

Having a look at autokey/autokey#454 I can explain a bit more about the menu issue (unfortunately I've had to work thru this mess in the past). edit - full disclosure, I've also done my part in making the mess worse.

AppIndicator (and 'AyatanaAppIndicator') don't really have a concept of 'primary activation' - I think it was originally intended for providing panel menus in Ubuntu years back. It's an implementation of the StatusNotifier which has been adopted by many as a replacement to the old GtkStatusIcon/xembed icons (which work only on X11).

There is 'set_secondary_activate_target' that allows you to map a middle mouse click to trigger one of the menu items (in this case it could be the 'show main window' item).

So, they could make the window activatable by a single middle-click. If that were the case, using our xapp applet you can specify that this particular app's middle-click be made into a left-click instead - see https://github.com/linuxmint/xapp/blob/master/schemas/org.x.apps.gschema.xml#L19-L25. This obviously won't help everywhere - mainly just in Cinnamon (though support does exist for Mate and Xfce4.

Assuming it's being used here, Qt's tray 'widget' supports StatusNotifier natively (with xembed as a fallback), and works like we all would expect (left-click activate, right-click menu).

@ineuw
Copy link
Author

ineuw commented Jan 3, 2023

@mtwebster, please don't close this subject. I couldn't reply yesterday. Followed your instructions - I am familiar with the dconf editor and implemented your changes.

As you see, I linked the topic to the related topic so that the Autokey community can help me as well.

@mtwebster
Copy link
Member

I know you have an issue in the autokey repo, and I addressed it in my previous post.

I'll simplify it I suppose:

The current API used (AyatanaAppIndicator) has a method called set_secondary_activate_target that will allow you to assign a middle click to one of the menu items in the status icon's menu. It's a trivial change. And it's the closest you'll get to having a single-click to open the main window for the current autokey-gtk implementation.

I can't do anything about the menu here. I've given you a way to resolve your window focus issue.

@ineuw
Copy link
Author

ineuw commented Jan 3, 2023

Thanks, it was after posting that the Autokey developer told me the same thing. In any case, much thanks for your kind help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants